LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Replacing FOR loop with ARYOP?

Root / Programming Questions / [.]

HTV04Created:
I’ve seen somewhere on here that ARYOP is faster than using FOR loops. How can I change a FOR loop into an ARYOP loop?

You can't just replace any FOR loop with ARYOP; it can only do a few different calculations. For example, if you want to multiply every number in ARRAY_A by 2, and store the results in ARRAY_B, you could use:
ARYOP #AOPMUL,ARRAY_B,ARRAY_A,2
instead of:
FOR I=0 TO LEN(ARRAY_B)-1
 ARRAY_B[I]=ARRAY_A[I]*2
NEXT

I see, thanks.