Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
nuking an &var
 Login/Join
 
Expert
posted
i thought there was a way to do this...
but i must have been dreaming...
-SET &var = 'fred';
-TYPE &var
-SET &var = ;
-TYPE &var

lo and behold &var is still 'fred'... i was sure that = ; would nuke the &var
and force &var.EXIST to 0 ;
Am i nuts?
Any wizardrous ideas?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
I've found that you cannot have the space between the = and the ;

Use -SET &var =;


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Dialogue Manager variables are like cockroaches, nothing will kill them, not even nukes.

I don't think there's a way to delete variables.

How about setting them to a special value (e.g. 'zyzyzyz') and add a test to the line you're testing existence?
-IF &var.EXISTS EQ 0 OR &VAR EQ 'zyzyzyz' GOTO BYEBYE;


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
quote:
-SET &var =;


doesn't work:

-SET &var = 'ASDFAASDSD';
-SET &var=;
-? &v


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
It kinda does. Run this:
-SET &var = 'ASDFAASDSD';
-SET &var=;
-? &v
-TYPE &var.LENGTH
-TYPE &var

Very weird. It shows up in the list but really isn't there. Confused


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
Don't trust -? &

-SET &var = 'ASDFAASDSD';
-TYPE &var.EXISTS
-TYPE &var
-SET &var=;
-? &v
-TYPE &var.EXISTS
-TYPE &var


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Very interesting!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
I don't think you can remove the existence of a variable once its existence has been established with a set value. My approach for similar needs has been to -SET &var=''; which removes the value (well actually the value is supposedly a space with the &var.LENGTH=1. That means if I need to test that parm later I need to evaluate for the possibility of a space.

Blast those darn cockroaches!!


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
-SET &var = 'ASDFAASDSD';
-TYPE &var.EXISTS
-TYPE &var
-SET &var=;
-? &v
-TYPE &var.EXISTS
-TYPE &var


Results:

-SET &var = 'ASDFAASDSD';
-TYPE &var.EXISTS
1
-TYPE &var
ASDFAASDSD
-SET &var=;
-? &v
CURRENTLY DEFINED & VARIABLES STARTING WITH 'v':                     
&var          = ASDFAASDSD                                                   
-TYPE &var.EXISTS
0
-TYPE &var
(FOC295) A VALUE IS MISSING FOR: &var


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Waz, I guess that was from 7.1.6 because I get the same.

Could it be to do with the fact that I've only ever seen 'roaches in the states? Wink Razzer

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
ohhhh very interesting indeed.
thanks waz

I did some more testing this morning
and 'dont trust -? &' is spot on!

cockroaches! Good One i think we've just renamed &vars as 'cockroaches'....

This message has been edited. Last edited by: susannah,




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Guru
posted Hide Post
quote:
-TYPE &var.EXISTS

Can somebody explain to me what this mean -
Is it "Does &var have a value?" or "Is the variable &var existed?"

Sorry about the confusing nested questions, because I am very very confused here. Confused Confused

Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Expert
posted Hide Post
It means "does the variable exist". This could be useful when the variable may or may not have been passed from the launch form, or when created in a Dialogue Manager loop...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Francis,

Thanks for the explaination.
I got the misconception that variables are loosely defined as long as they appear anywhere in the fex, you must supply values at the execution point, or the WF intepreter will choke.
As for parameters passing to a fex, if more variables being passed, the fex ignores the extra ones and continue to run, but if fewer variables passed, then the fex will prompt for values of the the missing vars or defaults must be given inside the fex.
That is why I thought &var.EXISTS is testing for value, not the variable itself.

-SET &var = 'ASDFAASDSD';
-TYPE &var.EXISTS
-TYPE &var
-GOTO BYPASS
-SET &var=;
-BYPASS
-? &v
-TYPE &var.EXISTS
-TYPE &var  


Like cockroaches for sure, they've been there wether we want to see them or not.
Hua

This message has been edited. Last edited by: Hua,


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Virtuoso
posted Hide Post
Well, it's kind of the same thing. A variable cannot exist unless it has a value, whether it's a blank or zero or whatever, but it cannot be missing. It is initialized by a -DEFAULT, -SET, or -READ. The .EXISTS operator is just an easy binary way to check if a variable has been initialized without regard to what that value might be.

Here's one example of how I have used it. If you've ever used an indexed variable for multi-select controls, you know that if more than one value is passed, an &var0 is created containing the number of values selected and then &var1, &var2, etc. for the individual values. If only one value is passed, you only need to use &var. So I would evaluate &var0.EXIST to branch into a DM routine for evaluating multiple parameter values if it is 1 or just use the &var value if it is 0.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Guru
posted Hide Post
Darin,

I haven't used an indexed variable, could you be so kind to give me an example? I wonder what is it like to do -? &var before you test &var0.EXISTS.

Thanks,

Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Expert
posted Hide Post
One example of indexed variables:

-SET &ECHO=ALL;

TABLE FILE CAR
PRINT
COUNTRY
BY COUNTRY NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS H001
END
-RUN

-SET &N = &LINES;

-REPEAT END1 FOR &X FROM 1 TO &N STEP 1;
-READ H001 &COUNTRY.&X.A10.
-END1 

-? &COUNTRY


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
FYI

I get the same results for versions:


  • 7.6.9
  • 7.1.6
  • 5.2.1
  • 5.1.2
  • 4.2

Its been around for quite a while.


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders