Focal Point
[CLOSED] DEFINE VARIABLE EMPTY

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8867096986

March 20, 2018, 11:36 AM
jenni
[CLOSED] DEFINE VARIABLE EMPTY
Hi,

I want to define:

whatever/Format = if whatever eq whatever then &something_which_does_not_Need_to_exist else 6something_that does exist

the Problem is that if the variable which does not necessarly Need to exist (because of the logic in my fex) is missing, then I get the ..if..then..else Syntax error, even if my case is the ELSE case.

there are techniques like whatever/format WITH GRADE = IF &something_that_does_not_need_to_exist IS MISSING THEN &something_that_exists ELSE &something_that_does_not_need_to_exist ;
but i get the same if then else error.

Hopefully there is a answer.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.1.05
Windows, All Outputs
March 20, 2018, 11:48 AM
FP Mod Chuck
Jenni

Try this at the beginning of your code.


-DEFAULTH &something_which_does_not_Need_to_exist = '';



Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
March 20, 2018, 04:08 PM
Waz
Be careful with using an amper variable set to '', as the IF THEN ELSE will evaluate to IF IS MISSING THEN Blah ELSE ;


I would suggest defaulting the a DEFINEd or COMPUTEd field to control what happens in the test.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 21, 2018, 03:58 AM
jenni
i cant use -Default, because it Needs to be a IA Report


WebFOCUS 8.1.05
Windows, All Outputs
March 21, 2018, 05:33 AM
Martin vK
You can check the existence of a variable with .EXIST

.EXIST tests for the presence of a value. If a value is not present, a zero (0) is passed to the expression. Otherwise, a non-zero value is passed.

whatever/format WITH GRADE = IF &something_that_does_not_need_to_exist.EXIST EQ 0 THEN &something_that_exists ELSE &something_that_does_not_need_to_exist ;

Or if a space value is also a non-existing value for you then try &something_that_does_not_need_to_exist.QUOTEDSTRING EQ ''

Martin.


WebFocus 8206M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster