min() function anomalies

Ken Ray kray at sonsothunder.com
Wed Jun 13 17:16:49 EDT 2007


On Wed, 13 Jun 2007 16:23:24 -0400, Shari wrote:

>> But Shari, the last comma provides zero as the last item. Not very 
>> useful and potentially hazardous, I agree.
>> 
>> Joe  Wilkins
> 
> What bothers me is that almost any repeat loop that builds a variable 
> will have a trailing comma, so I would expect the engine to ignore 
> it, as was done in the past.  (Key point - that in the past this was 
> handled differently.)
> 
> global myVariable
> repeat x
>   put someNumber or someOtherThing & comma after myVariable
> end repeat
> 
> I use this type of handler frequently.  Whether it be numbers or 
> words doesn't matter.  Yes, it can be worked around, by deleting the 
> trailing comma at some point.

Yes, I've gotten in the habit of deleting it immediately:

   global myVariable
   repeat x
     put someNumber or someOtherThing & comma after myVariable
   end repeat
   delete char -1 of myVariable

In fact, I even have a separate handler to save me from having to type 
"delete char -1 of <var>" all the time; it's called KLC (kill last 
character):

on KLC @pWhat
  delete char -1 of pWhat
end KLC

That way, I can do:

  KLC myVariable

 and immediately following this command, myVariable has been trimmed 
appropriately.

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list