Values Starting With A Hash (like #TBLUE)
They're like variables you can't change. Constants values with symbolic names. "pre-defined symbolic constants" is right. Sadly, you CAN'T create them, which would be very nice speed-wise.well in the C++ world, a constant is a fixed value a literal constant is just a value, like "Hello World!" or 69 a symbolic constant is a variable with a fixed value. the value has to be provided upon creation
Yes. If you tried to define a 'variable with a fixed value,' all you need is to define a variable and give it a value that you don't change. I don't think they can compile as constant though. The #whatever constants are compiled into the actual values they represent and are actually 'constant.'They're like variables you can't change. Constants values with symbolic names. "pre-defined symbolic constants" is right. Sadly, you CAN'T create them, which would be very nice speed-wise.well in the C++ world, a constant is a fixed value a literal constant is just a value, like "Hello World!" or 69 a symbolic constant is a variable with a fixed value. the value has to be provided upon creation
Yeah, things like #TBLUE are constant literals, not constant variables. They compile to their value, which you can check by typing # and using the help menu. You can't define your own, but if you care enough you could contact them as a feature request.
Constants were introduced in version 3.2.0.
It would be nice if we could make our own as a sort of preprocessor function.
CONST LOLOL=420 PRINT #LOLOLWhich would run through the preprocessor and compile to something along the lines of
PRINT 420Great for speed. Then we could define constants like E or Pi
CONST PI=PI() CONST E=EXP(1) PRINT #PI PRINT #Ewhich would come out looking like
PRINT 3.14159265359 PRINT 2.71828182846