So, this time just in VBScript and not even JScript (thanks for the vector fix there)... and I want to say this could have changed between beta's 5 and 6... but maybe I just hadn't been doing similar things to what I'm trying now under B6. I'll re-test in B5 if you think it's worth it. But I digress...
- I've got a Script.Config property I've initialized as an Array in OnInit...
- If I message out it's TypeName() during init... == Variant, and I can run array functions against it no problem
- Once the script command method gets called, this remains true. SO LONG AS I don't use the scripts 'Configuration' interface to modify the default values in the array property.
Once I do so, normal array functions against the property throw an error:
A method was called unexpectedly (0x8000ffff)
...and sure enough, the properties' type has changed from 'Variant' to just 'Object'. Resetting the script config properties back to their default doesn't even return things to normal. I have to nuke the contents of the ScriptConfig.oxc file to get things even back to a normal 'default' working state. This is by the way, relevant to one of my previous posts about how deleting and re-adding scripts leaves remnants behind: DO11: Scriptconfig.oxc remains after script deletion
Sample script attached: ScriptCommand_vbtest.osp (1.55 KB)
Provided as an OSP package just for simplicity sake... load it in, run the VBTEST command it adds, and check the output window log... You'll see another error FIRST which I'm starting another topic for... but for this topic, you'll see that I can successfully run UBound() against the objScriptVT_ARRAY property to show it's "size". If you then goto the scripts listing in Prefs and use the Configure button to modify the property (I added another line that reads "Fourth") then re-run the VBTEST command, you'll see the error in the code box above, and an earlier message showing the TypeName value is now Object instead of variant. You should also see that resetting the property to defaults in the Configure dialog doesn't even "fix" things .