homa
 Guru
 Joined: 05/11/2021 Location: GermanyPosts: 515 |
| Posted: 12:00pm 30 Dec 2025 |
Copy link to clipboard |
 Print this post |
|
> option list PicoMite MMBasic RP2040 V6.01.00 OPTION COLOURCODE ON OPTION CONTINUATION LINES ON OPTION CPUSPEED (KHz) 200000 OPTION DISPLAY 40, 80 > list Dim integer s(9)=(1,2,3,4,5,6,7,8,9,10), t(9) Array Insert t(),s() > run [2] Array Insert t(),s() Error : Argument count >
Question: What is the easiest way to copy one array into another? Without using a loop! Direct assignment is unfortunately not possible: t()=s() “Array Insert” is only for multidimensional arrays?! Or am I missing something here? “Array Insert t(), ,s()” doesn't work either. |
homa
 Guru
 Joined: 05/11/2021 Location: GermanyPosts: 515 |
| Posted: 11:17pm 30 Dec 2025 |
Copy link to clipboard |
 Print this post |
|
Sometimes examples are more helpful than reading manuals! @bfwolf Further exciting findings:
> list Dim integer s(9)=(5,1,3,4,7,7,3,0,0,1),t(9) Dim integer x,i Math v_print s() x=Math(max s(),i) Print x,i Array Add s(),0,t() Math v_print t() Array Add s(),-1,t() Math v_print t() Array Set 0,t() Math v_print t() Math scale s(),1,t() Math v_print t() Math scale s(),2,t() Math v_print t() > run 5, 1, 3, 4, 7, 7, 3, 0, 0, 1 7 4 5, 1, 3, 4, 7, 7, 3, 0, 0, 1 4, 0, 2, 3, 6, 6, 2, -1, -1, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 5, 1, 3, 4, 7, 7, 3, 0, 0, 1 10, 2, 6, 8, 14, 14, 6, 0, 0, 2 >
|