From: | Tony Rolfe |
Date: | 22 May 2001 at 08:34:53 |
Subject: | Re: BlitzII - Question of logic? |
On 22 May 2001, at 3:54, amorel wrote:
> On 22-May-01, Tony Rolfe wrote:
>
> C=An alternative approach is to use InStr$
>
> <<SNIP>>
>
> C=Alternatively, what's wrong with the obvious
>
> C=Select YourNumber
> C=Case 1
> C=Case 2
> C=Case any other number you like
> C=end select
>
> Not much normally, but if it can add up after some cases. Although if
> I got lots of numbers to check making the string var can also become a
> pain I just figured.
>
Yep, but you've got to type the little suckers in somewhere :-{
One thing I used to do in PL/1 programs was to create an external
routine whose name was built from the variable ( Names like
Routine000001.exe, Routine222222.exe, etc)
These contained the code to do whatever needed to be done for the
given variable.
Then I simply attempted to load and execute the routine. If it
worked then the number was valid. If the routine didn't exist then
the figure was invalid.
Not sure how to that in Blitz, but it might be worth thinking about.
Has the great advantage of not having to change the program if you
add a new variable, just create the new routine and stuff it into the
path somewhere.
Cheers
Tony
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list/-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list/-help@netsoc.ucd.ie