From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to start a SUD from the dialog editor when ScriptInclude of Subsequence script is used in the SUD

Hello,

I'm using DIAdem 2012. I have include a script in a SUD that is started as a non modal Dialog from a main script, as described in a best practices note, the call is ScriptInclude("scriptname") in the SUD and in the script the call of SubSequence() marks the scipt as sub script. This work's fine if I start the SUD from a main script.

Recently I tried to use the Button/Function "Test in DIAdem" from the Dialog Editor, then I get a error, referenced to the code line of "ScriptInclude":

Das Starten dieses als "Subsequence" gekennzeichneten Unterscripts ist nicht möglich

(~ starting of the sub script marked as "subsequence" is not possible)

I know this error occurs, when you try to call a script that is marked as sub sequence with ScriptStart(), but that's not the case - I do function calls of sub function of the sub script e.g. in the Dialog_EventInitialize() function.

Is it even possible to "test" a SUD with sub sequent function?

 

Example:

SUD:

Option Explicit  'Erzwingt die explizite Deklaration aller Variablen in einem Skript.
Call ScriptInclude(CurrentScriptPath & "HandleSTATE")
Dim ...
Sub Dialog_EventInitialize()
End Sub
...

SCRIPT "HandleSTATE": 

Option Explicit  'Erzwingt die explizite Deklaration aller Variablen in einem Script.
Call Subsequence()
Dim ... Sub GetState()
'do something End Sub

 

0 Kudos
Message 1 of 3
(2,583 Views)

No ideas? Hints? Comments like: "use DIAdem2017"?

 

Is my question too obscure?

0 Kudos
Message 2 of 3
(2,514 Views)

Hi olhass,

 

I give it a quick try and receive the same error in DIAdem 2017 SP1 64-Bit.

A newer version of DIAdem would not fix the issue.

The only workaround I know is to Subsequence statement.

 

Stephan

0 Kudos
Message 3 of 3
(2,490 Views)