repeat . . . delimit by

Roger Eller roger.e.eller at sealedair.com
Sun Sep 15 02:14:04 CEST 2013


Would using a function do the trick?

repeat for each item theDat in delimitBy(theData,vtab)
do something
end repeat

function delimitBy pData,pDel
    set the itemDel to pDel
    return pData -- unaltered data
end delimitBy

~Roger
On Sep 14, 2013 7:10 PM, "Dr. Hawkins" <dochawk at gmail.com> wrote:

> While we're asking for modest syntax changes . . .
>
> Being able to state DELIMIT BY in a REPEAT, and having it stick (as opposed
> to using the current value of the itemdelimiter) would be a huge help.
>
> It would avoid ugliness like
>
> set the itemDel to vtab
> repeat for each item theDat in theData
> set the itemDel to tab
> do something
> set the itemDel to vtab
> end repeat
>
> While missing the last reset to vtab is a programming error, mu code is
> kind of
> littered with these (constant db accesses)
>
> code would be much easier to follow (and maintain) with
>
> repeat for each item theDat in theData DELIMTED BY vtab
> do something
> end repeat
>
> And while I'm at it, it's been mentioned before, but a Fortran-style
> optional tying of the end repeat to the repeat with a constant would be
> really helpful (same for switch, and so forth)
>
> [Fortran 90+, not FORTRAN IV!!!!]
> --
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> _______________________________________________
> 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