Forum Discussion

mailtosarojjena's avatar
mailtosarojjena
Occasional Contributor
14 years ago

variable

Is it possible to replace

Set tab1 = Aliases.xyz.wndAfx.MDIClient.wndAfx.page1.Tab1  



code to the following code(replacing wndAfx with var)

var = wndAfx

Set tab1 = Aliases.xyz.wndAfx.MDIClient.var.page1.Tab1  


3 Replies

  • Hi,



    Use Eval in this case:

    ...

    var = "wndAfx"

    Set tab1 = Eval("Aliases.xyz." & var & ".MDIClient.var.page1.Tab1")

    ...

  • Morgan's avatar
    Morgan
    Frequent Contributor
    Sorry, I know this is an old thread. 



    Is it possible (I'm sure it is)  to do this based on another variable? 



    Such as the case if there was an additional line for Set Test = Aliases.xyz in the code provided?  I can't seem to get that working for me...



    Thanks,

    Morgan
  • Morgan's avatar
    Morgan
    Frequent Contributor
    Of course it would happen that I figured it out right after I sent it.... I had created a second line with another Set that called the first variable but didn't realize that I needed for it to be VariableName.FullName (I had JUST VariableName).  I think I am good.



    Morgan