Author Topic: Just Something I Never Knew  (Read 541 times)

I just discovered by chance that you can use :: in local variables, just as you can in global variables. I never knew that before and I've never seen anyone do it.

Code: (Example) [Select]
%my::Fish = 3;
%my::Fish -= 2;
%my::Fish *= 5;
echo(%my::Fish);
5

Colons can be used anywhere in any variable name, except for the start and end - the "end" includes immediately before an array access, so %var:[%index] is not legal.  There is no limit to how many colons may be placed sequentially in a variable name.  The only place that colons carry special signifigance is in the biconditional (Bool ? A : B) and function names (Class::MethodName and Parent::FunctionName).

echo(%test:test?%test::test:%test:::test);