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
Ryntrax
Wanderer


Joined: 15 Mar 2004
Posts: 55
Location: USA

PostPosted: Sat Apr 03, 2004 7:08 pm   

using Var's as objects -- syntax
 
#VAR var1 0 0 test will create var1 with value 0 and default value 0 located in class "test"

#var var1.option1 0 0 test
#var var1.option2 "m0nkeY" "m0nkeY" test

This is not setting the option1 and option2 default values. Instead it seems to be setting the last default value to var1. What am I doing wrong?
Reply with quote
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Sat Apr 03, 2004 7:37 pm   
 
I think var1.option1 and var1.option2 are both being read as var1.1.
var1.1 denotes the first element in a zMUD array or zMUD string list.

EDIT: Oops I typo'd element as elemental. Razz
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Apr 03, 2004 11:46 pm   
 
Variables can only have 1 default value. It would seem your trying to make a record variable, you can set a default for a variable of this type by building the entire variable then using:
#VAR variableName {@variableName} {@variableName}

This puts then entire record contents with its special delimeter characters into the default for the variable.
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