WriteINI 

                        (System Library)

Description:              This subroutine writes a variable's value to an .INI file or a buffer containing one and returns its error code.

Returns:                    Numeric

Usage:                       Script

Format:                      \System\WriteINI(File, Section, VarName, Value [, UseBuff])

Parameters:             File     { varies (text or pointer) }  { required }  { no default: }

                                                Any text expression giving the full path and file name of the .INI file or a pointer to the buffer containing its contents, depending on parameter UseBuff.

                                    Section     { text }  { required }  { no default: }

                                                Any text expression giving the name of the section in the file; this should not include the square brackets delimiting the section.

                                    VarName     { text }  { required }  { no default: }

                                                Any text expression giving the name of the variable for which the value is to be set.

                                    Value     { varies }  { required }  { no default: }

                                                Any giving the value to be assigned to variable VarName.

                                    UseBuff     { Boolean }  { optional }  { default: false }

                                                An optional parameter that is any logical expression; if true (non-0) the value of File must be a pointer to a buffer, if false (0) it is a file that is to be used. The default used if this parameter is omitted is false.

Comments:               This subroutine is a member of the System Library, and must therefore be prefaced by \System\, as shown in the "Format" section. If the application you are developing is a script application, the System variable must be declared in APPMOD.SRC and need not be prefaced by a backslash in the function call.

                             The subroutine returns true (1) if the write was successful and invalid otherwise. If the .INI file, the section, or the variable does not exist, they will be created.

                             Searches performed by this function are case insensitive. Alignment of equal signs in the file is preserved.

Example:

If 1 Main;

[

  System\WriteINI(Concat(Code\LibX\ProjPath,"Config.INI"){filename}, 

                  "SecMgr-Admin" { Name of section }, 

                  "AutoLogOff" { Name of variable }, 

                  10 { Value of variable }, 

                  0 { Write file format }); 

]

This assigns a value of 10 to the variable AutoLogOff in the SecMgr-Admin section of the Config.INI file.

See Also:

CheckFileExist | CheckPathExist | ReadINI | ReadSectINI | WriteSectINI