Focal Point
[SOLVED]Delete a global variable

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

December 18, 2019, 10:50 AM
Kykyn
[SOLVED]Delete a global variable
Hi,

I need your help because i have a pb when i want to delete a global variable.

In fact, i have a program, in which one i call an other one with an include.

i use global variable because if i dont do that i cant use my macro variables with the 2 programs.

my pb ==> i want to delete my global variable when my program is done, but it doesnt work.

It's like if the global are killed only in one programm

this a short version of my code :

Main Program :
  
-SET &&VPDATNAI='OUI';
-SET &&LIMIT=1;

-INCLUDE OTHER_PROGRAM


OTHER_PROGRAM
  
-SET &&LIMIT=;
-SET &&VPDATNAI=;
-? **


And this is the result :
CURRENTLY DEFINED & VARIABLES:
&&LIMIT and &&VPDATNAI are killed, i don't see them anymore

BUT, now if i do that :
Main Program :
  
-? &&
-EXIT


This is the result :
CURRENTLY DEFINED & VARIABLES:
&&LIMIT = 1
but &&VPDATNAI is killed!!!

Could you please tell me where is the pb?

Thks a lot and good day

Cédric

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


WebFocus 8.2, Windows
December 18, 2019, 11:35 AM
FP Mod Chuck
Kykyn

I could not reproduce your problem in WF 8.2.06. The global variables are both killed by the -INCLUDE program and does not show up in the calling program anymore.

I just used your example as posted so your code must have an additional -SET for &&LIMIT somewhere else.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
December 18, 2019, 03:26 PM
MartinY
What is the result when you are running this ?

-*-* Fex 11111.fex
-TYPE -*******************************************
-TYPE -** first fex
-TYPE -*******************************************
-SET &&VPDATNAI='OUI';
-SET &&LIMIT=1;

-TYPE Sent values to second fex
-TYPE VPDATNAI: &&VPDATNAI<--
-TYPE LIMIT: &&LIMIT<--

-TYPE -*******************************************
-TYPE -** second fex call
-TYPE -*******************************************
-INCLUDE IBFS:/WFC/Repository/IT/22222.fex

-TYPE Received values from second fex
-TYPE VPDATNAI: &&VPDATNAI<--
-TYPE LIMIT: &&LIMIT<--
-TYPE -*******************************************
-TYPE -** end first fex
-TYPE -*******************************************


-*-* Fex 22222.fex
-TYPE -*******************************************
-TYPE -** second fex
-TYPE -*******************************************
-TYPE Received values from first fex
-TYPE VPDATNAI: &&VPDATNAI<--
-TYPE LIMIT: &&LIMIT<--

-SET &&VPDATNAI='';
-SET &&LIMIT='';

-TYPE Sent values back to first fex
-TYPE VPDATNAI: &&VPDATNAI<--
-TYPE LIMIT: &&LIMIT<--
-TYPE -*******************************************
-TYPE -** end second fex
-TYPE -*******************************************


My result is the following
 -*******************************************
 -** first fex
 -*******************************************
 Sent values to second fex
 VPDATNAI: OUI<--
 LIMIT: 1<--
 -*******************************************
 -** second fex call
 -*******************************************
 -*******************************************
 -** second fex
 -*******************************************
 Received values from first fex
 VPDATNAI: OUI<--
 LIMIT: 1<--
 Sent values back to first fex
 VPDATNAI:  <--
 LIMIT:  <--
 -*******************************************
 -** end second fex
 -*******************************************
 Received values from second fex
 VPDATNAI:  <--
 LIMIT:  <--
 -*******************************************
 -** end first fex
 -*******************************************

Also, please update your signature to let us know which version of WF you are running


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
December 19, 2019, 02:57 AM
Kykyn
HI,

Thks a lot for your help
In fact the pb is that i use an -EXIT in the 2nd FEX, and so the global variables are not killed as i would.
So i m going to try to modify my fex to fix this pb.

One more time thks a lot!
Cédric


WebFocus 8.2, Windows
December 19, 2019, 10:33 AM
FP Mod Chuck
kykyn

-EXIT is not a good idea in any fex unless you are in debugging mode.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats