Cyberdemon
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > # Define
 
Author
All times are GMT. The time now is 17:04. Post New Thread    Post A Reply
DooMBoy
Heh
(but Stupidity still cannot be concealed)


Posts: 8509
Registered: 12-00


Could someone please explain to me exactly how #Define is used in a script? I can't seem to get it to work...

__________________
Heh

Old Post 10-07-02 19:56 #
DooMBoy is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
VolteFace
Member


Posts: 483
Registered: 03-02


Well, in standard C it's like this:

#define <constant> <value>

so

#define PRG_SOMEVALUE 7

would create the constant 'PRG_SOMEVALUE' and assign it the value of
7. Then, in place of '7' in your program, you could use PRG_SOMEVALUE
for readability. You can also use #define to make simple functions,
but I don't know if ACS supports that.

Also, I haven't used C in years, so forgive me if I'm wrong.

Old Post 10-07-02 20:09 #
VolteFace is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
mmnpsrsoskl
Spasmolytic


Posts: 1787
Registered: 06-01



ZDoom Editing Manual:
Define

Replaces an identifier with a constant expression.

#define <identifier> <constant-expression>

Whenever "identifier" is used in the source, the "constant-expression" is substituted. This is similar to a macro or keyboard short-cut.


Does that help?

__________________
You know, I never really updated this thing right here, so I thought i'd better put something in here, such as this annoying and stupid sentence. Yeehaw.

Old Post 10-08-02 12:40 #
mmnpsrsoskl is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 17:04. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > # Define

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.