Sort cards Numeric by (a mixed string)
Sarah Reichelt
sarahr at genesearch.com.au
Sun Jun 6 23:23:42 EDT 2004
On 7 Jun 2004, at 8:10 am, 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.
>
> 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"
>
Try something like this:
set the itemDel to "."
sort lines of theData numeric by item 1 of (word 3 of each)
Cheers,
Sarah
More information about the use-livecode
mailing list