TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

class syntax in general

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
viper



Joined: 09 Mar 2006
Posts: 26

PostPosted: Tue Feb 20, 2007 9:36 am    Post subject: class syntax in general Reply with quote

hello again,
up until now, i've only really used the #read and #write commands to read and write vars, aliases, actions, etc. to a file, and only just started looking into the #class command so that i can read and kill a class easily.

So before I would do something like
Code:
#read aliases
. Now I'm doing
Code:
#class aliases read aliases
, because otherwise "#class aliases read" would attempt to open a blank file. Why the repetition of the name? Perhaps there's something I'm not understanding in regards to the differences between #read and #class?

thx
Back to top
View user's profile Send private message
davevnj



Joined: 22 Nov 2006
Posts: 55

PostPosted: Tue Feb 20, 2007 2:45 pm    Post subject: Reply with quote

I think...

#read will read the commands verbatim. So if your file has #class blah open and #class blah close as the first and last commands, you'll get a class out of the read statement, but you could also use #read without the class commands and just execute a bunch of tintin statements that aren't associated with a class.

#class classname read filename will read the commands into a class name that you specify. These names can be different, and you would not be required to have the #class blah open and #class blah close lines.

All in all, I think it's merely a matter of preference. I use "#read" and #class whatever kill"
Back to top
View user's profile Send private message Visit poster's website
mleo2003



Joined: 01 Nov 2006
Posts: 21
Location: Mississippi

PostPosted: Tue Feb 20, 2007 2:47 pm    Post subject: Reply with quote

The reason for the repetition is the first "aliases" is the class name, while the second "aliases" is the file name. The #class command always requires the use of a class name, and in this case, it allows you to keep multiple classes in one file, and using the names, only reading in certain classes when you want to. So, you could read in a "triggers" class from that same file with this command:

Code:
#class triggers read aliases


I guess you can see now why #class aliases read tried to open a blank file, it was looking for a file with no name, and that would definately be a blank file.
Back to top
View user's profile Send private message
viper



Joined: 09 Mar 2006
Posts: 26

PostPosted: Tue Feb 20, 2007 9:47 pm    Post subject: Reply with quote

ok, thx for the explanations =)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group