Advertisement
Guest User

ini sections

a guest
Oct 18th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;IniSectionGet Fuction
  2. ;Get All sections names from Said file and store in said array
  3. IniSectionGet(File,Array)
  4. {
  5.     Local L, R, i, ECont ; added line[/color]
  6.     i = 0 ;Index used for array element number
  7.     Loop, Read, %File%
  8.     {
  9.         StringLeft, L, A_LoopReadLine, 1
  10.       ;Possible Section name, so check right side
  11.         If L = [
  12.         {
  13.             StringRight, R, A_LoopReadLine, 1
  14.          ;If its a right bracket Section found
  15.             If R = ]
  16.             {
  17.                 i++
  18.             ;Econt = Element Contents
  19.                 ECont = %A_LoopReadLine%
  20.                 StringTrimLeft, ECont, ECont, 1
  21.                 StringTrimRight, ECont, ECont, 1
  22.                 %Array%%i% = %ECont%
  23.             }
  24.         }
  25.     }
  26.     %Array%0 = %i%
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement