? How do I use ARYOP on a multi-dimensional array? (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

How do I use ARYOP on a multi-dimensional array?

  • #1 ✎ 1 _xdbc Night Person I like the quiet night and sleep late. Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies I tried array[q](ignoring the second index) but it doesn't work Posted Edited by _xdbc
  • #2 ✎ 1573 12Me21 Head Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website You can only use ARYOP on an entire array at once. Multi dimensional arrays in SB aren't arrays of arrays like they are in some languages. If you want to operate on just one "row", you'll have to COPY the part you want into a temporary array: DIM ARRAY[H,W] DIM TEMP[W] COPY TEMP,ARRAY,q*W,W 'copy ARRAY[q] -> TEMP ARYOP ... TEMP ... COPY ARRAY,q*W,TEMP' copy TEMP -> ARRAY[q] Posted