Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] DEFINE VARIABLE EMPTY
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] DEFINE VARIABLE EMPTY
 Login/Join
 
Platinum Member
posted
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
 
Posts: 177 | Registered: October 17, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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
 
Posts: 1571 | Location: Customer Support | Registered: April 12, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
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.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6105 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
i cant use -Default, because it Needs to be a IA Report


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 177 | Registered: October 17, 2017Reply With QuoteReport This Post
Platinum Member
posted Hide Post
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 8203M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
 
Posts: 153 | Registered: March 29, 2013Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] DEFINE VARIABLE EMPTY

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.