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

  • OK, so there are a couple of problems I think, but first of all, where you have ExecEx(...\Documents\" + "?Drawing?" + ".pdf"), The quotes (") around ?Drawing? mean that ?Drawing? is being treated as a literal string rather than a substitution. You need to get rid of the quotes around ?Drawing?. There is another potential problem with string substitutions, where they aren't implicitly cast, so you may need to put ?string Drawing? in your command. It won't hurt anyway. A final pointer, which may help you in the future for these sorts of problems is to send your built up string to a Message() or TraceMsg() command to see what Citect is actually producing from your code.

    You could also put ?string Drawing? into a string on the final page just to make sure and see it hasn't gotten lost along the way.

    So something like this:
    ExecEx("C:\Users\Public\Documents\" + ?String Drawing? + ".pdf")

    HTH
  • Thanks I appreciate the answer.

    I figured I had to use the quotation marks, because this was the only way I could make it work in the symbol inside of the genie.

    I will look into these commands. https://softwareforums.aveva.com/cfs-file/__key/system/emoji/1f642.svg

  • I think you missed that you must use the number you used in your cicode function ** Ass(-2,100,"'"+Drawing+"'",0

    Use ?String 100? on your supergenie command to be able to get the dynamic  text to open your pdf file..

    It looks like you trying to use the text from your genie..

    Use this command from your supergeni/systempage to get it to work :

    ExecEx("C:\Users\Public\Documents\"+?STRING 100?+".PDF")

    Hope this will help you..

    //Michael

  • This is it!

    Can't believe I've tried so many different things but not this!

    Thank you so much, and thank you everyone else for all the efforts! https://softwareforums.aveva.com/cfs-file/__key/system/emoji/1f603.svg

  • Vad bra att det funkade!! :)
    Är ju lite olika att tänka på med genies (alltid inslutet med %-tecken) & supergenies (alltid siffror inslutna med ?) & blir special när man ska knyta dynamiska texter till supergenies, som 'normalt' använder taggars värden..
    ( " ' önskad dynamisk text '" vid ass i Cicode, och ?STRING Nummer? på supergenie sida...

    Ha en fortsatt bra dag!
  • Hi Michael,
    Can you keep it in English, please?
  • Sure.. sorry..
    was just answering Robin short in swedish since i've knew he was from Sweden..
    This is what I wrote (translated to english)

    Great that it worked !! :)
    Tt is a bit different things to remember when working with genies (always enclosed with % characters) & supergenies (always numbers enclosed with ?) & Becomes special when you have to link dynamic texts to supergenies, which 'normally' use the ass tag values ​​..
    ("'desired dynamic text'" at ass in calling Cicode, and? STRING Number? on the supergenie page ...)

    Have a nice day!
  • Riktigt gutt att det gick att få till!
    Tänkte att det här kan ju inte vara så svårt att lösa om jag lyckats få det att fungera i en genie, men det är inte superenkelt att hitta information i Citect.

    Tack än en gång och ha en bra dag du med! :)