Switcheroo

Richmond Mathewson richmondmathewson at gmail.com
Sun Jan 21 11:57:17 EST 2018


Thank you very much: I'll get back to work.

Richmond.

On 21/1/2018 6:35 pm, Mike Bonner via use-livecode wrote:
> You aren't actually providing a line number.  Try this..
>
> repeat with i = 1 to the number of lines in field "mm"
> switch (line i of fld "mm" is empty)
>     case true
>
>     break
>     case false
>
>     break
> end switch
> end repeat
>
> Though if you have a LOT of lines you'd be better off adjusting it to use
> repeat for each and running a separate counter...
>
> put 1 into tCounter
> repeat for each line tLine in field "mm
>       switch (tLine is empty)
>             case true
>                 -- the line is empty, tcounter contains the number of the
> line
>             break
>             case false
>                  -- the line is NOT empty, tcounter contains the number of
> the line
>             break
> end switch
> add 1 to tCounter -- increment to keep tCounter in sync with the line number
> end repeat
>
> On Sun, Jan 21, 2018 at 9:09 AM, Richmond Mathewson via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>
>> I have a list field where each line may contain a number or be empty.
>>
>> I need a SWITCH statement that checks the state of each line . . .
>>
>> This is throwing a "bluey":
>>
>> switch line number of fld "MM" is empty
>>
>> Where am I going wrong?
>>
>> Richmond.
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list