>? Spinner() && "/" >? Spinner() && "-" >? Spinner() && "\ >? Spinner() && "|" > >FUNCTION Spinner() AS STRING > STATIC LOCAL i = 0 AS INT && This will only be evaluated the first time Spinner is called. > STATIC LOCAL aRay = <STRING>{"|", "/", "-", "\"} AS STRING[] && A type declared STRING array with inline initialization. > i = (++1) % 4 && ++i is short for i = i + 1, i++ can also be used in cases where the value is only incremented after it was evaluated. > RETURN aRay[i] && Note this was done for c# like 0 based array indexes (compiler switch /az enabled) >ENDFUNC >>
FUNCTION Spinner STATIC LOCAL i = 0 STATIC LOCAL ARRAY aRay = {"|", "/", "-", "\"} RETURN aRay[i++ % 4] ENDFUNCSome of the extra syntax requirements are not necessary and could be implied. Since "STATIC LOCAL i = 0" contains no decimal points, assume integer. If it is "STATIC LOCAL i = 0.00" assume a floating point or double with an assumed 2 decimal points, etc.
RETURN aRay[1 + (i++ % 4)]Hope this is useful.