Re: Storing Variables

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Jason Hartsoe" <JasonHartsoe@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5453D57A-EAC4-4668-9C5F-DE1DC949B3E9@xxxxxxxxxxxxxxxx
I have a sub routine that's passing in a variable. I need to take that
variable and store it globally...but here's what's happening.

ex: I'm executing my routine: doMyThing(path, "test")
I'm executing that command at least 10 times replacing the word test with
my
next object. When im receving that variable:
Sub doMyThing(ByVal Path As String, ByVal other As String)
I can use my variable...now how can I take that variable from this sub and
pass it to another sub? Is there a way to store that variable or set
during
each call of doMyThing? Does that make sense? lol

Basically I want to store it and change it during each call...i'm doing
some
async stuff and need it to change each time it's called....

thanks!


Don't know if I understand you correctly, but you may be looking for a
Static variable. Static variables hold their values between calls to a
method.


.



Relevant Pages

  • Re: Storing Variables
    ... that variable and store it globally...but here's what's happening. ... I'm executing that command at least 10 times replacing the word test ... Sub doMyThing(ByVal Path As String, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Storing Variables
    ... variable and store it globally...but here's what's happening. ... I'm executing that command at least 10 times replacing the word test with my ... Sub doMyThing(ByVal Path As String, ...
    (microsoft.public.dotnet.languages.vb)
  • Storing Variables
    ... variable and store it globally...but here's what's happening. ... I'm executing that command at least 10 times replacing the word test with my ... Sub doMyThing(ByVal Path As String, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Cant Undo Macro Command
    ... If you know that the style will always be calculation, you don't need to store ... If you were writing a generic Undo procedure, you'd have to keep track of the ... Dim myRngToCopy As Range ... ' Specify the Undo Sub ...
    (microsoft.public.excel.programming)
  • Re: Attach File
    ... doc - is an object bound frame, it is the field I want to store the file. ... Private Sub CommFind_Click ...
    (microsoft.public.access.formscoding)