bjbell52 Posted May 31, 2021 Share Posted May 31, 2021 I'm trying to write a short user defined function in Atari 7800 Basic. I can't find any examples in the sample programs that come with it. The 7800 User Guide says you can and gives this example... It doesn't compile, I get this error message "ERROR, extraneous end statement found. I originally didn't indent the "end" but I tried to indent it and that didn't work. What am I missing? function sgn rem this function returns the sign of a number rem if 0 to 127, it returns 1 rem if -128 to 1 (or 128 to 255), it returns -1 (or 255) rem if 0, it returns 0 if temp1=0 then return 0 if temp1 <128 then return 1 else return 255 end Quote Link to comment Share on other sites More sharing options...
+Karl G Posted May 31, 2021 Share Posted May 31, 2021 The documentation is incorrect - user-defined functions do not need an "end" statement. 4 Quote Link to comment Share on other sites More sharing options...
bjbell52 Posted May 31, 2021 Author Share Posted May 31, 2021 Thanks for the help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.