Logan Hanks (lohanks@VT.EDU)
Sat, 12 Feb 2000 17:42:24 -0500
Message-ID: <20000212174224.H24242@vt.edu> Date: Sat, 12 Feb 2000 17:42:24 -0500 From: Logan Hanks <lohanks@VT.EDU> Subject: Re: [CS3304_1381] Returning from a function/proc
On Sat, Feb 12, 2000 at 05:19:35PM -0500, David Torbert wrote:
> Is it possible to return from a Pascal function other than by getting to
> the end of it?
>
> IE, in C++, if you want to get out of dodge if your input is invalid,
> you do something like this:
>
> void SomeFunc(CSomeType* pBlah)
> {
> if (NULL == pBlah)
> return;
>
> if (!pBlah->WhateverIsValid())
> return;
>
> // Other processing here
> }
>
> Is there a way to do this other than having a nested if/then/else for
> every way you could want to leave a function?
>
> -David
For the answer to this, see:
http://www.lysator.liu.se/c/bwk-on-pascal.html
logan
This archive was generated by hypermail 2.0b3 on Sat Feb 12 2000 - 17:39:20 EST