Re: [Gambas-user] read/data commands

2013-06-28 Thread Fabien Bodard
In gambas Dim grata as integer[][]=[[1,2,3,4][1,2,3,4][1,2,3,4][1,2,3,4]] But also an internal file in gambas can be used Dim a as integer[]=split(file.load("data")) For I =3 to 3 For j = 0 to 3 Adata[i][j]=a[I*j] Next Next Or a structure via gb.setting .. so many ways But for a short sequ

Re: [Gambas-user] read/data commands

2013-06-28 Thread Jussi Lahtinen
I remember read/data statements, but I never used them. There is inline assembler in C... Jussi On Fri, Jun 28, 2013 at 1:23 PM, Caveat wrote: > Think the rest of the list are pretending to be younger than they are! > > Of course I remember read/data statements, it was quite a popular way of >

Re: [Gambas-user] read/data commands

2013-06-28 Thread Caveat
Think the rest of the list are pretending to be younger than they are! Of course I remember read/data statements, it was quite a popular way of getting a little (and sometimes not so little!) snippet of machine code into a basic program. I still have my Spectrum 48k, my ZX81, and my ZX80 :-D K

Re: [Gambas-user] read/data commands

2013-06-27 Thread Keith Clark
Jussi I believe you have it there, thanks. I want to avoid a file for such a small, unchanging dataset. Thanks, Keith On 13-06-27 06:22 PM, Jussi Lahtinen wrote: > How about this? > >Dim data As New Integer[][] >Dim v As New Integer[10, 10] > >data.Add([1, 2, 3, 4, 5]) >data.Ad

Re: [Gambas-user] read/data commands

2013-06-27 Thread Jussi Lahtinen
How about this? Dim data As New Integer[][] Dim v As New Integer[10, 10] data.Add([1, 2, 3, 4, 5]) data.Add([6, 7, 8, 9, 10, 11]) For ii = 0 To data.Max For jj = 0 To data[ii].Max v[ii, jj] = data[ii][jj] Next Next Or maybe you want to read the data from file? Jussi

Re: [Gambas-user] read/data commands

2013-06-27 Thread Tom
The way I remember it was: (your second example) Dim data[5, 5] As Integer On 6/27/2013 5:54 PM, Keith Clark wrote: > No, the data was just an example. What if it were to be 255 unrelated > values? > > Did nobody else use BASIC from the 80s? > > Read/Data statments. > > On 13-06-27 05:48 PM

Re: [Gambas-user] read/data commands

2013-06-27 Thread Keith Clark
No, the data was just an example. What if it were to be 255 unrelated values? Did nobody else use BASIC from the 80s? Read/Data statments. On 13-06-27 05:48 PM, Jussi Lahtinen wrote: > I don't quite understand usage of data... > > Will this do what you want? > > Dim data As Integer[] = [1,

Re: [Gambas-user] read/data commands

2013-06-27 Thread Jussi Lahtinen
Sorry, with your correct variable names; Dim ii As Integer, jj As Integer Dim v As New Integer[5, 5] For ii = 0 To 4 For jj = 0 To 4 v[ii, jj] = jj + 1 Next Next On Fri, Jun 28, 2013 at 12:48 AM, Jussi Lahtinen wrote: > I don't quite understand usage of data... > > Will this do what yo

Re: [Gambas-user] read/data commands

2013-06-27 Thread Jussi Lahtinen
I don't quite understand usage of data... Will this do what you want? Dim data As Integer[] = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5] Dim v As New Integer[] v = data.Copy() Or this: Dim ii As Integer, jj As Integer Dim data As New Integer[5, 5] For ii = 0 To 4 For jj = 0 To 4 data[ii, jj] = jj

Re: [Gambas-user] read/data commands

2013-06-27 Thread Keith Clark
On 13-06-27 05:34 AM, Tobias Boege wrote: > On Wed, 26 Jun 2013, Keith Clark wrote: >> Does Gambas support read/data commands like the following for loading a >> simple array with fixed values? >> >> for t=0 to 4 >> for x = 0 to 4 >> read v(t,x) >> next x >> next t >> >> data

Re: [Gambas-user] read/data commands

2013-06-27 Thread Tobias Boege
On Wed, 26 Jun 2013, Keith Clark wrote: > Does Gambas support read/data commands like the following for loading a > simple array with fixed values? > > for t=0 to 4 > for x = 0 to 4 > read v(t,x) > next x > next t > > data 1,2,3,4,5,1,2,3,4,5,1,2,3,4,5.. > > Maybe I'm jus

[Gambas-user] read/data commands

2013-06-26 Thread Keith Clark
Does Gambas support read/data commands like the following for loading a simple array with fixed values? for t=0 to 4 for x = 0 to 4 read v(t,x) next x next t data 1,2,3,4,5,1,2,3,4,5,1,2,3,4,5.. Maybe I'm just not finding it? -