Not sure what value this is, but...
Posted: Sun Jan 01, 2017 7:32 am
You can apparently define a function using the underscore character. Weird, huh?
I was looking for a way to shorthand multiple PRINT statements and Mr. K turned me on to the idea of creating a function P() to do so. I didn't care for the P, so I tried a bunch of other symbols. Nothing else worked - even emojis, but the underscore (_) did. In hindsight it makes sense since it can be part of a function name like "My_Function()". Another weird option is using a period and underscore "._()" as a function name. Crazy huh?
I was looking for a way to shorthand multiple PRINT statements and Mr. K turned me on to the idea of creating a function P() to do so. I didn't care for the P, so I tried a bunch of other symbols. Nothing else worked - even emojis, but the underscore (_) did. In hindsight it makes sense since it can be part of a function name like "My_Function()". Another weird option is using a period and underscore "._()" as a function name. Crazy huh?
Code: Select all
PRINT "Line 1"!_(5)!PRINT "Line 2" 'Notice the function "_(5)"
def _(x)
FOR n = 1 to x
PRINT
NEXT n
ENDDEF