home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!orca!javelin.sim.es.com!tpehrson
- From: tpehrson@javelin.sim.es.com (tim clinkenpeel)
- Subject: Re: want to help me make my 'value' routine crash-proof?
- Message-ID: <1992Aug25.210836.908@javelin.sim.es.com>
- Reply-To: tpehrson@javelin.sim.es.com
- Organization: Evans & Sutherland Computer Corporation
- References: <1992Aug25.150516.17385@javelin.sim.es.com> <dmurdoch.65.714760154@mast.queensu.ca> <1992Aug25.191036.21639@javelin.sim.es.com> <dmurdoch.66.714772006@mast.queensu.ca>
- Date: Tue, 25 Aug 1992 21:08:36 GMT
- Lines: 23
-
- dmurdoch@mast.queensu.ca (Duncan Murdoch) writes:
- >function value(s:string):word;
- >var
- > v : word;
- > error : integer;
- >begin
- > val(s,v,error);
- > if error <> 0 then
- > value := 65535
- > else
- > value := v;
- >end;
-
- my routine is similar to this already, but crashes hard on the val() call. i
- want to know how to avoid this.
-
- i want to convert the string '123' to the value 123, not something like
- 'one-hundred twenty three'.
- --
- \clinkenpeel: aberrant analytical cynical agnostic idealist. i exclusively /
- /represent myself. i do not offend anyone; however, some morons choose to \
- \offend themselves. judge only those who you would have judge yourself. i /
- /don't practice what i preach - i'm not the type of person i'm preaching to.\
-