• Welcome to PlanetSquires Forums.
 

CInifile Documentation

Started by SeaVipe, February 23, 2021, 06:29:54 PM

Previous topic - Next topic

SeaVipe


Hi José, a typo in the documentation for CInifile

DIM cIni AS CInifile = "Test.ini"
DIM csa AS CSafeArray = GetKeyNames("Startup")
FOR i AS LONG = csa.LBound TO csa.UBound
   print csa.GetString(i)            ' <-- S/B GetStr()
NEXT
Clive Richey

José Roca

The correct name is GetString. I only see GetStr in the comments of the source code. Is taht what you mean?

SeaVipe

Sorry José, I wasn't very clear. I should have written the 'Example' in cInifile documentation for 'GetSectionNames'.
QuoteThis line in the example code "print csa.GetString(i)" throws error 18: Element not defined, GetString in 'print csa.GetString(i)'
Change GetString to GetStr and the code compiles and works correctly.
Use 'GetStr' for CSafeArray and 'GetString' for CIninfile.
Clive Richey

Bumblebee

Should also be:
DIM csa AS CSafeArray = cIni.GetKeyNames("Startup")
Failed pollinator.

José Roca

Ok. I have modified it. Thanks for reporting it.