Results 1 to 5 of 5

Thread: {$define}?

  1. #1
    Join Date
    Jan 2007
    Location
    Nomming bits in your RAM
    Posts
    385
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default {$define}?

    Hello all.

    Is there a way to use $DEFINE in place of a const?

    ex:
    SCAR Code:
    {$DEFINE x=99}
    begin
    writeln(x);
    end.

    SCAR Code:
    ...
    const
      x = 99;

    begin
    writeln(x);
    end.

    If so, can you please tell me how? I can't seem to figure it out. >.<

    Thanks!
    Macro_FTW
    Current Project: Catching up. XD. Potentially back for the summer, depending on how things go.

  2. #2
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just make a procedure where those things are something and then at the top do {$DEFINE consts} then {$IFDEF consts} blahblah; (thanks, Richard).
    Last edited by ian.; 06-28-2009 at 07:22 AM.

  3. #3
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Quote Originally Posted by 99_ View Post
    Just make a procedure where those things are something and then at the top do {$DEFINE consts} then if($DEFINE consts)then blahblah;
    SCAR Code:
    {$IFDEF consts}

    EDIT: Syntax highlighting should make it look like this if its correct:

    Last edited by Richard; 06-28-2009 at 07:21 AM.

  4. #4
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That's what I meant sorry I never use {$DEFINE} Thanks, Richard.

  5. #5
    Join Date
    Jan 2007
    Location
    Nomming bits in your RAM
    Posts
    385
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So you can't? Darn. >.<

    Thanks
    Current Project: Catching up. XD. Potentially back for the summer, depending on how things go.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •