Weird logic problem in a menu screen.

Deskin, Bob Bob.Deskin@Cognos.COM
Wed, 30 Jan 2002 10:55:42 -0500


Notice the warning you received:

*W* The data name SIGNONUSER may conflict with the machine-specific keyword
SIGNONUSER.

There's a system function named SIGNONUSER. When you do your comparison,
QUICK is picking up the system function rather than your item. To compare
against the item, reference it using %SIGNONUSER. Better still, avoid using
names that are the same as PowerHouse keywords.

Bob Deskin              
PowerHouse Web Product Manager, Application Development Tools, Cognos Inc.
bob.deskin@cognos.com (613) 738-1338 ext 7268 FAX: (613) 727-1178
3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON K1G 4K9 CANADA

-----Original Message-----
From: Guy Werry [mailto:guy.werry@hbms.ca]
Sent: Wednesday, January 30, 2002 10:28 AM
To: PH Mailing List (E-mail)
Subject: Weird logic problem in a menu screen.


It's either "ask the list" or "throw a massive temper tantrum" time.
Environment: HP-Ux 10.2, Ph 7.33.D3.

I have a menu screen where I want to allow one user to run a sub-screen,
without the other users being aware that the choice is available to them.
I'm using the environment variable HPUSER to hold the user's logon name.

Here is the ENTIRE screen, from a compile listing:

		Q D E S I G N   (7.33.D3)
		Copyright 1997 COGNOS INCORPORATED
		Licensed PH-DEVELOPMENT for customer: 0011380001 HUDSON BAY
MINING & SMELTING 
		UNIX

		> SCREEN $execpath/pjr943kc MENU
		> ;
		> ;
***************************************************************
		> ; SCREEN-ID : PJR943KC
		> ; SOURCE-ID : PJR943KS
		> ; DATE      : MAY 91
		> ;
		> ; PURPOSE:  Employee TRAINING MENU
		> ;
		> ;
		> ; PROCESSING:
		> ;
		> ;
		> ; 1997 Feb 20, GLW, Pr4829.
		> ;     Added a menu selection so that we can access a
scheduler
		> ;     inquiry menu.
		> ;
		>
;****************************************************************
		> ;
		> 
		> DEF RCS-INFO  CHAR * 80 =     &
		>       "$Header: pjr943ks.qks,v 2.1 98/01/20 15:00:33
manffhdv Exp $"
		> 
		> DEFINE D-DATE DATE = SYSDATE
		> 
		> ; DEFINE SIGNONUSER CHAR *8 =
UPSHIFT(GETSYSTEMVAL("HPUSER"))
		> TEMP SIGNONUSER CHAR *8
		*W* The data name SIGNONUSER may conflict with the
machine-specific keyword 
		SIGNONUSER.
		> define authuser char *8 = "BMORRELL"
		> 
		> ;
		> HILITE MESSAGE AUDIBLE INVERSE BLINKING
		> ;
		> TITLE "Human Resources Information System" AT 1,29
		> ;
		> ALIGN (,,70)
		> FIELD D-DATE PREDISPLAY FORMAT YYYYMMMDD SEPARATOR " "
		> ;
		> TITLE "PJR943KC" AT 2,1
		> TITLE "5.0"      AT 3,4
		> HILITE TITLE INVERSE
		> TITLE "TRAINING MAIN MENU" AT 4,31
		> HILITE TITLE OFF
		> ;
		> DRAW THICK 3,20 TO 5,60
		> ;
		> SKIP TO 7
		> ;
		> ALIGN (19,22)
		> SUBSCREEN   $execpath/pjr944kc
&
		>             LABEL "PJR944  Training Inquiry Menu"
		> SUBSCREEN   $execpath/pjr916kc
&
		>             LABEL "PJR916  Training Reports Menu"
		> SKIP
		> TITLE "03 PSR897KC Scheduler Inquiry Menu"
&
		>       AT ,19
		> 
		> COMMAND "SHOWJOB JOB = @.FFHRIS"
&
		>       LABEL "        Who's On System Now?" CLEAR ALL
RESPONSE         &
		>       ID 04
		> 
		> procedure designer 03
		>    begin
		>       if not setsystemval("execpath","../../payrol/pub")
		>         then error &
		>          "Cannot set execpath system variable. Please
contact I.T."
		>       run command "quick 'auto=../qkgos/schdlrinq.qkg'"
refresh screen
		>       if not setsystemval("execpath","../pub")
		>         then error &
		>          "Cannot set execpath system variable. Please
contact I.T."
		>    end
		> ;
		> 
		> procedure entry
		> begin
		>       let signonuser = upshift(getsystemval("HPUSER"))
		>       if authuser = signonuser
		>         then run screen $execpath/pjr897kc
		> end
		> 
		> 
		> BUILD
		MODE:x ACTION:xxxxxxxxx     Human Resources Information
System       xxxxxxxxxxx
		PJR943KC
		   5.0             *****************************************
		                   *          TRAINING MAIN MENU           *
		                   *****************************************
		 
		                  01 PJR944  Training Inquiry Menu
		                  02 PJR916  Training Reports Menu
		                  03 PSR897KC Scheduler Inquiry Menu
		                  04         Who's On System Now?
		 
		  
		0 ERRORS  1 WARNINGS. Delete old screen
../pub/pjr943kc.qkc?y
		> EXIT

I figured it was pretty basic, sort of a no-brainer, eh!  Well, I've tried
two ways of doing this: a designer procedure and (currently) entry
procedure.  In both cases, the IF statement fails, even though I can prove
that the two data items that I'm testing are equal!  Below is a screen shot
of the actual debugger code, with the offending IF statement high-lighted.

				0074  procedure entry
				0075  begin
				0076    let signonuser =
upshift(getsystemval("HPUSER"))
				0077    if authuser = signonuser
				0078      then run screen $execpath/pjr897kc
				0079  end
				0080  
				0081  
				0082  PROCEDURE APPEND
				0083  DISABLE
				0084  
				0085  PROCEDURE PATH
				0086  NULL
				0087  PROCEDURE FIND
				0088  NULL
				Trap encountered at line: 79
				> d authuser
				AUTHUSER = "BMORRELL"
				> d signonuser
				SIGNONUSER = "BMORRELL"

Any help will be much appreciated!

G.L. (Guy) Werry 
Senior Systems Analyst
Hudson Bay Mining & Smelting
Ph:  204-687-2374
Fax: 204-687-2771
guy.werry@hbms.ca

= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.