December 04, 2020, 11:42:20 AM

Author Topic: [bb] Simple INI Getter by neos300 [ 1+ years ago ]  (Read 493 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Simple INI Getter by neos300 [ 1+ years ago ]
« on: June 29, 2017, 12:28:40 AM »
Title : Simple INI Getter
Author : neos300
Posted : 1+ years ago

Description : Very minimal coding, but it works perfectly.

Code :
Code: BlitzBasic
  1. Function getinifield(file$, group$, fiield$)
  2. fil = ReadFile(file)
  3. Local p$, ingroup, groupname$,f$,rest$
  4. While Not Eof(fil)
  5. .mix
  6. p = ReadLine(fil)
  7. If Left(p, 2) = "//" Or p = "" Then Goto mix
  8. If Left(p, 1) = "["
  9. ingroup = 1
  10. groupname = Mid(p, 2, Len(p) - 2)
  11. Else
  12. If ingroup = 1
  13. equal = Instr(p, "=")
  14. f = Left(p, equal - 1)
  15. rest = Mid(p, equal + 1)
  16. Else Goto mix
  17. EndIf
  18. EndIf
  19. If groupname = group And fiield = Trim(f) Then Return Trim(rest)
  20. Wend
  21. End Function


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal