There are many ways to accomplish what you are asking, and "best" way
depends on many factors including ease of building, ease of access,
speed, readability, etc. That being said, here is one general way to
do it.
Your "database" could be a list of lists. That is, the database is a
single linear list, where each item in the list is a property list.
Here is an example:
jaypdatabase = [\
[#name:"jon", #age:"22"],\
[#name:"irv", #age:"47"],\
[#name:"joe", #age: "105"],\
... as many as you wish ...
]
Or, create the list on startMovie:
global jaypdatabase
on startMovie
jaypdatabse = []
end
And have a routine that adds records to this list:
on addRecord theName, theAge
aRecord = [#name: theName, #age, #theAge]
append(jaypdatabase, aRecord)
end
Once you have established the list structure, then you need one or
more routines to access the data in it. For example, you said that
you want to pull out all the names and put them into a text member.
on getAllNames
resultString = ""
nRecords = count(jaypdatabase)
repeat with i = 1 to nRecords
thisRecord = jaypdatabse[i]
thisName = thisRecord[#name]
resultString = resultString & thisName & RETURN
end repeat
return resultString
end
You could call this handler, and take the resulting text and put into
some text member:
member("SomeTextMember").text = getAllNames()
Given this type of "data structure", you could write routines that could:
1) Given a name, return the first age that matches
2) Given a name, return how many records match
3) Given a name, return a list of all ages that match
4) Given an age, return the first name that matches
5) Given an age, return how many records match
6) Given an age, return a list of all names that match
etc.
Hope this gets you started.
Irv
At 5:10 PM +0000 11/13/01, [EMAIL PROTECTED] wrote:
>hi there. can u help please
>
>im trying to teach my self lists and wondered if i can ask a
>question. i have a simple database type list im creating...
>
>jaypdatabase = [:]
>
>addprop jaypdatabase #name, "jon" , #age "22"
>
>
>etc...
>it works fine...
>
>what im trying to do is....searcg though the list and put all the
>entries of #name in to another text box.
>
>im not theat good in lingo and thought of something liek
>
>repeat with i = 1 to jaypdabase.count
>something....
>
>
>but im not sure how to write it.
>
>Please can someone help this struggling student...
>
>Also. i was experimenting with text boxes and lines and wanted to
>know how i would go about joing text on ie' textbox 1 , line 3 with
>textbox 2, line 10
>
--
Lingo / Director / Shockwave development for all occasions.
(Home-made Lingo cooked up fresh every day just for you.)
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]