Page 1 of 1

def dp = debug pause

Posted: Sun Aug 07, 2016 5:56 pm
by Henko
Why does this function definition result in a "syntax error" ??

Re: def dp = debug pause

Posted: Sun Aug 07, 2016 7:59 pm
by rbytes
This works fine

Code: Select all

dp 
END

DEF dp()
  DEBUG PAUSE
END DEF
I was not aware that you could use = to create a def

Re: def dp = debug pause

Posted: Sun Aug 07, 2016 8:22 pm
by Mr. Kibernetik
It is incorrect to use command instead of a function, but you can use commands inside a multi-line function.

It is an error to write LET A = DEBUG PAUSE because command is not a function. This is why you cannot substitute function with a command. But it is ok to use command in a multi-line user function which is just a sequence of commands.

Re: def dp = debug pause

Posted: Mon Aug 08, 2016 6:58 am
by Henko
Thanks, mr. K, i understand.

@Ricardobytes: i use the abbreviation
DEF b_p(a$) = BUTTON_PRESSED(a$)
All the time. I hate typing. :lol: