I searched these forums all day yesterday and have been unable to find anything on this so here goes. I was wanting to write an array and save that information to a file and then pull that information from that file. Does anyone know how to do this or can give me an example. I have searched numerous websites only to find an array definition and not much help.
asume yer array is called myarray
either you have a global array then you call it with "write_array myarray array.txt" / "read_array myarray array.txt" /
of you have a local array then you have to use the code from inside that proc in your own
chinchin wrote:I didn't know exactly what uplevel was and also what {name file} meant.
Can you put something like C:\text.txt as the name?
Uplevel executes commands in a different scope. One level up means where ever the proc was called from. (so GodOfSuicide is wrong in his previous post)
'name' is the name of your array, 'file' is the name of the file to fetch the contents from.
Thanks for all the help. Now it is much clearer!! But I have one more question. Where does the file array.txt lie in the directory structure of the PC for like say Windows 2000?
chinchin wrote:Thanks for all the help. Now it is much clearer!! But I have one more question. Where does the file array.txt lie in the directory structure of the PC for like say Windows 2000?
Probably in the directory returned by 'pwd' (usually where your .conf resides) unless you've changed your working directory using 'cd' or specify an absolute/relative path. (eg: C:/path/to/file.txt or ../name.ext) Forward slashes are usually okay on windrops too, because cygwin does transparent translation of paths.