View Full Version : string argument error - new in 7.0

12-17-2007, 05:03 PM
This code worked in 6.0:

Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\My Program", "Last Checked", JulianDate, REG_SZ);

Now in 7.0, I get the attached error whenever it runs.

My question: I am using a JulianDate variable in the code, as you can see in my code snip. This was initialized in Project Actions -> On Startup.

JulianDate = System.GetDate(DATE_FMT_JULIAN);
However, it doesn't seem to be stored as it was in the 6.0 version of this project. Is there something that changed in 7.0 in regards to life expectancy of variables?

I figure I can probably work around it by simply re-initializing the variable, but I hate to think what else I might need to re-initialize. I tend to re-use variables an awful lot.
Maybe there's something different about the returned value table of System.GetDate?

12-17-2007, 07:36 PM
Update: The workaround did, in fact, work. So, is this a bug in 7.0 or an unintended feature in 6.0 that has now been removed?

12-20-2007, 07:48 AM
OK, has anyone else experienced early termination of stored variables in AMS 7, or is it just me?

12-20-2007, 08:20 AM
Hi Eric,

I tried to simulate the problem by creating something similar as far as the variable goes in a version 6.0 project, then opening it in version 7.0, but haven't experienced the same result.

As Eric says, has anyone else experienced this type of thing?

Eric, you may want to send your project to our support department to look further into it and try to replicate it on our side.

12-22-2007, 09:14 AM
Try converting the variable to a string to see what it contains at that point. It may help you find where the problems stems from?

Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\My Program", "Last Checked", tostring(JulianDate), REG_SZ);