トピック
受付中
Hans nyarglebargle

Has somebody got multiple argument DEFs to work? I can't get them to work. I get a syntax error on the line where I call it.

0そうだね
プレイ済み
返信[1]
親投稿
Ed CPFace
I'm guessing that you're trying to create user-defined routines without return values so that you can call them as commands, like: DEF ROUTINE(X,Y) ... END DEF ROUTINE(A,B) A function with arguments has to return a value. Read the doc for user-defined functions carefully, or post a screenshot of your code so we can see what's up.
0そうだね
プレイ済み
返信[2]
親投稿
Hans nyarglebargle
That's exactly what I've been doing (minus the END DEF, which I believe is wrong). I couldn't even get the doc's examples to work. I did manage to get them working with the DEF FUNC ARG1,ARG2,... OUT X,Y,... definition but it forces me to write the return value to a variable.
0そうだね
プレイ済み
返信[3]
親投稿
Ed CPFace
1) Yeah, "END DEF" should be "END", I'm still thinking in another language. 2) It seems like that's just one of the quirks of this language.
0そうだね
プレイ済み
返信[4]
親投稿
Ed CPFace
Hang on, I was wrong! If you define your function like this: DEF FUNC A,B ... END And call it like this: FUNC A,B It should work. Note the lack of parentheses; I think that was where the problem was. Thank goodness. That's much more useful.
0そうだね
プレイ済み