Update cookies preferences
Promotic

IniFileRead - method of the Pm object

Description:
Reading the item from the *.ini file.
Syntax:
Variant IniFileRead(String sFile, String sSection, String sKey, Variant vDefault, [Long Dt])
Parameters:
sFile(String) The file name with the path.
If a full path is not entered, then it is completed relative to the application folder.
It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files or folders.
sSection(String) Section name (the section is in the INI file inside the square brackets) without the brackets.
If the null value is entered here, then the method returns an array of the INI file section names.
sKey(String) Name of keys of the item that is read.
If the null value is entered, then the method returns an array of the key names of that section of the INI file.
vDefault(Variant) Value that has to be returned if reading the item fails
Dt[optional] (Long) Data type of the read value. Irrelevant if the method returns an array of section names or keys of the INI file. See VBScript constants of data types.
The default value is 8 (=String).
Note:
This method is not functional in Web panels.
Example1:
The example of the *.ini file
[MySettings]
NmbX=0
Object=/Folder0/Timer0
[Data]
Value1=8.2
Value2=3.14
Value3=GoodBy
Example2:
Returns a value of the "Value1" key in the "Data" section (or a substitute value):
JavaScriptVBScriptSelect and copy to clipboard

var Val = Pm.IniFileRead("#cfg:file.ini", "Data", "Value1", "1.0", 4);   // 4=Single, 8=String, ...
Example3:
Returns an array of all section names:
JavaScriptVBScriptSelect and copy to clipboard

var aSections = Pm.IniFileRead("#cfg:file.ini", null, null);
Example4:
Returns an array of the names of all keys in the "Data" section:
JavaScriptVBScriptSelect and copy to clipboard

var aKeys = Pm.IniFileRead("#cfg:file.ini", "Data", null);
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- IniFileRead
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r.o.