Topic
2 replies Latest Post - ‏2013-04-18T18:03:48Z by Derk11
Derk11
Derk11
2 Posts
ACCEPTED ANSWER

Pinned topic Module reference - for loop

‏2013-04-18T14:02:44Z |

In a for loop I normally use:

Object o = null

for o in (current Module) do {

...

}

 

How can I use the for loop to iterate through another module in the current project?  All examples I have seen refer to only the current module and not another module in the project.

Thanks,

Derk

 

 

  • llandale
    llandale
    2943 Posts
    ACCEPTED ANSWER

    Re: Module reference - for loop

    ‏2013-04-18T14:34:38Z  in response to Derk11

    The "examples" are just that.  Realistically the above loop "should" look like this:

    • Module mod = current
    • for o in mod do{}

    This lets you use the module handle for something else later in the code.

    As for other modules, it would generally look like this:

    • Module mOther = read(FullName_OtherModule, false, true)
    • for oOther in mOther do{}
    • close(mOther)

    -Louie

    Browse the DXL forums for "current Module" and you should find good arguments against using that.

    • Derk11
      Derk11
      2 Posts
      ACCEPTED ANSWER

      Re: Module reference - for loop

      ‏2013-04-18T18:03:48Z  in response to llandale

      Thanks Louie that works.