MSI Factory 2.3

INIFile.GetValueNames

INIFile.GetValueNames

This is the first topic This is the last topic  

INIFile.GetValueNames

This is the first topic This is the last topic  

OverviewExamples

table INIFile.GetValueNames (

string Filename,

string Section )

Example 1

value_names = INIFile.GetValueNames(_SourceDrive .. "\\images.ini", "Water");

Gets all of the value names within the "Water" section of the INI file named "images.ini" and stores them in a table called "value_names."

Example 2

-- Get all of the value names in a section of an INI file.

all_values = INIFile.GetValueNames("C:\\Data.ini", "INSTALL");

 

-- Get the error code of the last action.

error = Application.GetLastError();

 

-- If an error occurred, display an error message.

if (error ~= 0) then

   Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);

else

   -- Check to see if there was a value at the second position.

   if (all_values[2] ~= nil) then

       -- Display the name of the second value in the section.

       Dialog.Message("Information", "The second value in the INSTALL section is ".."'"..all_values[2].."'.", MB_OK, MB_ICONINFORMATION);

   else

       -- Notify the user there is no second value.

       Dialog.Message("Information", "There is no second value in the INSTALL section." , MB_OK, MB_ICONINFORMATION);

   end

end

Gets all of the value names within the "INSTALL" section of the INI file named "Data.ini" and stores them in a table called "all_values." If there is a second value in the section, it's name is displayed in a dialog. If there is no second value name, a dialog is shown to notify the user.

See also: Related Actions


Learn More: Indigo Rose Software - MSI Factory - Buy Now - Contact Us