Page 1 of 1 1
Topic Options
#121309 - 2004-06-15 11:04 PM Making Array on the fly ?
marguz Offline
Fresh Scripter

Registered: 2002-10-29
Posts: 19
Loc: Illinois
Hello,
I'm reading in an INI file and would like to make an array out of the data. I've tried this

Code:
  
For Each $line In ReadFile("c:\MAC.ini",,)
? $line
If AScan($MAC,$line) =- 1
ReDim preserve $MAC[Ubound($MAC)+1]
$MAC[Ubound($MAC)] = $line
EndIf
Next



I want to populate the new array as it reads in the file because I will have no idea how many lines there will be.

Is this doable?

Top
#121310 - 2004-06-15 11:47 PM Re: Making Array on the fly ?
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
yes it is doable, but unless you just want to reinvent the wheel

fist, look at readproflestring() and writeprofilestring() these to commands are made to read and write from a INI file.

also, i would take a look at this UDF GetINI() it will load a inifile into an array for you, using readprofilestring()


Top
#121311 - 2004-06-16 03:57 AM Re: Making Array on the fly ?
marguz Offline
Fresh Scripter

Registered: 2002-10-29
Posts: 19
Loc: Illinois
Sweet !
Thanks!

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.05 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org