Hello Martin!
You sound a little bit SUD frustrated. I can understand this verry good because I had the same feelings years ago. After building some tools and exploring some (dirty) hacks I'm now in the nice situation to ignore most limitations. The general thing to say is what the NI DIAdem R&D likes to say: SUD is a simple tool for creating GUIs for test rig automations or measurement calculations and not a sophisticated, state-of-the-art GUI programming system!
Back to reality. As far as I know is there no native way to declare SUD file variables. You have the choice to use global DIAdem variables (T1/L1/R1 or VAS or ODS_VallAlloc or GlobalDim). One aproach for a solution (DIAdem >=10) is to declare the variables with GlobalDim in the first dialog declaration section. Than you can use them in all sub dialogs. I like classes verry much so I would declare one variable and set it with an instance of a simple class containing just some variables (+initialization).
This can look this way:
'(Declarations)
Option Explicit
Call GlobalDim("MySudVars")
Set MySudVars = New CMySudVars
Class CMySudVars
Public MyT1
Public MyR1
Public MyL1
Public MyO1
Public Sub Class_Initialize
MyT1 = ""
MyR1 = 0.0
MyL1 = 0
Set MyO1 = Nothing
End Sub
End Class
'End of (Declarations)
After this you can use MySudVars in all sub dialogs (e.g. MsgBox MySudVars.MyT1). You have full access from all dialogs!
Note: If you try to access the variable in the starting script you will see that it is still set. But if you want to read a value you get a runtime error. If you want to do this you must declare/set the variable in your script.
To be honest: For your other problem I know a tricky solution but I can't provide it here. I'm sorry!
Hope this help a little bit to reduce your SUD frustration
Matthias