Advertisement
gribbleshnibit8

NVSE Load an INI file by Sections

Mar 2nd, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. ; This script requires Lutana NVSE v11.1 or higher
  2. ; This script is an example of loading an INI file by sections.
  3. scn LoadINIFile
  4.  
  5. array_var arrInput
  6. array_var arrSections
  7. array_var arrSect
  8. array_var arrKeys
  9.  
  10. BEGIN _Function {arrInput}
  11.  
  12. ; Loads the names of all sections into an array
  13. let arrSections := GetINISectionNames
  14. if eval (ar_Size arrSections == 0)
  15. Return
  16. endif
  17.  
  18. ; Loops through the sections array, getting each section
  19. foreach arrSect <- arrSections
  20.  
  21. ; Get the keys from the current section, continue if no keys
  22. let arrKeys := GetINISection $arrSect["value"]
  23. if eval (ar_Size arrKeys == 0)
  24. Continue
  25. endif
  26.  
  27. ;Insert code or call custom function to deal with the keys here
  28.  
  29. loop
  30. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement