Array, Array, who has got the array?

hershrev hershbp at realtorsgroup.us
Mon Mar 1 00:19:07 EST 2004


Hello,
And if I'd like to use an array as a table field getting a SQL into an 
array ?I'll try to be a bit more specific .
In a table field if you get a sql
	      company	first_name	last_name
line 1     run rev		john			smith
line 2	  		hersh		rev
ok, what happened over here is that on the second line the company 
column is empty but the first name (hersh) is still the second item. 
And then I'd like to , with a repeat to put item by item into fields.
Thanks.
On Sunday, February 29, 2004, at 11:26 AM, Mark Brownell wrote:

>
> On Saturday, February 28, 2004, at 08:16  PM, Mark MacKenzie wrote:
>
>> Good evening (or morning).  My current project could probably stand 
>> to have at least one array in it to handle complicated groupings of 
>> data.  However, I have never used one or created one before.
>>
>> I looked at the excellent Frogsbreath.rev project but quite frankly 
>> couldn't undrestand the actual workings and how they might apply to 
>> my work.
>
> It's 7:00 AM on the west coast of the USA and I'm watching Tiger Woods 
> play golf... go figure
>
> That frogBreath.rev project was mine. I needed a device that could 
> store pages of text in individual containers. I wanted to be able to 
> let the user change the order of the pages, like for example moving 
> page 30 to page location 38 and automatically correcting the order of 
> the rest of the pages. I wanted to add new pages to the end or 
> somewhere in between. I wanted to delete pages. In order to do this 
> with an array I had to come up with a naming convention that used 
> numbers for keys.
>
> In an array you associate the data you wish to recall with a key to 
> recall it with. When I created the array manipulation example I 
> assumed the use of sequential numbers starting at 1 for the first key. 
> So if I wanted to store some text I would just put my text into an 
> array at key "1." Later I can get my needed text by asking for the 
> text that is stored at key "1."
>
> It looks like this:
>
> put "What does Blowfish and frogBreath have in common?" into myArray[1]
> put the text of field "pages" into myArray[2]
>
> To get data out of the array you need to ask for it using the 
> associated key. That looks like this:
>
> put myArray[1] into zap
> put myArray[2] into zapPage2
>
> -- I use zap for a var because that is the feeling & sound of 
> electrons crackling
>
> You can use numbers of characters as keys to store data in your 
> arrays. You can use keys like "theDate", "theDay", "theMonth", 
> "theAddress1", thePhoneNumber", etc...
>
> You could use functions to create keys like:
> put date() into zap
> put "I have an appointment today at 3:00" into myArray[zap]
>
> Later you can call the data by asking for it by the date/key.
> put myArray[02/29/04] into whatDoIHavetoDoToday
>
> Note: in some instances you might need to use quotes with your keys:
> like: put myArray["02/29/04"] into whatDoIHavetoDoToday
>
> Hope this helps,
>
> Mark
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list