Easy way to get the "white space" before the first word of a line?

David Bovill david at openpartnership.net
Tue Mar 25 17:41:49 EDT 2008


Thanks Mark.

On 25/03/2008, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:
>
> Hi Dave,
>
> Assuming that the whitespace always starts on char 1 of the line, this
> should work:
>
> function whiteSpace theText
>    return char 1 to (offset(word 1 of theText,theText) - 1) of theText
> end whiteSpace
>
> function whiteChunk theText
>    return "char 1 to" && (offset(word 1 of theText,theText) - 1)
> end whiteChunk
>
> Best,
>
> Mark
>
> Best regards,
>
> Mark Schonewille
>
> --
>
> Economy-x-Talk Consulting and Software Engineering
> http://economy-x-talk.com
> http://www.salery.biz
>
> A large collection of scripts for HyperCard, Revolution, SuperCard and
> other programming languages can be found at http://runrev.info
>
>
>
>
>
> On 25 mrt 2008, at 22:08, David Bovill wrote:
> > I want to get hold of the "white space" - ie tabs or space -  before
> > the
> > first word of a line. I can do it of course with repeat loops - but
> > is there
> > a way using Revs built in chunks?
> >
> > Something like:
> >
> >    put word 0 to 1 of "      first second"
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the Use-livecode mailing list