(counting tabbed items)

rand valentine jrvalent at wisc.edu
Tue May 25 11:19:54 EDT 2004


  Thank you for your comment and clarification... could you clarify a bit
more if you have a moment -- when you write "forcing the compiler to parse
the tabs," what do you mean exactly -- I'm a linguist, so I know what
parsing is :-), but I'm not quite clear as to its meaning here.

  Also, when you write "evaluate the constants first," what are the
constants and what are not?

  And now for a more useful question for my purposes -- say I have a
tab-delimited string -- if i want to grab the third item from the end, even
if the last two are empty, I _know_ I can't code:

  (set the itemDelimiter to tab)...

  put item -3 of myLine

  but could I be absolutely certain of getting the right item if I coded

 put item -3 of "(" & myLine & ")"

  I will experiment with this a bit, but _really_ value your guys'
(collective) gurucious ex cathedra comments about these most subtle details
of the mortal world. Thank you again.

rand

On 5/25/04 10:00 AM, "use-revolution-request at lists.runrev.com"
<use-revolution-request at lists.runrev.com> wrote:


> Because without forcing the compiler to parse the tabs in the first
> case, each tab is considered a text string. The concatenation looks like
> this:
> 
> "tabtabtabtab"
> 
> If you put parentheses around it, the compiler will evaluate the
> constants first before working with the string:
> 
>  put the number of items of (tab & tab & tab & tab)
> 
> Gives 4.



More information about the use-livecode mailing list