Re: Getting some chars from a string?
On 10/02/2010 16:07, Björnke von Gierke wrote: you already got a few interesting entries to try, but I haven't seen this one. I'd use this, because I suck at regexp and because one never know if someone added a suffix of "jpeg" or "jpg" or "j" or... function removeSuffix theName set the itemdelimiter to "." return item 1 to -2 of theName end removeSuffix That one IS clever! ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Getting some chars from a string?
you already got a few interesting entries to try, but I haven't seen this one. I'd use this, because I suck at regexp and because one never know if someone added a suffix of "jpeg" or "jpg" or "j" or... function removeSuffix theName set the itemdelimiter to "." return item 1 to -2 of theName end removeSuffix On 9 Feb 2010, at 20:01, Richmond Mathewson wrote: > I have a series of image names for the type: > > f#.png > > where # can be a number anywhere between 1 and 6 figures long. > > what I need is to extract the number from the image name. > > SO, starting with > > on mouseEnter > put the short name of me into NOMEN > > ? -- official ChatRev page: http://bjoernke.com?target=chatrev Chat with other RunRev developers: go stack URL "http://bjoernke.com/chatrev/chatrev1.3b3.rev"; ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
RE: Getting some chars from a string?
Correction: Char 2 to -5 of NOMEN > -Original Message- > From: use-revolution-boun...@lists.runrev.com [mailto:use-revolution- > boun...@lists.runrev.com] On Behalf Of Jim Bufalini > Sent: Tuesday, February 09, 2010 9:41 AM > To: 'How to use Revolution' > Subject: RE: Getting some chars from a string? > > Colin Holgate: > > > In case you were yearning for a cuter solution: > > > > answer char 2 to the number of chars in NOMEN - 4 of NOMEN > > Or just: > > char 2 to -4 of NOMEN ;-) > > Aloha from Hawaii, > > Jim Bufalini > > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
RE: Getting some chars from a string?
Colin Holgate: > In case you were yearning for a cuter solution: > > answer char 2 to the number of chars in NOMEN - 4 of NOMEN Or just: char 2 to -4 of NOMEN ;-) Aloha from Hawaii, Jim Bufalini ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Getting some chars from a string?
On 09/02/2010 21:19, Jeff Massung wrote: On Tue, Feb 9, 2010 at 1:01 PM, Richmond Mathewson< richmondmathew...@gmail.com> wrote: I have a series of image names for the type: f#.png where # can be a number anywhere between 1 and 6 figures long. what I need is to extract the number from the image name. Try using a regular expression: function extractImageNumber pName local tNumber if matchText(pName,"f(\d+)\.*", tNumber) is false then return empty end if return tNumber end extractImageNumber Jeff M. Thanks one and all for a marvellous selection of possible ways of doing things. NOW what I do need to know is which are the duck eggs and which are the drakes' ? "Aa can tell ye that missus, it's quite plain to be seen The duck eggs is white n' the drakes eggs is green," The Bellingham Show. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Getting some chars from a string?
On Tue, Feb 9, 2010 at 1:01 PM, Richmond Mathewson < richmondmathew...@gmail.com> wrote: > I have a series of image names for the type: > > f#.png > > where # can be a number anywhere between 1 and 6 figures long. > > what I need is to extract the number from the image name. > > Try using a regular expression: function extractImageNumber pName local tNumber if matchText(pName,"f(\d+)\.*", tNumber) is false then return empty end if return tNumber end extractImageNumber Jeff M. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Getting some chars from a string?
Hi Richmond, Here's another way: on mouseEnter put myNumber(the short name of me) end mouseEnter function myNumber pNOMEN set the itemDelimiter to "." return char 2 to -1 of item 1 of pNOMEN end myNumber Phil On 2/9/10 11:01 AM, Richmond Mathewson wrote: I have a series of image names for the type: f#.png where # can be a number anywhere between 1 and 6 figures long. what I need is to extract the number from the image name. SO, starting with on mouseEnter put the short name of me into NOMEN ? -- Phil Davis PDS Labs Professional Software Development http://pdslabs.net ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Getting some chars from a string?
On Feb 9, 2010, at 2:12 PM, Richmond Mathewson wrote: > delete the last char of NOMEN > delete the last char of NOMEN > delete the last char of NOMEN > delete the last char of NOMEN > delete the first char of NOMEN In case you were yearning for a cuter solution: answer char 2 to the number of chars in NOMEN - 4 of NOMEN ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Getting some chars from a string?
Silly really; replying to my own message again . . . :) - I have a series of image names for the type: f#.png where # can be a number anywhere between 1 and 6 figures long. what I need is to extract the number from the image name. SO, starting with on mouseEnter put the short name of me into NOMEN ? delete the last char of NOMEN delete the last char of NOMEN delete the last char of NOMEN delete the last char of NOMEN delete the first char of NOMEN why that never occurred to me before I just don't know. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Getting some chars from a string?
I have a series of image names for the type: f#.png where # can be a number anywhere between 1 and 6 figures long. what I need is to extract the number from the image name. SO, starting with on mouseEnter put the short name of me into NOMEN ? ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution