[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ilbbak::ibi_focus

Title:FOCUS, from INFORMATION BUILDERS
Moderator:ZAYIUS::BROUILLETTE
Created:Thu Feb 19 1987
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:615
Total number of notes:1779

240.0. "Getting logical info into FOCUS &variable." by MEMV02::VOSS () Mon Jul 17 1989 15:47

    >> How do you get a DCL logical translation into a FOCUS variable?
    
     	Because I am frequently asked this question, I decided to add it
    here in the hopes that it will expand the subject and be one place 
    where everyone can get the info. 
    
    	I have come up with three ways and I will present them in order
    of difficulty.
    
    
    	(1) Start FOCUS from a DCL command file and pass the logical
    information as part of the executible line.
    
    		EX:     $ def my_logical my_info  
    			$ FOCUS
    				EX EXAMPLE &VAR=my_info 
    
    		advantages:   - Easy to write, easy to work with.
    		disadvatages: - You must know the value of 'my_logical'
    				when you write this DCL command. That
    				could be done by writing this short
    				command file "on the fly" from another
    				DCL file and then executing it. But
    				you still have to contend with a slow
    				DCL WRITE.
    
    	(2) Write a file in your command file with the value(s) of 
    'my_logical' and do a -READ in FOCUS to put the value 'my_info'
    into a FOCUS &variable. 
    
    		EX:	$ my_sym = f$logical("my_logical")
    			$ open/write file file.dat
    			$ write/sym file my_sym
    			$ close file
    			$ FOCUS
    			  EX EXAMPLE
    
    			     EXAMPLE.FEX :
    				FILEDEF FILE DISK FILE.DAT
    				-READ FILE &VAR
    
    		advantages:   - Value of logical does not have to be known
    			        ahead of time.
    		disadvantage: - Slows down processing with DCL WRITE
    				and FOCUS -READ.
    
    	(3) Write a user-written subroutine using RTL and add it to
    FOCUS Fuselib.
    
    		EX:	$ def/table=my_table my_logical my_info
                        $ FOCUS
    			  EX EXAMPLE
    
    			     EXAMPLE.FEX :
    				-SET &VAR=GET_LOGICAL("MY_LOGICAL",'A25'); 
    				-*
    				-*...NOTE: Above 'A25' is the largest size
    				-*...you ever expect turn be returned
   				-*...from this sub_routine.
    
    I hope this is of help. There certainly could be other ways and
    I hope that they will be discussed here.
    
T.RTitleUserPersonal
Name
DateLines