Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-12-2004, 11:28 AM
Sotorin Sotorin is online now
Registered User
 
Join Date: 05-07-2003
Posts: 7
This script doesn't work

I just placed this simple script into Project Tab in Script Editor page. One global variable and two procedures (one sets global variable and the other one reads it)

--- BEGIN ---

Dim var

Sub SetVar()
var = "My Name"
End Sub

Sub GetVar()
MsgBox "Value is: " & var
End Sub

--- END ---

Now, I insert two new Script steps; first step calls SetVar procedure and the second one calls GetVar.
When a MsgBox pops up it is unfortunately w/out var set to "My Name" ... it only reads "Value is:"

Why?

PS. The only way this works the way I want is when I globally set var to some value like this:

Dim var
var = "My Name"

Sub GetVar()
MsgBox "Value is: " & var
End Sub

But this defeats the purpose. Does exactly what I was affraid off .. variables go out of scope.

Last edited by Sotorin; 03-12-2004 at 11:30 AM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 11:35 PM.


Copyright © 1999-2023 Kinook Software, Inc.