HP3000-L Archives

April 1998, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tim Ericson <[log in to unmask]>
Reply To:
Tim Ericson <[log in to unmask]>
Date:
Fri, 10 Apr 1998 10:45:20 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (59 lines)
Okay, new thread.

Command files are great, piping would be nice, but we can't let
Jeff get bored!  :-)

SO, what about:       User Defined Functions?

We can now do:

     IF FINFO ( "MYFILE", "EOF" ) <> 0 ...

What if we could define an "EOF" function?  Like:

     IF EOF ( "MYFILE" ) <> 0 ...

Yes, it's not that much different than the FINFO example above, but
let's expand the idea a little:

     IF FREDSIN ( "MYFILE" ) <> 0 ...

Would count the number of times the string "FRED" shows up it MYFILE.
(okay, that's a pretty silly example - but it's a start!)

These functions would be pretty similar to Command Files, but would
return one of the already-defined values normally used in an IF
statement (numeric, string, boolean, etc.)

The function's result would be returned by the existing RETURN
command, or could be set to a literal during an escape from the
function:

     IF FINFO ( "MYFILE", "EXISTS" )
       RETURN FINFO ( "MYFILE", "EOF" )
     ELSE
       RETURN 0
     ENDIF

And maybe would also show up in a new variable (HPRETURN?)

Another new variable, HPFUNCTIONPATH, would direct the CI on where
to look for them.  For instance, I could create a FUNCTION.SYS group
to keep my User Defined Functions in there, with HPFUNCTIONPATH =
FUNCTION.SYS.

So what say youse guys?  Am I thinking WAY too much and should I
just stick to COBOL?

FWIW!

  +------------------------------------------------------------------+
   My mind is my own, as are my ideas and opinions.
   My heart, body, and soul, however, all belong to others.      Tim.
  +------------------------------------------------------------------+
   Tim Ericson            tericson     DenKor Dental Management Corp.
   Sr. Programmer/Analyst   at denkor   (aka Willamette Dental Group)
     (& Systems Manager)      dot com    503-526-4440 (direct number)
   Programming HP3000s since 1983!          http://www.denkor.com
  +------------------------------------------------------------------+

ATOM RSS1 RSS2