[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

565.0. "Help needed!" by KERNEL::FARRANTL (Lee Farrant) Mon Nov 22 1993 02:23

    Hello 
    	Not sure if this is the write conference to offer me 
    	assistance but please remove this topic if not.
    
    	I nned some assistant with the following:
    
    	1. How do I make focus ask a question to receive a value
    	   for an if qualifier from me.
    
    	2. How do I execute a .fex procedure from DCL.
    
    	3. Can I get hold of the current date and time to 
    	   ask focus to extract a record later than the time NOW.
    
    	4. After a join how do I make multiple records appear wich 
    	   belong to a single record. The report says I have 
    	   27 records but only lists 16. I have done a "TO ALL"
    	   in the join.
    	
    	I am using it with NICE.
    
    	Lee
    
    
T.RTitleUserPersonal
Name
DateLines
565.1Hope this helpsRDGE44::ALEUC9ungry of 'orshamTue Nov 23 1993 04:20128
Lee, 

Sorry about the length of reply, but I guess you don't need "RTFM",
(with or without page references !)     8^)

Q:    	1. How do I make focus ask a question to receive a value
    	   for an if qualifier from me.
   
A:	Use -PROMPT to capture variables in a User-friendly way (otherwise
	see below) in an interactive procedure.

	eg
		-PROMPT &X.A1.ENTER A LETTER.
	
	will request a single alphanumeric character by prompting

		ENTER A LETTER>
	
	and will continue to do so until, in this case, a SINGLE character is
	entered (or the user types QUIT), storing the value in &X

	or you can specify a list of allowed answers

		-PROMPT &Y.(A,B,C).ENTER YOUR SELECTION.

	displays

		ENTER YOUR SELECTION>

	forcing the user to store A, B or C into &Y.
	Note the terminating "." in both forms.

	Then you can use &X or &Y in an IF statement

		IF FIELD1 CONTAINS &X
		IF FIELD2 EQ &Y


	You could just have the & variables in the code where necessary
	
		IF FIELDX EQ &BADGE_NUMBER

	then Focus will prompt with 

		BADGE_NUMBER>
		

	If you want to prompt for data which will be used in a batch process,
	it is better (IMHO) to use, say, DCL and supply the variable(s) to
	Focus as appropriate (see next answer)

 
Q:    	2. How do I execute a .fex procedure from DCL.
  
A:	Sample .com follows, executing PROGNAME.fex which requires values
	for two variables (eg &VAR1 and &VAR2)

		$FOCUS
		 EX PROGNAME
		 value1
		 value2
		 FIN
		$EXIT

	This assumes all necessary FOC$DIR Assignments and FILEDEFS are
	made prior to execution or within the procedure, and that &VAR1 and
	&VAR2 occur in the procedure in that order.

  
Q:    	3. Can I get hold of the current date and time to 
    	   ask focus to extract a record later than the time NOW.

A:	To ascertain just the date, the system variables &MDY, &DMY and &YMD
	give "today" in the relevant format ie 112393, 231193 and 931123
	respectively (but are set at time of entering Focus, and ONLY get
	updated if & when MODIFY is used).

	For Date AND Time use the following

		-SET &SYSTEM_DATE_TIME = GETSTIME('A8');
		-SET &DATE_N_TIME      = CVTSTIME(x,&SYS_DATE_TIME,'Ay');
    
	where 	x determines which output format of the date/time value
	and	y denotes the string length of the relevant output variable

	ie	x	output format			 y

		0	DD-MMM-YYYY HH:MM:SS		20
		1	DD-MMM-YYYY			10
		2	HH:MM:SS			 8
		3	DD-MMM-YYYY HH:MM:SS.CC		23
		4	YYYY-MM-DD HH:MM:SS.CC		22

	Note the spaces between Date and Time portions, and the format of
	the Month with x = 4 (numeric - good for GT and LT comparisons)

	Of course, your record will need a field which matches one of these
	formats.

	Related Hint: 
	If you're running v6.0 or above use

		? FUSELIB GETSTIME 
		? FUSELIB CVTSTIME
	or 
		? FUSELIB * 	to get info' (if Mr System Manager has installed
				Focus correctly) on internal functions

						
Q:    	4. After a join how do I make multiple records appear wich 
    	   belong to a single record. The report says I have 
    	   27 records but only lists 16. I have done a "TO ALL"
    	   in the join.
    	
    	I am using it with NICE.
    
A:	I'd have to see the .MAS files and exact code used.

	What's NICE ?
	


This was all from memory, so please check the manual(s) for further
information. Hope this all helps.

Rgds,

Paul
565.2Thanks KERNEL::FARRANTLLee FarrantSat Nov 27 1993 05:0212
    
    	Paul, Bril, 
    
    	Thats was more than I expected, thanks for the time you spent 
    	on the reply for me. I shall give the answers ago and will 
    	let you know how I get on.
    
    	Thanks again 
    
    	Lee
    
         
565.4More info' plsRDGE44::ALEUC9ungry of 'orshamTue Feb 08 1994 08:4111
    Re: 1st problem - can you post example of erroneous code ?
        (I'm not too sure what your problem is)     
    	Why not have your required .fex called PROFILE.fex ?
    	(then Focus'll run it automagically)
                        
    Re: 2nd problem - do you mean calculate difference in Hours & Minutes
    	between two VMSDates ? If so, I haven't come across that one
    	before - sorry.
    
    Rgds,
    Paul