min() function anomalies

Brian Yennie briany at qldlearning.com
Wed Jun 13 19:45:04 EDT 2007


Not weird at all - I think 90% of the people here (myself included)  
have usually just solved the problem by deleting the trailing comma.  
However, I can see how having multiple handlers which append data  
could confuse the issue - since non-empty lists will need the comma  
put back on before proceeding.

Although I don't exactly remember why, some odd circumstance led me  
to the habit of actually adding commas *before* items, but only if  
the content is not empty (thus my last post).

It's actually amazing how things that seem so straightforward can be  
stressed under the right circumstance.

In case it feels more logical, I suppose it could also be written:

put comma&tItem after tList
if (char 1 of tList is comma) then delete char 1 of tList

Deleting "leading" commas seems to leave your data more portable and  
predictable, however you implement it...

>> Just for fun, an alternate method which never leaves trailing commas
>
> I must be weird in my coding or something :-)
>
> In another project, I have a variable that is constantly changing.
>
> I chose to add to the variable with "put something & comma after  
> myVariable" rather than putting the comma first, as putting the  
> comma first creates the empty place at the beginning.
>
> Either way, the comma becomes an issue.
>
> If I add to the variable and immediately delete the trailing comma,  
> the very next handler that runs will have to check for the comma  
> anyway, and add it back in when it adds to the end of the variable.  
> The variable is constantly being updated, both added to and deleted  
> from.
>
> Am I the only one who has variables with commas that constantly  
> change?



More information about the use-livecode mailing list