Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IM VBS - Variables

Status
Not open for further replies.

baugie

Programmer
Apr 9, 2003
56
US
I'm writing a two part script within IM for the integration to get the next Doc No and pass it back to upon successful document process.

I getting the Doc No. and assigning it to a variable using SetVariable "sDocNo", (Doc No.) from the Before Document Commit script.

After this document is successfully processed, I am going to write this Doc No back out for reporting. However, I am getting an error when I use the GetVariable("sDocNo") as a method not found.

This is the documented procedure, so I am a bit vexed. Again, thanks in advance for your help.

baugie
 
Hi Baugie - The documentation example shows GetVariable being used with parentheses while the SetVariable example does not use them. Have you tried using GetVariable both ways?

Just a thought.

Curtman
 
Thanks Curtman;

Actually, the problem was that I was writting a field from a recordset directly into the variable. The field was a string, but there was something wrong with how the variable was receiving the value. It would show up within the same script using getvariable, but would not keep it in memory when referenced from another script. I did a cstr converstion on the field when saving it to the variable and was able to reference it from other scripts. It was a very weird situation. I guess the data type needs to be explicity defined when saving it into the variable?

Thanks though.

baugie
 
My knowledge of vbscript is vary minimal. It seems though that when I use it, the variables do not really have data types. It just depends on the value you set for them. I had some that kept insisting on being a certain type and I had to keep converting them. I tried to define them but I guess you can't do that in vbscript.
 
All variables are variants within vbscript. So it shouldn't matter what goes into it. That is why it was unusual that when I did test of the set/getvariable, when I used a fixed string "test" it was passed appropriately. When I used a field value from a recordset, it would not pass it between scripts. However, when I did the cstr(field) it passed it correctly. Just an oddity of vbscript...thanks Microsoft!! :)

baugie
 
lol...atleast you're thanking them! Anyway, you're beyond my skills so I'm glad YOU know what it is. I'll be sure to remember to come to you for help with vbscripting! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top