Datafile
Include for handing data files.
Including Code
include ":datafile:datafile";DFOpenDataFile()
Creates a datafile handler.
DFOpenDataFile(file_name, create:=DF_NO_CREATE, flags:=DF_KEYTYPE_STRING)Parameters
Description
filename
Path and name of the data file. (Example ":pkg-name:file-name")
create
Creation flags:
DF_NO_CREATE- Will return an error if the datafile does not exist. *DefaultDF_CREATE- Will create the datafile if it does not exist.
flags
Datafile.em flags:
DF_KEYTYPE_STRING- Elem names will be handled as strings.DF_KEYTYPE_INTEGER- Elem names will be handled as integers.
DFFindElement()
Creates a datafile elem handler.
DFFindElement(byref file_ref, elem_name, create:=DF_NO_CREATE)Parameters
Description
file_ref
Data file to retrieve/create the element in.
elem_name
Name of the element to retrieve.
create
Creation flags:
DF_NO_CREATE- Will return an error if the data elem does not exist. *DefaultDF_CREATE- Will create the data elem if it does not exist.
DFGetElemNames()
Retrieves a list of all elem names that are in a data file.
Parameters
Description
file_ref
The datafile to retrieve the elem names in.
DFGetElemProps()
Retrieves a list of all prop names that are in a data elem.
Parameters
Description
elem_ref
The data elem to retrieve the property names in.
DFGetProp()
Retrieves the information in a cprop, or assigns it a value if told to do-so.
Parameters
Description
elem_ref
The data elem to retrieve the property from.
prop_name
The name of the property to retrieve.
create
Creation flags:
DF_NO_CREATE- Will return an error if the property does not exist. *DefaultDF_CREATE- Will create the property if it does not exist and an assign value is set.
assign_val
Value to set the property to if it is created.
DFPurgeFile()
Erases all elems in a datafile. (WIPES IT CLEAN)
Parameters
Description
file_ref
The datafile to wipe.
Including Code
Это расширенный инклюд для работы с файлами, в нём уже встроен верхний инклюд.
ConfigToDataFile()
Converts a config file to a data file.
This will purge the data file you are writing to!!
Parameters
Description
cfg_file
Can be a reference to a config file or a path to one.
data_file
Can be a reference to a data file or a path to one.
DataFileToConfig()
Converts a data file to a config file.
Parameters
Description
data_file
Can be a reference to a data file or a path to one.
cfg_file
Must be a path to a config file (not a reference).
Code Examples
Пример на основе: pkg\utils\statistics\account.inc
Last updated
Was this helpful?