; Check if all required arguments were specified If $ini = "" GoTo Syntax EndIf If $section = "" GoTo Syntax EndIf If $key = "" GoTo Syntax EndIf ; Check if the INI file really exists If Exist( $ini ) = 0 GoTo Syntax EndIf ; Read the requested value from the INI file $val = ReadProfileString( $ini, $section, $key ) ; Display the result ? $ini ? "[$section]" ? "$key=$val" ? ; Normal program termination Exit 0 :Syntax ? "ReadINI.kix, Version 1.01" ? "Read a value from an INI file" ? ? "Usage: KIX32 READINI.KIX $$INI=ini_file $$SECTION=section $$KEY=key" ? ? "Where: " + Chr(34) + "ini_file" + Chr(34) + " is the file name of the INI file to be read" ? " " + Chr(34) + "section" + Chr(34) + " is the section name, without the brackets" ? " " + Chr(34) + "key" + Chr(34) + " is the key whose value must be read" ? ? "Arguments that contain spaces should be enclosed in double quotes" ? ? "Example: if MYPROG.INI looks like this:" ? "[Section 1]" ? "Key1=Value 1" ? "Key2=Value 2" ? "[Section 2]" ? "Key1=Value 3" ? "Key2=Value 4" ? ? "Then the command: KIX32 READINI.KIX $$INI=MYPROG.INI $$SECTION=" + Chr(34) + "section 2" + Chr(34) + " $$KEY=key2" ? "should return: Value 4" ? ? "Written by Rob van der Woude" ? "http://www.robvanderwoude.com" ? Exit 1