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: 

script ends after calling and running an object

Hello,

 

I have a script that is not looping through an object as I expect.  It is likely something easy that I am overlooking...

 

Without posting exact code it is something like this:

 

For Loop1

    For Loop2

         Call Object

    Next

Next

 

Object

    Sub 1

    Sub 2...

End

 

The nested For Loop2 only cycles one time and after the object code is executed the script finishes without error.

Any thoughts?

 

 

0 Kudos
Message 1 of 3
(3,956 Views)

You posted to the Diadem Idea Exchange which is for ideas to improve Diadem.  Your message sounds like an ordinary question asking for help.

 

I've asked the moderator to move it to the appropriate message board.

0 Kudos
Message 2 of 3
(3,953 Views)
Option Explicit

dim k : k = 0
dim obj : set obj = new CAbc

dim i : for i = 1 to 3
  dim j : for j = 1 to 5
    k = k + 1
    call obj.def()
  Next
Next

MsgBox k


class CAbc
  sub def()
    k = k + 1
  end sub
end class

If your Code looks like this it seems to work like expected.

0 Kudos
Message 3 of 3
(3,937 Views)