I probably won't seriously use C-Lite until I see a few more 'official steps'.
Currently, for ini processing I use a plugin dll I slapped together.
The plugin simply accesses the old Windows ini functions.
It does not yet support section validation and key iteration.
Recently, I combined a hodgepodge of material into a tD0.dll.
(I will probably just drop the plugin somewhere in the community pool.)
Code:
define tD0_wdl;
/*******************************
tD0_wdl (testDummy)
********************************/
//dynamic data instructions
dllfunction ddGetResult();
dllfunction ddGetVar(_sVarName);
dllfunction ddSetVar(_sVarName, _value);
//ini instructions
dllfunction iniGetPath(_sPath);
dllfunction iniSetPath(_sDirectory, _sFilename);
dllfunction iniReadBool(_sSection, _sKey, _defaultValue);
dllfunction iniReadFloat(_sSection, _sKey, _defaultValue);
dllfunction iniReadInt(_sSection, _sKey, _defaultValue);
dllfunction iniReadStr(_sSection, _sKey, _sDefaultValue, _sResult);
dllfunction iniWriteFloat(_sSection, _sKey, _value);
dllfunction iniWriteInt(_sSection, _sKey, _value);
dllfunction iniWriteStr(_sSection, _sKey, _value);
dllfunction drawfColor(_vec);
// ea (entity array) instructions
dllfunction eaAdd(_easIndex, _ent);
dllfunction eaDelete(_easIndex, _ent);
dllfunction eaDeleteAll(_easIndex);
dllfunction eaGetCount(_easIndex);
dllfunction eaGet(_easIndex, _eaIndex);
dllfunction eaGetCapacity(_easIndex);
dllfunction eaGetSize(_easIndex);
dllfunction eaIndexOf(_easIndex, _ent);
dllfunction eaNew(_easIndex, _eaCapacity);
dllfunction eaSet(_easIndex, _eaIndex, _ent);
dllfunction easDelete();
dllfunction easGet1stFree();
dllfunction easGetCapacity();
dllfunction easNew(_easCapacity, _eaCapacity);
// eLL (entity linked list) instructions
dllfunction eLLAppend(_eLLIndex, _ent);
dllfunction eLLContains(_eLLIndex, _ent);
dllfunction eLLDelete(_eLLIndex, _ent);
dllfunction eLLDeleteAll(_eLLIndex, _eLLClearInUse);
dllfunction eLLGetLength(_eLLIndex);
dllfunction eLLIsEmpty(_eLLIndex);
dllfunction eLLIsInUse(_eLLIndex);
dllfunction eLLNext(_eLLIndex);
dllfunction eLLNextReset(_eLLIndex);
dllfunction eLLPop(_eLLIndex);
dllfunction eLLPush(_eLLIndex, _ent);
dllfunction eLLsDelete();
dllfunction eLLsGet1stFree();
dllfunction eLLsGetIndexOf(_ent);
dllfunction eLLSetInUse(_eLLIndex, _inUse);
dllfunction eLLsGetMaxLimit();
dllfunction eLLsNew(_eLLsMax);
//dllfunction eLLsLoadSet(_fileName, _number);
dllfunction eLLsLoad(_fileName, _number); //loads eLL structure from file
dllfunction eLLsSave(_fileName, _number); //saves eLLs structure to file
dllfunction sfEndsWith(_sIn, _sFind, _ignoreCase); //string ends with
dllfunction sfStartsWith(_sIn, _sFind, _ignoreCase); //string starts with
//phoney menu instructions
//sets factor for sizing / aligning TP set
dllfunction uifTPFactor(_factor);
//stores current active TP (TEXT/PANEL) set
dllfunction uifTPSet(_txt1, _txt2, _pnl);
dllfunction uifTPSetVisible(_visible); //sets visibility of active or old TP (TEXT/PANEL) set
dllfunction uifTPAlign(_txtC, _sLenDefault); //aligns and resizes TP set
dllfunction uifTxtHitTest(_txtC, _str1, _str2); //performs a mouse cursor hit test on TP (TEXT/PANEL) set
dllfunction uifTxtSLenMax(_txt, _txtC, _sLenDefault); //returns max len of strings in text
//dynamic var array instructions
dllfunction vaGet(_vasIndex, _vaIndex);
dllfunction vaIndexOf(_vasIndex, _value);
dllfunction vaResize(_vasIndex, _vaCapacity);
dllfunction vaSize(_vasIndex);
dllfunction vaSet(_vasIndex, _vaIndex, _value);
dllfunction vaSetAll(_vasIndex, _value);
dllfunction vasResize(_vasCapacity);
dllfunction vasSize();
With a plugin a var can be read from file and set like so in C-Script:
Code:
var myVar = 3.14;
//the C-Script var is set to the value in the ini file or the default,
// which is the value in the .wdl file
ddSetVar("myVar", iniReadFloat("vars", "myVar", myVar));
This is relatively easy to do. It only takes a bit of patience and and possibly, a smidgeon of research.