Jump to content

OBSE - Does anyone know how to read an ini file into an array?


Recommended Posts

Hi QQuix

 

I tried both "long" and "string_var"

 

Ah... I got the path wrong :)

I didn't add the "\User Files" directory

But it seems the file name isn't being set to start with though... well not when checking with console/debugging/message/print code anyway...

 

I'll correct the path and try again though...

 

Thanks

Link to comment
Share on other sites

This sample code works

 

scn zzTestPluggy

string_var s
string_var sFile
long psFile    ;===Pluggy===
long psFileText    ;===Pluggy===


begin Function {}

  ;=== Setup vars ===
  Let sFile := "Test.ini"
  Let psFile    := CreateString -1 0 1 1
  Let psFileText    := CreateString -1 0 1 1

  ;=== Read file ===
  SetString psFile  $sFile
  FileToString psFile psFileText

  ;=== Show file text ===
  set s to ToOBSE psFileText 
  printc $s

end

As Drake said, RunBatchScript would be simpler, but I can't figure a way to load a variable number of data using console-OK functions.

 

 

Link to comment
Share on other sites

That seems to have fixed that part at least

had to fix 1-2 other small syntax bugs

But I am now finding and reading through the list correctly :)

 

Just need to get the compare to work correctly then it should all be good. :thumbsup:

 

Thanks for your input QQuix very helpful :)

Link to comment
Share on other sites

A quick update

 

After a few more tweaks I've gotten my whole script to work how I wanted it to :)

So now players will be able to easily add their own items to the lists in my upcoming automagical cloud storage mod....

 

Just need to now make the same change to the other 14 scripts :geek:

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...