What makes a line a line in a chunk expression?

Len Morgan len-morgan at crcom.net
Mon Sep 7 11:09:01 EDT 2009


Jim,

This works on my machine but as Sarah pointed out to me, it's actually 
pointless since they should NEVER be different (i.e., it should never 
pick something that is not on the list of options so why check?  What I 
really wanted to do was see if a CARD with that name existed (something 
like "if pChoice is among the cards of this stack..." which doesn't work 
because apparently, "the cards of this stack" is not a valid command.

len

Jim Ault wrote:
>
> I would suggest you do some testing to find the real cause(s) of the 
> situation.
> There is a disconnect somewhere.
> -- try this handler in a new stack with a single new option menu 
> button named "taskBar"
>
> on menuPick theItem -- in a pulldown menu
>    get the text of button "taskBar"
>    --the dashes will indicate extra spaces
>    get it & cr & "--" & the short name of button "taskBar" & "--"
>    get it & cr & "--" & the label of button "taskBar" & "--"
>    get it & cr & "--" & theItem & "--"
>    put theItem is among the lines of IT into success
>
>    put it & cr & cr & success into msg
> end menuPick
>
> This success shows true.
>
> Jim Ault
> Las Vegas
>
> On Sep 6, 2009, at 10:31 PM, Len Morgan wrote:
>
>> I wish it was that simple but if that DOES turn out to be the 
>> problem, there's something not quite right with Rev itself.  From an 
>> earlier post, I am comparing the pChoice that is passed by the 
>> menuPick handler with "the text of button "taskBar"" which is the 
>> button that sent me the pChoice in the first place so they should 
>> both be getting their data from the same object and should therefore 
>> be the same.
>>
>> That is of course, unless the menuPick parameter is not a "true" line 
>> but I would think I'd get a "chunk types don't match" message or 
>> something like that.
>>
>> This seems like a very simple thing but it's giving me fits!
>>
>> len morgan
>>
>> J. Landman Gay wrote:
>>> Len Morgan wrote:
>>>> If I type the lines:
>>>>
>>>> put "Movement History" into myChoice
>>>> put the text of button "taskBar" into tLines
>>>> put (myChoice is among the lines of tLines)
>>>>
>>>> into the message box, the result I get is "false"
>>>
>>> When you use "is among", the entire line must match to get a hit. If 
>>> the line you are trying to match has any extra characters (maybe 
>>> "Movement History for Dummies") then the result is false. The two 
>>> strings must be identical.
>>>
>>> If you are trying to match only the beginnings of lines, try 
>>> something like this:
>>>
>>> if offset(cr & myChoice, cr & tLines) > 0 then...
>>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your 
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> Jim Ault
> jimaultwins at yahoo.com
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>



More information about the use-livecode mailing list