transfering text?? please help!!

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Sat Aug 23, 2008 12:39 pm

Thanks! uh... I'm not the best helper in here by a looooong way. Anyway, assuming I've understood your ideas correctly, try the "put ... after" on the previous page (we more or less simulposted so you might not have seen it just above your post)

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Aug 23, 2008 12:50 pm

If your fields contain only 1 line:

Code: Select all

on menuPick thepick
  if thepick = "1.1" then
    put field "bridlenumber" & tab & field "horsesname" & tab & field "ridersname" into field "result" of card 3 of stack "Compleat Show Entries"
  end if
end menuPick 
If multiple lines, then use:

Code: Select all

on menuPick thepick
  if thepick = "1.1" then
    put joinTable(fld "bridlenumber",fld "horsesname",fld "ridersname") into field "result" of card 3 of stack "Compleat Show Entries"
  end if
end menuPick

function joinTable
  put the paramCount into myNrOfColumns
  put 0 until myNrOfLines
  repeat with x = 1 to myNrOfColumns
    if number of lines of param(x) > myNrOfLines then
      put number of lines of param(x) into myNrOfLines
    end if
  end repeat
  put empty into myData
  repeat with x = 1 to myNrOfLines
    repeat with y = 1 to myNrOfColumns
      put line x of param(y) & tab after myData
    end repeat
    delete last char of myData
    put cr after myData
  end repeat
  delete last char of myData
end joinTable
Let me know if this works for you.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

smash
Posts: 99
Joined: Tue Aug 19, 2008 5:18 am

Post by smash » Sat Aug 23, 2008 1:00 pm

oh you did it
it WORKS lol lol lol
oh thank you so much sparkout and BvG
you both have helped me sooo much i cant believe it LOL
i was going bald, pulling my hair out LOL
it has taken you guys half an hour, after i have spent nearly two weeks of trying to read god damn stuff
THANK YOU SO MUCH.
i will now go off and give you some peace, UNTIL i get to the next bit LOL
THANK YOU SO MUCH
regards
tanya

smash
Posts: 99
Joined: Tue Aug 19, 2008 5:18 am

Post by smash » Sat Aug 23, 2008 1:51 pm

LOL ok mark
i put in
on menuPick thepick
if thepick = "1.1" then
put jointable(fld "bridlenumber",fld"horsesname",fld"ridersname") into field "1.1" of card 3 of stack "Compleat Show Enteries"
end if
end menuPick

function joinTable
put the paramcount into myNrOfColumns
put 0 until myNrOflines
repeat with x = 1 to myNrOfColumns
if number of lines of param(x) > myNrOfLines then
put number of lines of param(x) into myNrOfLines
end if
end repeat
put empty into myData
repeat with x = 1 to myNrOfLines
repeat with y = 1 to myNrOfColumns
put line x of param(y) & tab after myData
end repeat
delete last chat of myData
put cr after myData
end repeat
delete last char of myData
end joinTable

and when i went to apply
i received this

compiling at 10:48:19 PM
Type Commands: missing ','
Object ComboBox Menu
Line delete last chat of myData
Hint of

no i put all that in, and i have no idea what i put in, i may add LOL
so what did i do wrong??
cheers
mark
oh and i did not see your post until i came back to say i was having rouble entering the second choice LOL LOL
but ran off to try yours

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Aug 23, 2008 2:10 pm

Hi Tanya,

It should be: delete last char of myData, instead of chat.

It seems you typed everything manually? You could copy-paste...? :roll:

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

smash
Posts: 99
Joined: Tue Aug 19, 2008 5:18 am

Post by smash » Sat Aug 23, 2008 10:46 pm

hi mark, the time difference is going to be a nightmare LOL
ok, now i copied and pasted your (text)
and it just keeps comming up with this

executing at 7:40:42 AM
Type Chunk: no such object
Object ComboBox Menu
Line put joinTable(fld "bridlenumber",fld "horsesname",fld "ridersname") into field "result" of card 3 of stack "Compleat Show Entries"
Hint bridlenumber

i have tried changing "results" to "1.1" which has made now difference (1.1 is also the name of the text table)
now i understand it is saying (i think) that there is no bridlename object, and so i double checked the name of the text box, and that all seems correct.
so i am at a loss of what to do.
cheers

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Aug 23, 2008 11:32 pm

Hi Tanya,

I assumed that the field Bridlenumber is on the same card as your combobox, which contains the script, while field "Result" is on card 3 of your stack. If this assumption is wrong, then you have to adjust the script to refer correctly to all objects.

For example, you may ned to replace fld "Bridlenumber" with fld "Bridlenumber" of cd 2. I don't know where this field is exactly, which means that you have to figure this out for yourself.

Note that according to your script, there is a field Bridlenumber and not a field Bridlename.

Do not give objects names equal to numbers. I don't really think that calling a field "1.1" causes big problems, but I wouldn't recommend it anyway, because if you happen to call an object "1.0" it is an integer and will refer to the first object rather than to the object named "1.0".

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

smash
Posts: 99
Joined: Tue Aug 19, 2008 5:18 am

Post by smash » Sun Aug 24, 2008 12:23 am

mark your assumption is correct.
bridle number
horses name
riders name
are on the same card as the combo box. card (2)

the results 1.1 are on card (3) and results 1.2 are on card (4)
i will go and rename them oneone and onetwo, ok?

smash
Posts: 99
Joined: Tue Aug 19, 2008 5:18 am

Post by smash » Sun Aug 24, 2008 12:33 am

ok mark.
i have changed text tables to oneone and onetwo.
i have changed bridlenumber to bridlename
and have changed the script to suit.

on menuPick thepick
if thepick = "oneone" then
put joinTable(fld "bridlename",fld "horsesname",fld "ridersname") into field "oneone" of card 3 of stack "Compleat Show Entries"
end if
end menuPick

function joinTable
put the paramCount into myNrOfColumns
put 0 until myNrOfLines
repeat with x = 1 to myNrOfColumns
if number of lines of param(x) > myNrOfLines then
put number of lines of param(x) into myNrOfLines
end if
end repeat
put empty into myData
repeat with x = 1 to myNrOfLines
repeat with y = 1 to myNrOfColumns
put line x of param(y) & tab after myData
end repeat
delete last char of myData
put cr after myData
end repeat
delete last char of myData
end joinTable

now i am not getting any warning signs of anything being wrong, but nothing is happening.
so i enter the names into the fields, and click the option, then i go check to text table and nothing is there???
so what am i doing wrong?? besides breathing at this point LOL
cheers

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Aug 24, 2008 12:35 am

Tanya, can you check what is in thePick?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

smash
Posts: 99
Joined: Tue Aug 19, 2008 5:18 am

Post by smash » Sun Aug 24, 2008 12:50 am

god mark, you are going to slap me silly LOL
umm i dont understand oh hang on i think i do LOL
the pick is
1.1 or 1.2 for now
do i need to change the numbers to words (but not the same as the "results oneone")
am i getting close????

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Aug 24, 2008 1:00 am

Tanya,

*slap* ;-)

It is all a bit difficult, because I can't see what you're doing. So, I won't really slap you, don't worry.

Do you have a combobox with "oneone", "onetwo", etc. now, or is that still "1.1" and "1.2"? If it is "1.1" etc. the line

if thepick = "oneone" then

should read

if thepick = "1.1" then

but the names of the fields should not be numbers. Note that text in a combobox really is nothing but text and it is only used by the menuPick script. The text in the combobox normally doesn't need to correspond with field names. You can use numbers wherever you like, except for object names.

I hope you're getting close, but somehow I expect you to report another execution error ;-)

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

smash
Posts: 99
Joined: Tue Aug 19, 2008 5:18 am

Post by smash » Sun Aug 24, 2008 1:14 am

dear mark,
*enjoyed the slap* sorry LOL
ok, everything seems correct and i am NOT getting any error feed back YIPPEE,
but the text in the bidlename, horsesname and ridersname, is not going anywhere.
so i am obviously doing something really wrong

sorry, will need further investigation LOL

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Aug 24, 2008 1:17 am

Hi Tanya,

It appears that I forgot a line at the end of the function. The function should be:

Code: Select all

function joinTable
  put the paramCount into myNrOfColumns
  put 0 until myNrOfLines
  repeat with x = 1 to myNrOfColumns
    if number of lines of param(x) > myNrOfLines then
      put number of lines of param(x) into myNrOfLines
    end if
  end repeat
  put empty into myData
  repeat with x = 1 to myNrOfLines
    repeat with y = 1 to myNrOfColumns
      put line x of param(y) & tab after myData
    end repeat
    delete last char of myData
    put cr after myData
  end repeat
  delete last char of myData
  return myData
end joinTable
Does this help?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

smash
Posts: 99
Joined: Tue Aug 19, 2008 5:18 am

Post by smash » Sun Aug 24, 2008 1:27 am

ok mark,
i copied and pasted that into the script (like a good girl)
and i am getting no error messages, but
the text is still not going anywhere.

on the card 3 which is called Compleat Show Entries (3)
i have a test box that i turned into a table with 3 columns.

this box is called oneone

does this help at all ?

cheers

Post Reply