• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 What is the sintaxis for initialized 3D, 4d, etc DIM ARRAY ? boriel Administrator Posts: 1,757 Threads: 55 Joined: Aug 2019 Reputation: 24 11-14-2019, 02:11 PM (This post was last modified: 11-14-2019, 02:13 PM by boriel.) You can use _ to break lines for better code legibilty. Also, when doing a DIM by default ZX Basic uses 0 index, o DIM a(3) contains FOUR slots a(0), a(1), a(2) and a(3). If you want to start form 1 like in Sinclair BASIC either compile with --array-base=1 or write it as this: DIM a(1 TO 3) That said, I guess you want: Code:```DIM Array3D(1 TO 3, 1 TO 2, 1 TO 1) AS Ubyte => { _     {{0}, {0}}, _     {{0}, {0}}, _     {{0}, {0}} _ }``` Another way is to use DIM(3, 2, 1) and ignore the 0 position, but you have to initialize it anyway: Code:```DIM Aarray3D(3, 2, 1) AS Ubyte => { _     {{0, 0}, {0, 0}, {0, 0}}, _     {{0, 0}, {0, 0}, {0, 0}}, _     {{0, 0}, {0, 0}, {0, 0}}, _     {{0, 0}, {0, 0}, {0, 0}} _ }``` Hope this helps. « Next Oldest | Next Newest »

 Messages In This Thread What is the sintaxis for initialized 3D, 4d, etc DIM ARRAY ? - by maeloterkim - 11-12-2019, 03:26 PM RE: What is the sintaxis for initialized 3D, 4d, etc DIM ARRAY ? - by Week of the agents - 11-13-2019, 08:43 PM RE: What is the sintaxis for initialized 3D, 4d, etc DIM ARRAY ? - by maeloterkim - 11-14-2019, 12:05 PM RE: What is the sintaxis for initialized 3D, 4d, etc DIM ARRAY ? - by boriel - 11-14-2019, 02:11 PM RE: What is the sintaxis for initialized 3D, 4d, etc DIM ARRAY ? - by maeloterkim - 11-14-2019, 02:24 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)