DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

user variables in v11

In v11 I get an error when using user variables.  It works in 10.2.  However, I also have trouble with user variables in v9
 
Here is the code

Call

UserVarCompile("TSR", "new")

Call AssignTsrHeader(Batch)

Set ObjInList = CreateObject("Scripting.Dictionary")

Set ObjCalcList = CreateObject("Scripting.Dictionary")

Call TsrTypeLists(ObjInList, ObjCalcList, Groupspec)

Call NumTsrPages(ObjInList, ObjCalcList, InPages, CombndPages, CalcPages, ChnPerPage)

TotalPages = InPages + CalcPages + CombndPages

Call TsrPgs(ObjInList, ObjCalcList, CombndPages, TotalPages, ChnPerPage, Batch, WmfPreSpec)

Set ObjInList = Nothing

Set ObjCalcList = Nothing

Call UserVarFree("TSR")

 

And here is the error in v11

Error while executing "USERVARFREE" command

Error Type: ACCESS VIOLATION

Error Address:000049D8

Module Name: Diadem.exe

 

In v9 I sometimes get an error that states "Variable Initialization Failed", other times it works just fine.

 

 

Is there a proper way to utilize user variables, and reinitialize the contents without having to reload/recompile?

 

0 Kudos
Message 1 of 4
(3,879 Views)

I found a work around by using

UserVarFree("TSR")

UserVarCompile("TSR")

 

in lieu of

UserVarReset("TSR")

 

I tried several things, one being

UserVarLoad("TSR") in place of compile to see if this helped.

However, no matter where I saved this file I kept getting a message that the file doesn't exist.  The Diadem help says this command looks in the desktop directory, however I saved the .vas file in this directoy and it still gave me an error that the file doesn't exist??  Oh well, my work around seems to be working.

0 Kudos
Message 2 of 4
(3,875 Views)

OKCheck Spelling

 

I lied.  After returning from lunch and running a couple of more test cases, the software is not working.  I get the same Acces Violation error as a resut of the UserVarFree command.  I got rid of it and the UserVarCompile(Vas filename,"new") seems to wipe out the variable contents and reload OK on its own.  Hope it still works two hours from now.

0 Kudos
Message 3 of 4
(3,871 Views)
Hi Ryan,

It sounds like you have solved the issue on your own. If this is not the case please let me know as I would be happy to help you further.

To provide some more insight, user variables were created before the introduction of VB Script. With the introduction of VB Script, we also introduced the GlobalDim which we recommend using in place of user variables. None the less, we still provide support for user variables and if you need help with using them we are certainly open to that.
Manooch H.
National Instruments
0 Kudos
Message 4 of 4
(3,834 Views)