585,982 active members*
4,549 visitors online*
Register for free
Login
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2015
    Posts
    4154

    if syntax ...

    hello, please, can i verify something like this :

    1) 2 boolean expressions

    v1=11
    v2=22

    IF [ [ v1 EQ 11 ] EQ 1 ] AND [ [ v2 EQ 22 ] EQ 1 ] ...

    2) text

    VUACM[1]='some_text'

    IF [ VUACM EQ 'some_text' ]

    kindly !

  2. #2
    Join Date
    Jun 2015
    Posts
    4154

    Re: if syntax ...

    hello guys & girls i am updating an old code, and i wish to share this :

    Code:
       IF [ condition ] N1                     ( old stuff )
                   GOTO N2
            N1 // true  branch
            GOTO N3
            N2 // false branch
          ( GOTO N3 )
            N3
    
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    
        IF [ condition ]   NTRUE               ( new stuff )
           ( NFALSE ) // false branch
                      GOTO NDONE
             NTRUE    // true  branch
             NDONE    NOEX
    code is shorter & executes faster kindly !

    Quote Originally Posted by deadlykitten View Post
    hello, please, can i verify something like this :
    1) 2 boolean expressions
    v1=11
    v2=22
    IF [ [ v1 EQ 11 ] EQ 1 ] AND [ [ v2 EQ 22 ] EQ 1 ] ...
    hy past self of me
    Code:
     do this :
        IF [ [ [ V1 EQ 11 ] AND [ V2 EQ 22 ] ] EQ 1 ] NTRUE
    * you forgot to use common factor : " EQ 1 "
    
    
    checking multiple conditions is also possible :
        IF [ [ [ condition_1 ] AND [ condition_2 ] AND [ condition_3 ] ... AND [ condition_n ] ] EQ 1 ] NTRUE
    * the only restriction, is that the entire text must be contained within 1 line of code
    Quote Originally Posted by deadlykitten View Post
    2) text
    VUACM[1]='some_text'
    IF [ VUACM EQ 'some_text' ]
    still have no clue / it may not be possible, but is not a must
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  3. #3
    Join Date
    Jun 2015
    Posts
    4154

    Re: if syntax ...

    Code:
        IF [ condition ]   NTRUE               ( new stuff )
           ( NFALSE ) // false branch
                      GOTO NDONE
             NTRUE    // true  branch
             NDONE    NOEX
    code is shorter & executes faster
    hello bellow are even faster execution codes, and there is room for more; the gain in speed between variants of previous post from 2018, and the one from today, is much more smaller, much more subtle, thus this post should have no relevancy for average codes, but only for situations where computation times really matters, like heavy loaded math driven codes, that affect execution time

    if you feel like you need speed, then, to boost up code, get rid of comments, spaces, shorten the N*** sequence names, join blocks&codes, and in the end, nothing beats linear simple code ... unless, there is situation where linear code will not perform better than a macro, and this is a class of specific cutting operations

    in short, to get speed, is needed to reduce the space that the code requires, making it much more dense, and writing it in a way that scenarios that usually execute will not pass through condition of those cases that execute with less frequency; as more and more conditions are used, the code becomes harder to follow, and for such situations i use a simple to read code, on which i apply formatting functions to make it denser, thus all debuging does not occur on the code in it's final shape / kindly

    Code:
        IF [ condition ] NT
           ( false     ) // false branch
                       GOTO ND
             NT        // true  branch
             ND        NOEX
    
    
     ( . . . . . . . . . . . . . . . . . . )
    
    
     IF[condition]NT
          // false branch
          GOTO ND
     NT   // true  branch
     ND // replace NOEX with next block
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

Similar Threads

  1. G43.4 syntax
    By Zeke13 in forum Fanuc
    Replies: 2
    Last Post: 04-19-2015, 07:06 AM
  2. Syntax check???
    By barbter in forum NCPlot G-Code editor / backplotter
    Replies: 1
    Last Post: 10-14-2011, 05:44 PM
  3. Need help with VB script Syntax Please.
    By Adamj12b in forum Mach Software (ArtSoft software)
    Replies: 6
    Last Post: 09-18-2008, 01:18 PM
  4. Need a bit of help identifying some syntax
    By ethyrial in forum G-Code Programing
    Replies: 3
    Last Post: 07-24-2008, 03:05 AM
  5. Syntax question
    By doug6949 in forum Mastercam
    Replies: 2
    Last Post: 12-13-2004, 08:14 PM

Tags for this Thread

Posting Permissions

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