Skip to content

psFileName - cIniProcessor

The filename of the INI file

Type: Property
Access: Read/Write
Data Type: String
Parameters: None

Parameters

Parameter Type Description
sValue String

Syntax

Property String psFileName
Access Type Syntax
Read Access: Get psFileName to StringVariable
Write Access: Set psFileName to StringVariable/Value

Description

You must set the psFileName property before you can access an INI file. The filename must be fully-qualified, meaning it must contain a path.

Sample

In this sample, an internet address is read from a Key named "Support" in a Section called "URLs". The INI file is called "App.ini" and located in the same directory as the application.

Function GetURL Returns String
    Handle hoIniFile
    String sUrlSupport

    Get Create U_cIniFile To hoIniFile // create a cIniFile object
    Set psFileName of hoIniFile To (GetApplicationPath(ghoApplication) +"\App.ini")
    Get ReadString of hoIniFile  "URLs" "Support" "" To sUrlSupport
    Send Destroy of hoIniFile // destroy the object we just created
    Function_Return sUrlSupport
End_Function

Note: To acquire the directory name that your application is running in, this sample assumes your program is using an application object (an instance of cApplication)