Function inside a super genie(Pop-up)

Hi.

I'm trying to figure out how to re-use the variables inside the PopUpPage.

Here's a link to the function im trying to use inside my popup.

proscada.ru/ctkbase.en/resources/attachments/q4572/exec-guid36c264eab1aa4e048470d7d23cdeb0c2.ci

This simple function works in the genie but not in a super genie.

//MouseButtonDown

ExecEx("%Drawing%")

I've tried replacing the % sign with ? and lots of other ways, with no success. (The function still works if I just type in a "direct" path to open a folder., but I want to use a variable, that I can edit)

FUNCTION

PopUpPage(INT X,INT Y,INT Mode, STRING Drawing)

WinNewAt("!PopUpPage",X,Y,Mode);
SleepMS(25);
WinTitle("TITLE");

Got any ideas?

Thanks in advance.

Robin

Parents
  • Thank you for the detailed answer!

    I've been testing these methods that you mentioned today.
    But I'm getting a fatal error because of: Ass(-2, "DrawingName", "'" + Drawing + "'");
    It says: incorrect number of arguments for function(E2022).

    I'll try to clarify how my genies/super genies look like:
    I've got a genie that has the symbol of a motor.
    There's an UP command, to get to a popup with a sensor that has an ON/OFF state
    and there's also a button with the ExecEx function, to access the drawing of that motor.

    I only tried to put the ExecEx function inside the motor symbol(genie) with Middle mouse button down just to get the correct syntax, which worked with the %Drawing%, same thing goes for the appearance of the motor symbol, I can use a ON/OFF statement here with the same %Drawing% .
    However, I can't figure out how to make it work on the inside of the popup/super genie.

    I'm using a similar association in the cicode as the one you showed me, which works:
    Ass(-2,1,Drawing+"Sensor",0);

    And then inside the popup I've got a symbol that has an ON/OFF state (On symbol when ?1?=1)
    In this case it works, but I've not found a way to use that string variable in the ExecEx function, I believe it is looking for a local variable in the Exec.ci, the popup function is stored in another cicode file. (Just my thought, might as well be that I'm using the incorrect syntax.)
Reply
  • Thank you for the detailed answer!

    I've been testing these methods that you mentioned today.
    But I'm getting a fatal error because of: Ass(-2, "DrawingName", "'" + Drawing + "'");
    It says: incorrect number of arguments for function(E2022).

    I'll try to clarify how my genies/super genies look like:
    I've got a genie that has the symbol of a motor.
    There's an UP command, to get to a popup with a sensor that has an ON/OFF state
    and there's also a button with the ExecEx function, to access the drawing of that motor.

    I only tried to put the ExecEx function inside the motor symbol(genie) with Middle mouse button down just to get the correct syntax, which worked with the %Drawing%, same thing goes for the appearance of the motor symbol, I can use a ON/OFF statement here with the same %Drawing% .
    However, I can't figure out how to make it work on the inside of the popup/super genie.

    I'm using a similar association in the cicode as the one you showed me, which works:
    Ass(-2,1,Drawing+"Sensor",0);

    And then inside the popup I've got a symbol that has an ON/OFF state (On symbol when ?1?=1)
    In this case it works, but I've not found a way to use that string variable in the ExecEx function, I believe it is looking for a local variable in the Exec.ci, the popup function is stored in another cicode file. (Just my thought, might as well be that I'm using the incorrect syntax.)
Children
No Data