OriginPro 9.0.0 SR1, Win7 64-bit, running in VMware Fusion 5.0.2
Howdy,
I have a question about declaring global variables and deleting them. In the sample code below, I force a variable to be global and test for it's existence. Then I delete it and check for it's existence again. (The code would be in an OGS file making the variable declarations local by default).
Why does the global variable continue to exist after it is deleted?
// Declare local variable
double nMyNum = -5.4321;
// Declare global variable and assign it to local var value
@global=1;
double G_MYNUM = nMyNum;
@global=0;
// Check for existence of global variable - it will evaluate to true
if (exist(G_MYNUM) == 4)
{
type "It exists before delete";
}
// Delete global variable
del -v G_MYNUM;
// ?!?!? Delete local variable ?!?!?
del -ra G_MYNUM;
// Again, check for existence of global variable - it will evaluate to true again
if (exist(G_MYNUM) == 4)
{
type "It exists after delete";
}