View previous topic :: View next topic
|
Author |
Message |
som_infotech
New User
Joined: 25 Feb 2006 Posts: 38 Location: chennai-india
|
|
|
|
I've designed the below popup screen and it has 2 fields. Using Ver() we can verify whether the field is blank or not. But my requirement is to check at least anyone of them has values.
Panel:
********* VERIFIER ********
ENTER THE PACKAGE 1 NO: _____
( - OR - )
ENTER THE PACKAGE 2 NO: _____
VER(&SPID,NB)
VER(&IPID,NB)
As per above code in the panel it will check both the fields are not blank but I need to check whether at least one of them is non blank. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
you could try something like this
Code: |
IF (VER(&SPID,NB))
ELSE
VER(&IPID,NB)
|
Gerry |
|
Back to top |
|
|
som_infotech
New User
Joined: 25 Feb 2006 Posts: 38 Location: chennai-india
|
|
|
|
I tried the above statement but it was giving RC 20 - i.e An ELSE in column '6' did not match a previous IF statement. An ELSE in column '6' did not match a previous IF statement |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
laziness will take You nowhere,
why not look at the manual for the proper syntax
what about something along the lines of
Code: |
IF (&FIELD1 EQ &Z)
VER(&FIELD2,NONBLANK)
IF (&FIELD2 EQ &Z)
VER(&FIELD1,NONBLANK)
|
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
had I pasted what I had tested, it would have been ok,
instead I re-aligned the ELSE statement, so here we go again
Code: |
)PROC
IF (VER(&SPID,NB))
ELSE
VER(&IPID,NB)
)END
|
Gerry |
|
Back to top |
|
|
som_infotech
New User
Joined: 25 Feb 2006 Posts: 38 Location: chennai-india
|
|
|
|
Thanks a lot.. but when I press enter its not allowing to get out of the screen.. But the pointer is getting placed at second input...
so to place at first input i gave the below but it didnt work...
&SPID = .CURSOR |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
What data is on the second input field? |
|
Back to top |
|
|
som_infotech
New User
Joined: 25 Feb 2006 Posts: 38 Location: chennai-india
|
|
|
|
I didnt enter any values on the screen, I just pressed enter.
It throwed error message. But the pointer was placed on second field.
Panel Design:
Code: |
@ TYPE(TEXT) SKIP(ON)
)BODY WINDOW(49,7)
% |DATZ
% ¢*********+ LOADZ - VERIFIER ¢********
%
% #ENTER THE!SUPER PACKAGE#NO:=SPID @
% # ( - OR - )
% #ENTER THE!SIMPLE PACKAGE#NO:=IPID @
%
)PROC
IF (VER(&SPID,NB))
ELSE
VER(&IPID,NB)
&PFGR = .PFKEY
&SPID = .CURSOR
)END
|
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
I didnt enter any values on the screen, I just pressed enter. |
It is working as designed, I think. By using VER with NB, You explicitly asked that the second field needs data. The user needs to type something there.
If that is not what you want, you need to re-think your logic. Or the user can press PF3 instead of Enter. |
|
Back to top |
|
|
|