Hi Neil,
I'll try to explain and give the relevant code without getting to "windy".
I have a global database gDatabase
in movie script
---this is the database I am converting to a text file using File IO
gDatabase = [:]
addProp #date, ""
addProp #name, ""
--on the stage I have a field for a name and a field for a date
member("entry_date").text = gDatabase.date
member ("entry_name").text = gDatabase.name
so far so good, this works and I can save it in fileIO as a text file.
( I want to add a linear list of strings for a property called
#qualifications in gDatabase) and this is where I get lost:
I have a total of 48 checkboxes with each checkbox containing a description
of a skill or qualification. I've broken these up into seven
sections/markers.
on each checkbox is this script:-----it has to change for each marker a
little bit, it was the only way I could figure out how to keep adding to my
temporary global linear list: named gMark1
----this is marker "entry"-------these are all mouseUps on sprites.
property pHilite
on beginsprite me
pHilite = sprite(me.spriteNum)
end
on mouseUp me
text = ""
if sprite(pHilite).member.hilite = TRUE then
if text <> "" then put ":" after text
put sprite(pHilite).member.text after text
end if
addAnswer(text)---------this part here changes and each group of
checkboxes at the various markers also has a slightly different script
end
---------Here's another example for the second marker "entrA"-----------
property pHilite
on beginsprite me
pHilite = sprite(me.spriteNum)
end
on mouseUp me
text = ""
if sprite(pHilite).member.hilite = TRUE then
if text <> "" then put ":" & RETURN & RETURN after text
put sprite(pHilite).member.text after text
put RETURN & RETURN after text
end if
mark2Add(text)
end
-------Here is the code in a Movie Script for marker "entry"---------
on beginQuestions me
-- clear list
gMark1 = []
-- remove previous selections
repeat with i = 1 to the number of members
if member(i).type = #button then
member(i).hilite = FALSE
end if
end repeat
go to frame "entry"
end
--
--
on addAnswer text
-----this part changes depending on the marker
append(gMark1,text)
end
--------on my next button on the stage
on mouseUp
beginQuestions
end
----and so on
so at the end I have one global list gMark1 that contains all the skills,
qualifications that the user has selected by clicking on the checkbox.
>From this point, everything I have tried hasn't worked to place this in the
gDatabase property list.
My intention is to have the user store the name, dates, qualifcations and
then be able to save, retrieve and read the file using fileIO
hope this is clear!
Thanks for your help!
Chris
> From: Neil <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Mon, 30 Jun 2003 10:48:00 -0600
> To: [EMAIL PROTECTED]
> Subject: Re: <lingo-l> totally stumped
>
> I'm not sure I completely follow what you're trying to do, but it sounds
> like you want to do something like this.
>
> In the message window
> txtList = [:]
> txtList.addProp(#cb, "checkbox text")
> put txtList
>
> member("text display").text = txtList.cb
> -- or
> member("tDisp").text = txtList[#cb]
>
> Try this too.
> txtList = ["cBox1","cBox2","cBox3"]
> put txtList
> member("text display").text = txtList[1]
> -- or
> member("tDisp").text = txtList[2]
>
>
> If that's not what you are looking for, maybe post the code you have so we
> can see exactly what you are trying to do and we can help you more.
>
> ...Neil
>
> At 07:29 AM 6/30/2003 -0500, you wrote:
>> Help! I am totally stumped after 4 very long days of trying to figure this
>> out! I thought I understood lists and very simple "databases"--just saving
>> and opening a text file with fileIO. Well silly me!
>>
>> I have a section of this CDRom I am working on that has to capture the text
>> of a checkbox, add it to a linear list (gMark1), and then somehow, some way
>> store it in my database (gDatabase) list at a particular property location.
>> Before it gets stored as a property list in my gDatabase, I need to display
>> the captured text as text (not a list with the quotes and brackets) in a
>> field member.
>>
>> Well, I can get the linear list developed, I can display it as a list in the
>> field member with all the brackets and quotes and commas, I can even get it
>> into the gDatabase, but I can't figure out how to put the linear list at the
>> exact property location in gDatabase and I can't figure out how to display
>> the contents of the linear list without it being in list form (just the
>> text). sigh.
>>
>> This has now become a war between Director and I! Can what I'm trying be
>> done? if so, how do I go about doing it? Any suggestions would be greatly
>> appreciated!
>> Chris
>
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/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!]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/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!]