transfering text?? please help!!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
transfering text?? please help!!
ok, i have 3 text boxes and 1 drop down choice box.
text box for putting in peoples name
text box for putting in animals name
text box for putting in animal number
choice box has 2 options (for argument sake)
now, what i am trying to work out is,
if they pick choice number 1, i want name of person, animal and number to go to a choice 1 card.
but if they pick choice 2 i want the person, animal and number to go to a choice 2 card.
can anyone please help me??
please remember i am female and REAL DUMB so need understanding person to hold my hand and walk me through this, if it can be done
if it helps anyones,
i am blonde
i am beautiful
i have a carton of beer under my arm
please keep your eyes close as the "vision" will be lost on opening of eyes.
thank you
text box for putting in peoples name
text box for putting in animals name
text box for putting in animal number
choice box has 2 options (for argument sake)
now, what i am trying to work out is,
if they pick choice number 1, i want name of person, animal and number to go to a choice 1 card.
but if they pick choice 2 i want the person, animal and number to go to a choice 2 card.
can anyone please help me??
please remember i am female and REAL DUMB so need understanding person to hold my hand and walk me through this, if it can be done
if it helps anyones,
i am blonde
i am beautiful
i have a carton of beer under my arm
please keep your eyes close as the "vision" will be lost on opening of eyes.
thank you
Last edited by smash on Sat Aug 23, 2008 10:54 pm, edited 1 time in total.
As for the coding question, I guess you want to put stuff from the fields into another field on two other cards, responding to the user making a choic in a drop down:
Code: Select all
on menuPick thePick
if thePick = "Choice 1" then
put field "people" && field "animals" && field "number" into field "result" of card "Name of card 1"
go card "name of card 1"
else if thePick = "Choice 2" then
put field "people" && field "animals" && field "number" into field "result" of card "Name of card 2"
go card "name of card 2"
end if
end menuPick
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
ok, what am i doing wrong?
it keeps comming up with
on menupick thepick
if thepick = "choice is 1.1" then
put field "bridlenumber" &&field "horsesname" &&field "ridersname" into field "result" of card "compleat show entries (3)"
end menupick
_compiling at 8:51:48 PM
Type_if: missing 'end if'
Object_ComboBox Menu
Line_end menupick
Hint_
i only put the first choice in to see if it would work.
it keeps comming up with
on menupick thepick
if thepick = "choice is 1.1" then
put field "bridlenumber" &&field "horsesname" &&field "ridersname" into field "result" of card "compleat show entries (3)"
end menupick
_compiling at 8:51:48 PM
Type_if: missing 'end if'
Object_ComboBox Menu
Line_end menupick
Hint_
i only put the first choice in to see if it would work.
The error message states that you're missing the "end if" declaration, so:
The "end if" declaration above the end menuPick was missing. Also, I'm guessing that the contents of the choice drop down will just be "1.1" etc (rather than "choice is 1.1") so you should put exactly what is in the drop down option into the "if" test statement.
Code: Select all
on menuPick thepick
if thepick = "1.1" then
put field "bridlenumber" && field "horsesname" && field "ridersname" into field "result" of card "compleat show entries (3)"
end if
end menuPick
ok i tried that and it came pack with
executing at 9:05:47 PM
Type Chunk: can't find card
Object ComboBox Menu
Line put field "bridlenumber" && field "horsesname" && field "ridersname" into field "result" of card "compleat show entries (3)"
Hint button id 1031 of card id 1014 of stack "C:/Program Files/Revolution Studio/Compleat Show Enteries.rev"
what does that mean.
i am so sorry i dont understand
executing at 9:05:47 PM
Type Chunk: can't find card
Object ComboBox Menu
Line put field "bridlenumber" && field "horsesname" && field "ridersname" into field "result" of card "compleat show entries (3)"
Hint button id 1031 of card id 1014 of stack "C:/Program Files/Revolution Studio/Compleat Show Enteries.rev"
what does that mean.
i am so sorry i dont understand
At the risk of muddying the waters, I might also suggest that the often misunderstood "switch" control structure is a way of making your options clearer.
"switch" will take out all the if/else if/end if stuff and let you avoid too much repetition of stuffing fields on a different card. As long as the fields on the different cards are the same, then you can just change the card name in the different cases, as follows:
is the beginning of the structure and will take the value of thePick as the value to be tested for each "case" - so let's say the choice made was "1.1" - that puts "1.1" into the switch structure to be tested against the first case statement.
The first case statement means that the value is matched and so the destination card name will be loaded into the local variable theCardName
then the "break" statement means that the remaining cases should not be tested, as we've already found our match.
At the end of the switch statement theCardName variable should contain the name of the card to which you want to go, depending on whatever pick was made.
So you can just stuff the fields into the results on (theCardName) using parentheses to make the variable name evaluate and return the actual card name, and then go to the card in question.
I hope I haven't confused you with this.
"switch" will take out all the if/else if/end if stuff and let you avoid too much repetition of stuffing fields on a different card. As long as the fields on the different cards are the same, then you can just change the card name in the different cases, as follows:
Code: Select all
on menuPick thePick
local theCardName
switch thePick
case "1.1"
put "compleat show entries (3)" into theCardName
break
case "1.2"
put "alternative card name" into theCardName
break
end switch
put field "bridlenumber" && field "horsesname" && field "ridersname" into field "result" of card (theCardName)
go card (theCardName)
end menuPick
Code: Select all
switch thePick
The first case statement
Code: Select all
case "1.1"
Code: Select all
put "compleat show entries (3)" into theCardName
At the end of the switch statement theCardName variable should contain the name of the card to which you want to go, depending on whatever pick was made.
So you can just stuff the fields into the results on (theCardName) using parentheses to make the variable name evaluate and return the actual card name, and then go to the card in question.
I hope I haven't confused you with this.
yippee i worked that out.
you guys are my hero.
ok now that i have mastered that LOL
question 1
how to i make them go into the correct columns ?
question 2
actually how do i set up the colums??
question 3
as every time i type in a new name it replaces the original name
sorry as soon as i work this bit out, i think i am pretty right for a little while
cheers
edited to add, oh did i mention i was not that bright sparkout LOL
that soooo confused me LOL
you guys are my hero.
ok now that i have mastered that LOL

question 1
how to i make them go into the correct columns ?
question 2
actually how do i set up the colums??
question 3
as every time i type in a new name it replaces the original name
sorry as soon as i work this bit out, i think i am pretty right for a little while

cheers
edited to add, oh did i mention i was not that bright sparkout LOL
that soooo confused me LOL
The error you have above means that you need to check the card name selected for the destination. It can't be found by the "put field..." statement, so check spelling of the card name. Also check is the destination a card in a substack? You might need to use the long name of the card (eg: put field "bridlenumber" && field "horsesname" && field "ridersname" into field "result" of card "compleat show entries (3)" of stack "C:/Program Files/Revolution Studio/Compleat Show Enteries.rev" ) if the spelling is definitely correct. Otherwise perhaps try going to the card by id instead of the name.
OKsmash wrote:yippee i worked that out.
you guys are my hero.
ok now that i have mastered that LOL![]()
question 1
how to i make them go into the correct columns ?
question 2
actually how do i set up the colums??
question 3
as every time i type in a new name it replaces the original name
sorry as soon as i work this bit out, i think i am pretty right for a little while![]()
cheers
edited to add, oh did i mention i was not that bright sparkout LOL
that soooo confused me LOL

You need to give a bit more info about "the columns" you're trying to set up and how/what is going on the different cards.
Is the results field a table? Usually that would be controlled by setting the "tabStops" in the property inspector. So you might replace
Code: Select all
put field "bridlenumber" && field "horsesname" && field "ridersname" into field "result" of card "blah"
Code: Select all
put field "bridlenumber" & tab & field "horsesname" & tab & field "ridersname" into field "result" of card "blah"
Otherwise you need to tell more about how you're trying to set things up.
As for question 3, you're probably needing to put the results "after" the field on the destination card.
"put ... into" will replace the contents of the destination.
"put ... before" will put the new stuff in front of the existing contents of the destination
"put ... after" will put the new stuff at the end of the destination, so the existing contents will remain.
If you're putting the choice into a table field in the results, you will also need to put a return character on the end of each line, so probably your code will need to be something likeYou would need to make sure the results field is emptied before you start adding the proper entries though, otherwise whatever you have saved in there before will be retained.
"put ... into" will replace the contents of the destination.
"put ... before" will put the new stuff in front of the existing contents of the destination
"put ... after" will put the new stuff at the end of the destination, so the existing contents will remain.
If you're putting the choice into a table field in the results, you will also need to put a return character on the end of each line, so probably your code will need to be something like
Code: Select all
put field "bridlenumber" & tab & field "horsesname" & tab & field "ridersname" & return after field "result" of card "blah"
Last edited by SparkOut on Sat Aug 23, 2008 12:37 pm, edited 1 time in total.
damn you are good sparkout.
ok now that is working fantastic
it is going into the correct columns
but
when i enter another name, it just replaces the name instead of adding it to the next line underneith.
is there a way to do that.
i have got so much from this forum, you guys are awesome
cheers
oh and damn smart too
ok now that is working fantastic
it is going into the correct columns
but
when i enter another name, it just replaces the name instead of adding it to the next line underneith.
is there a way to do that.
i have got so much from this forum, you guys are awesome
cheers
oh and damn smart too
Last edited by smash on Sat Aug 23, 2008 12:42 pm, edited 1 time in total.