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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
benjunmun
Beginner


Joined: 23 Feb 2002
Posts: 23

PostPosted: Tue Mar 12, 2002 10:56 pm   

Variables
 
Is there any way to tell how many things a variable is storing?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Mar 12, 2002 11:55 pm   
 
A variable stores 1 thing.

Such as 1 number, 1 string, 1 list, 1 database record. Perhaps you are looking to find out how many items are in that one list? That would be %numitems. You might also want to know how many digits are in that one number: %len(%string(@NumericVariable)). Could it possibly be that you seek to know how many words are in that 1 string? That would be %numwords. If it the number of values in that 1 db record then your going to have to ask someone else.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Mar 13, 2002 12:21 am   
 
Syntax: %numkeys(rec)

returns the number of keys in a database record



TonDiening
Beta Upgrading to 6.26
Reply with quote
benjunmun
Beginner


Joined: 23 Feb 2002
Posts: 23

PostPosted: Wed Mar 13, 2002 3:41 am   
 
Also, Is there a way to create a temporary variable for just that alias?
Reply with quote
dracx
Beginner


Joined: 14 Oct 2000
Posts: 26
Location: USA

PostPosted: Wed Mar 13, 2002 4:36 am   
 
What I do is just toss it out when I'm done...

#VAR myvar
<insert code here>
#UNVAR myvar

There may be a more proper way, but it works.

DracX
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Mar 13, 2002 1:47 pm   
 
Yup, what dracx said. There are no temporary variables, but you can create it and the #UNVAR it. I usually also add a #GAG after #UNVAR so I don't have to see the message that the variable was deleted.

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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