08-01-2012 10:28 AM
Hi All,
I am trying to call a dialog box from a script with this code:
Dim MyDlg Set MyDlg = SudDlgCreate("Input", "DlgProgress")
DIAdem displays the error >>Cannot find "dlgProgress.SUD" file<<
How can I "tell" DIAdem where to look for the file? (inserting the full path instead of "DlgProgress" didn't work)
Regards,
FraCh
Solved! Go to Solution.
08-02-2012 01:06 AM
Hi FraCh,
you only need to mention the whole path like:
Dim MyDlg
Set MyDlg = SudDlgCreate("Input", "C:\DlgProgress") . But you'll have no permission to write this directory (C:).
If you don't mention any directory or path DIAdem will use the path which is storage at Userpaths of the settings window. (%CSIDL_COMMON_DOCUMENTS%\National Instruments\DIAdem 2011\Data\)
In larger applications it's not recommended to use the whole path. You usually use path variables.
Have you already used the record mode(dt: Aufzeichnungsmodus)? When you start this mode you have to choose one of this three possibilities to go on(->Attachment)
Try them to see the differences.
Regards,
Philipp K.
AE | NI Germany
08-02-2012 01:30 AM
Hi FraCh,
You are going to create a non-modal SUD dialog. You can always specify the the dialog path with the SUD file name. Therefore you can use the following options:
Using the current path for scripts - typically where you started the main script (except you changed this path in the script)
Set MyDlg = SudDlgCreate("Input", CurrentScriptPath & "DlgProgress")
Using an explicit path
Set MyDlg = SudDlgCreate("Input", "MyDrive:\MyFolder\DlgProgress")
Using a variable for the path
dim sMyPathVar
sMyPathVar = "MyDrive:\MyFolder\"
Set MyDlg = SudDlgCreate("Input", sMyPathVar & "DlgProgress")
Using no explicit path is pointing to the path which is set in the variable ScriptReadPath
Set MyDlg = SudDlgCreate("Input", "DlgProgress")
Please have a look at the example "VIEW_Statistic_Init.VBS" in which the command SUDDlgCreate is used.
Greetings
Walter
08-02-2012 06:00 AM
Thanks you two.
This is a bit embarrassing: I used the method correctly but I didn't use the file name but the object name of the DlgBox to call it.
Regards,
FraCh
08-02-2012 04:10 PM
Hi FraCh,
I strongly recommend you use the old variable "AutoActPath" or the new variable "CurrentScriptPath" to programmatically build the relative file path of all needed resource files like the SUDialog file. This way you can deploy your script application's start folder anywhere on the hard drive and all path parameters will stay correct.
Brad Turpin
DIAdem Product Support Engineer
National Instruments