Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Fidel
Beginner


Joined: 07 Oct 2009
Posts: 19
Location: Poland

PostPosted: Wed Oct 07, 2009 9:19 pm   

Functions and local variables between windows
 
Hi,

I have two windows win1, win2.

in win2 i have declared function
string f1(string) - returns string, and have one string parameter

is it possible to call this f1 function from win1 and get its result?
I can call f1 with syntax: win2:#NOOP f1("test");
But I don't know if it is possible to get it result.

Second question is, if it is possible to call this function with parameter which is local win1 variable.

win1 function:

$var1 = "test";
win2:#NOOP f1($var1);

But function is not called (probably no parameter is set because variable is local?)

Pawel
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Oct 07, 2009 11:54 pm   
 
The short answer is: no. What you want to do is set up a separate package, containing the function. This package should then be loaded into the session. Any other triggers, functions, and variables that you want to be shared by both windows should also go into this secondary package. Variables that are specific to each window should stay within that window.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
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

© 2009 Zugg Software. Hosted by Wolfpaw.net