egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Save array to file / restore array from file
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Oct 30, 2009 3:47 pm    Post subject: Reply with quote

Using upvar, I can control at which level I should access the variable, and with a fixed name, while global only access the variable under the same name in globalspace. You could probably modify the code with ease to use global instead.

I'll give you a simple example, as I'm not sure you are keeping the array index name and it's value apart...
Code:
set var "Testing
Testing
Testing"
set myArray($var) "This is a value
spanning multiple lines
and containing several words...
The array index holding this value also has several newlines"

##or simpler:
set myArray(line\ 1\nline\ 2) "Some\ndata..."

Both versions will add values to the myArray array, each value containing at least one newline, and each array index name also containing both newlines and spaces...
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber