DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DIAdem Script: Goto and Continue are not working

Solved!
Go to solution

Hi All,

  I am having trouble using the 'Goto' and 'Continue For' lines in DIAdem script.  Does anyone know if these are disabled in DIAdem or if I am doing something wrong.  Take these examples below for instance:

 

Goto:

option explicit
dim a,b
b=""
for a=1 to 50
  if a=10 then goto Printer
  b=b&" "&a
next 'a

Printer:
msgbox(b)

 reports an error directly after the 'goto' text

 

Continue:

option explicit
dim a,b
b=""
for a=1 to 50
  if a=10 then continue for
  b=b&" "&a
next 'a

Printer:
msgbox(b)

 Reports an error right after the 'continue' text.

 

Please shed some light on this.  Thanks!

0 Kudos
Message 1 of 3
(5,641 Views)
Solution
Accepted by topic author GT_Mark

Hello GT_Mark,

 

In VBS is "GoTo" only associated with "On Error Resume Next". In all other cases "GoTo" and "Continue" are not part of the VBS command set. (Please keep in mind that DIAdem supports VBS and not VBA or VB.) Your example can be changed as follows:

 

Option Explicit

dim a,b
b=""
a = 0
do while (a < 10)
  a = a + 1
  b=b&" "&a
loop 'a

msgbox(b)

Greetings

Walter

 

0 Kudos
Message 2 of 3
(5,631 Views)

Thanks for the reply.  Unfortunately the workaround you suggest does not work for my particular application.  I'm just going to have to reformat the Sub.  I think using a Select Case will take care of things for me.

 

Thanks again for clarifying a difference between VBS and VBA.

0 Kudos
Message 3 of 3
(5,622 Views)