PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: CInifile Documentation  (Read 200 times)

SeaVipe

  • Senior Member
  • ***
  • Posts: 397
  • Windows 10
CInifile Documentation
« on: February 23, 2021, 06:29:54 PM »


Hi Josť, a typo in the documentation for CInifile
Code: [Select]
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
Logged
Clive Richey
You're Either Part Of The Solution, Or You're The Problem.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

Josť Roca

  • Moderator
  • Guru Member
  • *****
  • Posts: 3325
Re: CInifile Documentation
« Reply #1 on: February 24, 2021, 10:35:23 AM »

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

SeaVipe

  • Senior Member
  • ***
  • Posts: 397
  • Windows 10
Re: CInifile Documentation
« Reply #2 on: February 24, 2021, 01:26:48 PM »

Sorry Josť, I wasn't very clear. I should have written the 'Example' in cInifile documentation for 'GetSectionNames'.
Quote
This 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.
Logged
Clive Richey
You're Either Part Of The Solution, Or You're The Problem.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

Bumblebee

  • Junior Member
  • **
  • Posts: 75
Re: CInifile Documentation
« Reply #3 on: February 24, 2021, 01:29:03 PM »

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

Josť Roca

  • Moderator
  • Guru Member
  • *****
  • Posts: 3325
Re: CInifile Documentation
« Reply #4 on: February 24, 2021, 01:59:12 PM »

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