Sort cards Numeric by (a mixed string)

Sannyasin Sivakatirswami katir at hindu.org
Sun Jun 6 18:09:05 EDT 2004


Is there a way to force Rev to see a mixed alpha numeric string as  
numeric if it begins with numbers?

Context: series of cards auto loaded with images where the field 
"photofileName" comes in and the image ref for  image 1 on the card is 
the same.

e.g.
card no		fld "photoFileName"

card 1   1.BigBlueBird
card 2   10.RedOrange
card 3	 11.WhiteApple
card 4	 2.SmallBlackBird

Ideal the person naming the photos uses zero padding, but typically I 
find users oblivious to this issue and I simply need to give them a way 
to resort from a button to:

card 1   1.BigBlueBird
card 2	 2.SmallBlackBird
card 3   10.RedOrange
card 4	 11.WhiteApple

Sort cards of this stack numeric by fld "photoFileName"

does nothing... no error, no resort... I assume because the mixed 
strings cannot be evaluated as numbers...
What would be a work around...?? I could use some complicated parsing 
routine but it would fail if another user decided to use a different 
delimiter (in this case he's used a dot), so I need a global solution 
that says to Rev -forget the alpha characters at the end of the string, 
just use the numbers at the beginning. iViewMedia does this 
automatically in its catalog system... i.e. it assumes if there are 
numbers at the beginning to sort by numbers and "10*alphaChars" follows 
"9*alphaChars", not "1*alphaChars" in any listing....

TIA

Sannyasin Sivakatirswami
Himalayan Academy Publications
at Kauai's Hindu Monastery
katir at hindu.org

www.HimalayanAcademy.com,
www.HinduismToday.com
www.Gurudeva.org
www.Hindu.org



More information about the use-livecode mailing list