Results 1 to 8 of 8

Thread: Compiler Directive

  1. #1
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default Compiler Directive

    Having a brain fart.

    What is the compiler directive to display a message and stop compilation? Google is not my friend today. Can't seem to find it.

    On a related noted does anyone have a list of the compiler directives lape supports?
    Never ever approach a computer saying or even thinking "I will just do this quickly".

  2. #2
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    https://villavu.com/forum/showthread...101#post854101

    All compiler directives for lape are at the bottom of that post.

  3. #3
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by Kasi View Post
    https://villavu.com/forum/showthread...101#post854101

    All compiler directives for lape are at the bottom of that post.
    Didn't see what I needed in there but thanks anyway. I'm trying to do something like this:
    Code:
    {$IFNDEF something}
    {$WHAT_IS_THE_NAME_OF_THIS_COMPILER_DIRECTIVE 'This is an error message. Compiling aborted.'}
    {$ENDIF}
    I may be mis-remembering and this was only available back in the days of using SRL with SCAR. I'll re-read that thread more carefully, but I didn't see it in there.
    Never ever approach a computer saying or even thinking "I will just do this quickly".

  4. #4
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    If you want it to stop compiling, why not just put a line with invalid syntax there?
    Code:
    {$IFNDEF something}
    This is an error message. Compiling aborted. //compile fails due to unknown identifiers
    {$ENDIF}

  5. #5
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Bixby Sayz View Post
    Didn't see what I needed in there but thanks anyway. I'm trying to do something like this:
    Code:
    {$IFNDEF something}
    {$WHAT_IS_THE_NAME_OF_THIS_COMPILER_DIRECTIVE 'This is an error message. Compiling aborted.'}
    {$ENDIF}
    I may be mis-remembering and this was only available back in the days of using SRL with SCAR. I'll re-read that thread more carefully, but I didn't see it in there.
    No such thing in Lape, although it would be easy to add.

  6. #6
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by Bixby Sayz View Post
    Didn't see what I needed in there but thanks anyway. I'm trying to do something like this:
    I think the correct term you're looking for is static/assert.

    Not sure about the usefulness of a static assert since lape is interpreted.
    Last edited by Kasi; 02-11-2017 at 04:01 AM.

  7. #7
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Bixby Sayz View Post
    Didn't see what I needed in there but thanks anyway. I'm trying to do something like this:
    Code:
    {$IFNDEF something}
    {$WHAT_IS_THE_NAME_OF_THIS_COMPILER_DIRECTIVE 'This is an error message. Compiling aborted.'}
    {$ENDIF}
    I may be mis-remembering and this was only available back in the days of using SRL with SCAR. I'll re-read that thread more carefully, but I didn't see it in there.
    That directive is called a warning directive or error directive. Lape doesn't have it but in GCC it is as follows:

    #ifdef something
    #warning "This is a warning"
    #endif



    #ifdef something
    #error "Compiling aborted"
    #endif
    I am Ggzz..
    Hackintosher

  8. #8
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    That directive is called a warning directive or error directive. Lape doesn't have it but in GCC it is as follows:

    #ifdef something
    #warning "This is a warning"
    #endif



    #ifdef something
    #error "Compiling aborted"
    #endif
    That was it. I wanted to stop compiling my script if a custom include I use is out of date. I found another way around it at run time but not as clean.
    Never ever approach a computer saying or even thinking "I will just do this quickly".

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
  •