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
jurz
Novice


Joined: 22 Feb 2002
Posts: 48
Location: Latvia

PostPosted: Thu Mar 08, 2007 7:57 am   

FORALL issue
 
Hi,

I have a variable that holds array of numbers. i.e.
var = 1|3|19|23|45
I'm getting value of this variable using %comget

and a command that inside the script performs
#FORALL @var {enter %i}

Now the problem is, that if I'm setting variable var type to be
"String List" #FORALL cycle works flawlessly no matter what
I do there. However next time i'm doing
#var var %comget(bla bla bla)
the type for var is being set to "Auto Type"
and #FORALL doesn't work anymore. Tho it still holds
list of items similar to first one.

Can anyone give me a suggestion how to force variable type
to be string list? And i'm also wondering is this a bug or a
feature?

Thanks in advance,
Jurz
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Thu Mar 08, 2007 11:14 am   
 
#FORALL @var {#EXEC {enter %i}}
_________________
Discord: Shalimarwildcat
Reply with quote
jurz
Novice


Joined: 22 Feb 2002
Posts: 48
Location: Latvia

PostPosted: Thu Mar 08, 2007 11:43 am   
 
I think you are not getting my point.
#FORALL @var ir not getting executed if variable is of type "Auto Type"
but it does work if @var is of type "String List"
_________________
-Jurz
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Mar 08, 2007 12:35 pm   
 
#CALL %vartype I believe
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Mar 09, 2007 8:08 am   
 
Also I am not sure what you are using %comget for. If you are actually retrieving a value from a COM object it is likely returning either a single typeable value, another COM object, or a variant array. In the case of a variant array you have to %arrget and related functions, for a COM object you would have to refer to its documentation as to usage, and single values would either be a string or number that the autotyping would handle. So perhaps you should provide what your actually doing instead of "bla bla bla".
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
jurz
Novice


Joined: 22 Feb 2002
Posts: 48
Location: Latvia

PostPosted: Mon Mar 12, 2007 7:49 am   
 
Thanks for help everyone, %vartype helped

Vijilante, %comget bla bla bla returns string that looks like 5|1|4|6

-Jurz
_________________
-Jurz
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