GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
Diese Seite auf deutsch

Mail #9225

Back to main page of archive

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  

From: Mirsad Todorovac
Subject: `Val' function problems
Date: 13 Aug 2003, 11:10:16

On Tue, 12 Aug 2003, Frank Heckenbach wrote:

> Adriaan van Os wrote:
>
> > Frank Heckenbach wrote:
> >
> > > Mirsad Todorovac wrote:
> > >>
> > >> 1. Does Borland Pascal do teh same, or is it a GPC bug?
> > >
> > > Now I'm surprised. BP seems to always set x = 0 when ec <> 0, i.e.
> > > when invalid characters are found.
> > >
> > > Can any BP user confirm whether that's the expected behaviour? (I've
> > > always used `Val' for entire number strings, so ec <> 0 would be an
> > > error in my programs, so I've never noticed this behaviour.)
> > >
> > > If that's really so in BP, I suppose we should change it in GPC.
> >
> >  From the Turbo Pascal 6.0 Library Reference:
> >
> > "Val( S: String; var V; var Code: Integer)"
> >
> > "... If the string is somehow invalid, the index of the offending
> > character is stored in Code;
>
> The question is if V is (guaranteed to be) zero then.

The other side of the story is that Val could be used more flexible, i.e.
for parsing if "best effort" has been done, and string has been
converted-up to the first invalid character/digit.

Mirsad

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  


Replies

Author Subject Date
Frank Heckenbach `Val' function problems 13 Aug 2003, 23:44:29
The Chief `Val' function problems 14 Aug 2003, 08:19:44
Frank Heckenbach `Val' function problems 14 Aug 2003, 22:33:03

In reply to

Author Subject Date
Frank Heckenbach `Val' function problems 12 Aug 2003, 21:54:11

Back to main page of archive


Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.

Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.


This page was created by Crystal 0.999 (Linux 2.4.27/i686).