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
+------------------------------------------------------------------+
|