Focal Point
[SOLVED] Delete an && variable from memory

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

March 09, 2011, 09:46 PM
jwatkins
[SOLVED] Delete an && variable from memory
Is it possible to completely remove an &&variable from memory? Setting it to '' or just ; appears to still leave the variable in memory.

-SET &&TEST='123';
? &&
-RUN

-SET &&TEST=;
? &&

This message has been edited. Last edited by: Kerry,
March 09, 2011, 11:43 PM
Waz
When testing to see if the && variable is cleared, try -TYPE &&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 09, 2011, 11:51 PM
Francis Mariani
=; seems to work for me.

This code

-SET &ECHO=ALL;

-TYPE *** BEFORE
-SET &&TTEST='123';
-? &&TT


-TYPE *** AFTER
-SET &&TTEST=;
-? &&TT
has this result:

-TYPE *** BEFORE
 *** BEFORE
 -SET &&TTEST='123';
 CURRENTLY DEFINED & VARIABLES STARTING WITH '&TT':
 &&TTEST       = 123
 -? &&TT
 -TYPE *** AFTER
 *** AFTER
 -SET &&TTEST=;
 CURRENTLY DEFINED & VARIABLES STARTING WITH '&TT':
 -? &&TT



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
March 10, 2011, 12:11 AM
jwatkins
Yes, it does get set to blank, but it still exists. I want to be able to just delete it similar to a how a filedef clear clears out filedefs.
March 10, 2011, 12:15 AM
jwatkins
With a ? && it shows up as a blank.
March 10, 2011, 01:06 AM
Waz
The -? &.. does not show that the variable has been cleared.

Please try what I posted earlier.

e.g.
-SET &ECHO=ALL;

-SET &&TEST = '123' ;

-TYPE &&TEST

-SET &&TEST=;

-TYPE &&TEST


Results
-SET &&TEST = '123' ;

-TYPE 123

123

-SET &&TEST=;

0 ERROR AT OR NEAR LINE      0  IN PROCEDURE __WCFEX FOCEXEC * 

(FOC295) A VALUE IS MISSING FOR: &&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 10, 2011, 08:02 AM
GamP
I think it may depend on the release you're using?
I ran this against 77.01 and this is the result:
 -SET &&TEST='123';
 ? &&
 -RUN
 &&APPLOCK     APP_NOT_LOCKED
 &&APP_PERMIT  ALL
 &&EDAAPP      APP-ENABLED
 &&EDACONF     D:\ibi\srv77\wfs
 &&OSTYPE      WINNT
 &&SRVTYPE     PTH
 &&TEST        123
 -SET &&TEST=;
 ? &&
 &&APPLOCK     APP_NOT_LOCKED
 &&APP_PERMIT  ALL
 &&EDAAPP      APP-ENABLED
 &&EDACONF     D:\ibi\srv77\wfs
 &&OSTYPE      WINNT
 &&SRVTYPE     PTH

Maybe this is different in a lower release... I don't have access to a lower release at the moment...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 10, 2011, 10:27 AM
Francis Mariani
Who knows if this is still valid?

Tech Support Solution: How do you clear single global variable?


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
March 10, 2011, 10:56 AM
Tom Flynn
This "removes" all the global variables:

  
-? &
LET CLEAR *
-RUN
-TYPE *****************************
-? &
-EXIT


The -SET &&VARIABLENAME=; did "NOT" get reset to nothing.


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
March 10, 2011, 03:04 PM
Waz
quote:
LET CLEAR


That is bizarre.

Why would LET CLEAR clear all global variables.

At least is been documented in Symptom/Problem/Solution


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 10, 2011, 03:43 PM
jwatkins
The LET CLEAR is what I was looking for. Thanks!
Can you clear certain ones or is it all or none?

I also noticed that setting the && var to ; left the value to what it was above and appears to not change the value at all. Could be a version difference I suppose.

? REL
-SET &&TEST='123';
? &&
-RUN
-TYPE ***************************
-SET &&TEST=;
? &&

Generated this:
EDA767 Release INSTALLATION_DATE = 4/27/2010 13:12:07
&&TEST 123
***************************
&&TEST 123
March 10, 2011, 05:42 PM
Waz
As mentioned, it clears all global variables.


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 14, 2011, 04:49 AM
Computix
Hi,

one possibility to clear a variable is the following:

-SET &&TEST = IF 1 EQ 2 THEN '';

Regards,
Markus


WF 7.6.6 (MRE,BID, DevStudio, partly RC) on Windows 2003 /Apache/Tomcat
Output: HTML,Excel,PDF,PPT
Adapters: SQL Server, DB2, Oracle
March 14, 2011, 04:39 PM
Waz
Setting a variable to '' does not clear it, just sets it to nothing.

Also you should always have an ELSE with an IF THEN, even if you know it will not be used, its good programming practice.


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 14, 2011, 07:27 PM
jwatkins
This is what I get:

LET CLEAR *
-RUN
-TYPE ***********************************************************
-SET &&TEST=123;
? &&
-RUN
-TYPE ***********************************************************
-SET &&TEST=;
? &&
-RUN
-TYPE ***********************************************************
-SET &&TEST = IF 1 EQ 2 THEN '';
? &&
-RUN
-TYPE ***********************************************************
-SET &&TEST ='';
? &&
-RUN

Yields the following:

EDA767 Release * Current Software:
EDA767 Release RELEASE = R720767D
EDA767 Release GEN_NUM = 307
EDA767 Release SOURCE_DATE = 09/17/2008 19:13:58
EDA767 Release BUILD_DATE = 09/17/2008 21:44:14
EDA767 Release INSTALLATION_DATE = 4/27/2010 13:12:07
***********************************************************
&&TEST 123
***********************************************************
&&TEST 123
***********************************************************
&&TEST 123
***********************************************************
&&TEST 123
&&TEST

Strange how &&TEST shows up twice on the last run and it ignores setting it to a ; and it ignores the if 1 EQ 2 test also.
March 15, 2011, 02:51 AM
Waz
I've seen multiple values before, many of them, and it seems to be something to do with setting the value multiple times.

But it only show in a -? & or -? &&

I noticed that you are using ? &&, you must be running this from the command line.


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 15, 2011, 10:17 AM
jwatkins
Yes, we have created our own "adhoc" window as follows:

 

    <form name="AdHoc" action="/ibi_apps/WFServlet" method="GET">
      <textarea name="IBIF_adhocfex" value="" rows="23" cols="73" align="left"></textarea>
      <br><br>
      <input type="reset" name="Reset" value="Clear Form">
      <input type="submit" name="Submit" value="Run ADHOC REQUEST">
    </form>


 

March 15, 2011, 05:00 PM
Waz
Are you aware that IBIF_adhocfex can be turned off at the security level ?

Some installations see this as a security risk, and lock it down.


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 15, 2011, 05:08 PM
jwatkins
Yes. We only allow certain people to see it. It is only available on our internal network.
March 21, 2011, 10:55 AM
jwatkins
Closed - Solved