• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "+" and "-" are numbers.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "+" and "-" are numbers.


  • Subject: Re: "+" and "-" are numbers.
  • From: "Arthur J. Knapp" <email@hidden>
  • Date: Mon, 05 Aug 2002 16:18:28 -0400

> Subject: Re: "+" and "-" are numbers.
> Date: Sat, 3 Aug 2002 14:24:11 +0100
> From: Nigel Garvey <email@hidden>

Belated response...

> "Arthur J. Knapp" wrote on Fri, 02 Aug 2002 13:42:36 -0400:
>> P.S. If someone asked Nigel Garvey very politely, he could probably
>> come up with a much nicer and robust number parsing routine. :)

> Oh please, Arthur! Life's too short.... ;-)

;-)

> Seriously, though: I would think it unlikely that anyone would want to
> parse numbers from from a random text - where numbers generally have
> white space fore and aft and may even be written out as words - without
> reference to anything else in the document.

Yes, typically we obtain a number from something like this:

"<font size=12>"

where we already have far more contextual means of finding the number's
general starting location. However, (using html as an example), the same
bit of text could be legally typed in any of the following ways:

<font size = 12 >
<font size="12">
<font size = "12" >
<font size =
12>

which can make the extraction of "12" a bit annoying.

In practice, I do find it convenient to parse a string down to
just that part where I know a single number exists, and then to
let a generic number parsing routine take care of the details,
especially when it is just a matter of trimming initial whitespace.


{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Regarding Power macG4
  • Next by Date: Re: Quark style and character sheets -- is "normal" always spec number 1?
  • Previous by thread: Re: "+" and "-" are numbers.
  • Next by thread: Is...a puzzlement!
  • Index(es):
    • Date
    • Thread