Opening all forms within their objects

 
  • Hi!

    I have a code that puts objects once created in to an array.
    Once the object is called it opens a form.
    I want to know how to open those forms if they are closed all at ones?
    I don't want to know how to make it easier I know a way already.
    I just want to know how to do this.

    If possible would also like to know how to give values to variables in forms inside objects.

    Forms inside objects are named like this: setup form !!mynewForm$!iD


    This is what I tried:
    define method .createNewForm()


       !this.formList[!this.myId] = object newForm(!this.myId)
       !this.myId = !this.myId + 1


    endmethod
    --
    ----------------------------------------------------------------------------------------------------
    define method .showAllForm()


     !tempCounter = !this.myId - 1


     if !tempCounter.gt(0) then
       do !i to !tempCounter
         !tempArray=!this.formList[!i]
         show $!tempArray[!i].mynewForm$!i
       enddo
     endif


    endmethod



    This is the error it gave:
    (46,41)  
    ERROR - Invalid array index In line 302 of PML function testform.SHOWALLFORM
         show $!tempArray[!i].mynewForm$!i
    Called from line 1 of Command/Form Callback Command
    !this.showAllForm()


    EDIT:
    ------------------------
    Also removing the array index:

     !tempCounter = !this.myId - 1


     if !tempCounter.gt(0) then
       do !i to !tempCounter
         !tempArray=!this.formList[!i]
         show $!tempArray.mynewForm$!i
       enddo
     endif


    Error:

    (47,15)   CP: Syntax error In line 301 of PML function testform.SHOWALLFORM
         show ^^NEWFORM.mynewForm1
    Called from line 1 of Command/Form Callback Command
    !this.showAllForm()


    Also tried this:
         
    !tempFormName = '!!' & !tempArray.mynewForm$!i
    show $!
  • You can check Aveva's PML, for example C:\Program Files (x86)\AVEVA\Everything3D2.10\PMLLIB\paragon\forms\catcontrol.pmlfrm
    !formString = |!!| & !list.rtext[!entry]
       !form       = $!