Sort cards Numeric by (a mixed string)

Raymond Griffith rgriffit at ctc.net
Sun Jun 6 18:31:23 EDT 2004


On Sunday, June 6, 2004, at 06:09  PM, Sannyasin Sivakatirswami wrote:

> 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.
>

It would be to your advantage to have different fields for the number, 
name, etc.

> 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....

If you give the user the opportunity to assign different 
characteristics to their pictures (number, name, color, weight, 
species, whatever) then it would be a simple thing to allow them to 
sort by any of these things.

Raymond

>
> 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
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list