Page 1 of 2

Put item from “scrolling list field” into variable? - Solved

Posted: Wed Jan 22, 2014 11:37 am
by DR White
How do I select an item from “scrolling list field” and put it into a variable?

Thanks,

David

Re: Put item from “scrolling list field” into variable?

Posted: Wed Jan 22, 2014 12:59 pm
by ChrisMukrow

Code: Select all

put line 1 of field "yourfieldname" into yourvariablename
Chris

Re: Put item from “scrolling list field” into variable?

Posted: Wed Jan 22, 2014 12:59 pm
by jmburnod
Hi David,

If I understand correctly what you want I think "hilitedlines" is the magic word for you.

Best regards
Jean-Marc

Re: Put item from “scrolling list field” into variable?

Posted: Wed Jan 22, 2014 2:23 pm
by DR White
Jean-Marc and Chris,

With each of your help the following code works well:

put hilitedline of field "MotorList" into test1
put line test1 of field "MotorList" into tListItem

Thanks, :D

David

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed Jan 22, 2014 2:26 pm
by MaxV
I always used:

Code: Select all

the selectedtext of me
What is the correct one?

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed Jan 22, 2014 2:43 pm
by jmburnod
Hi MaxV,

I use rather hilitedlines because the hilitedlines is a best way to store it

Best

Jean-Marc

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed Jan 22, 2014 2:44 pm
by Klaus
Hi Max,

both "hilitedline..." and "the selected text of me" are valid and do the job :D
The difference is that the latter needs less typing.


Best

Klaus

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed May 07, 2014 9:40 am
by robm80
This is my script to go to a card. In the scrolling list field there is hilited line "foo".

on mouseUp
get line (the hilitedLines of field "myfield") of field "myfield"
put it into whatcard //so far OK
go to card whatcard //does nothing
end mouseUp

please help
Rob

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed May 07, 2014 9:52 am
by Simon
Hi Rob,
In the field script this works:

Code: Select all

on mouseUp
put the selectedText of me into whatCard
go to card whatcard
end mouseUp
Only the name of the card should be in the field.

Simon

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed May 07, 2014 12:01 pm
by robm80
Simon,
Your script:
on mouseUp
put the selectedText of me into whatCard
go to card whatcard
end mouseUp
Compare it with my script:
on mouseUp
get line (the hilitedLines of field "myfield") of field "myfield"
put it into whatcard //so far OK
go to card whatcard //does nothing
end mouseUp
Both scripts do not work.
Why not?

here a part of my scrolling field list:
sshot-7.jpg
sshot-7.jpg (10.48 KiB) Viewed 8605 times

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed May 07, 2014 12:05 pm
by Simon
Hi Rob,
Why not?
errr... I'm not actually clairvoyant, Klaus is.

Can you post your stack?

Simon

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed May 07, 2014 12:22 pm
by robm80
Can you post your stack?
How do I post a stack ??
It is not accepted as attachment.
If I can get an emailaddress, I can send it.

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed May 07, 2014 12:25 pm
by Klaus
Hi Rob,

I think you need at least 10 posting before you can post attachments.
I can offer to take a look at your stack, send it to:
klaus AT major-k.de


Best

Klaus

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed May 07, 2014 4:26 pm
by jacque
When a "go" command fails the reason is placed into the result, so you can check that to see what went wrong.

Code: Select all

go to card whatcard
put the result 
The error will be in the message box.

Re: Put item from “scrolling list field” into variable? - So

Posted: Wed May 07, 2014 4:46 pm
by Klaus
Hi friends,

we have solved the puzzle!
There were some strange invsible characters at the end of the lines in the field.

If it would be that easy every time... 8)


Best

Klaus