Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
DooMBoy

# Define

Recommended Posts

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

Share this post


Link to post

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.

Share this post


Link to post

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?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×