| T.R | Title | User | Personal Name
 | Date | Lines | 
|---|
| 262.1 | Use External Function | SANFAN::HAYESJO | MicroVAX On Board | Fri Jun 20 1986 17:16 | 28 | 
|  |     
    Try:
    
    Main Program:
    
    	EXTERNAL long constant Get_Input, cmdtbl
    	EXTERNAL long function CLI$DCL_Parse
    
    	CALL CLI$DCL_Parse( , cmdtbl BY VALUE, Get_Input BY VALUE, ...
    
    External Function Get_Input:
    
    	FUNCTION long Get_Input( STRING get_str, prompt_str &
    						, WORD out_len )
    
    	EXTERNAL long function LIB$Get_Input
    
    	stat% = LIB$Get_Input(	get_str BY DESC &
    					, prompt_str BY DESC &
    					, out_len BY REF )
    	Get_Input = stat%
    
    	END FUNCTION
    
    Hope this helps!
    John
    
    
 | 
| 262.2 |  | SMEDLY::WELLS | Phil Wells | Fri Jun 20 1986 22:23 | 12 | 
|  |     I did a similar thing is BLISS, however, I created a .CLD that is
    linked with the image.  There is no set command.  When using DCL_PARSE,
    you need to specify the routine name in the .CLD file, which is
    then invoked by the CLI$DISPATCH call.
    
    To get commands passed in the foreign command parsed, make a call
    to LIB$GET_FOREIGN, and pass the results of this on to DCL_PARSE
    as the 1st parameter.
    
    I am not sure this answers your question, so I offer it FWIW.
    
    Phil
 | 
| 262.3 | Thanks 1E+6! | KAHLUA::SANTIAGO | Lemon curry? | Sat Jun 21 1986 17:02 | 10 | 
|  |     Re .1:	Thank you infinitely! It worked! Perfectly!
    
    Re .2:	I'm not using CLI$DISPATCH, because then I would have
    		to declare a whole bunch of routines which then couldn't
    		use all my variables unless I declared them EXTERNAL,
    		so anyway it's a kludge but I'm just using CLI$GET_VALUE
    		with "$VERB" as argument and checking one by one.
    		Thanks for the idea on LIB$GET_FOREIGN, it works a lot
    		better than DCL_PARSE since it doesn't return the called
    		program name. 
 | 
| 262.4 | PASCAL is cleaner with CLI$ | SANFAN::HAYESJO | MicroVAX On Board | Sat Jun 21 1986 22:02 | 9 | 
|  |     A "workaround" would be (sorry Ken Hobday, et.al.) to use Pascal
    or another language that allows you to declare your global routines
    in your mainline and share global variables.
    
    Of course, I'd be delighted if someone could show me how to "globalize"
    BASIC routine addresses short of EXTERNALizing them.  Other than
    this, VAX BASIC can do everything but ride a bicycle :-).
    
    
 | 
| 262.5 | Funny I don't have those problems... | TUNDRA::HARRIMAN |  | Mon Jul 28 1986 10:04 | 21 | 
|  |     
    re: .4
    
    I don't know what you are having a problem with using EXTERNAL to
    declare globals. I have no problems getting BASIC to understand
    all of my routines, even if I have to be a bit verbose sometimes.
    However, BASIC has all sorts of ways to declare COMMON or MAPped
    variables and even more sophisticated structures (even though it's
    a world away from PASCAL)... This is only a half-hearted defense
    at BASIC since I have been doing lots and lots of things with it,
    but it sounded to me like you don't use the MAP or COMMON
    statements, and wish BASIC could intelligently utilize the system
    symbols and other neat stuff that all the other languages do...
    
    Anyway, I have no problems with BASIC and I have applications which
    use many many routines, including system calls and callable VMS
    utilities like the SOR$ and EDT$ (ugh) routines. If you are having
    specific problems, start another note...?
    
    -pjh
    
 |