twk Posted February 26, 2014 Share Posted February 26, 2014 How do we pass info from one event to the next? I wrote a PIO that has standard parameters, plus an extra button that allows the user to select a hatch from a custom pop-up dialog. I placed the code for calling the hatch dialog into the 'button click' event section, and tested it. It was getting the hatch name correctly (i sent it to static text parameter to display it there). What I was wanting was to send the name through to the 'resetEvent' section. That has the code to set a rectangle to that selected hatch. Which I can't get it to. If I'm unclear I can try and post a narrowed down version of my code. Thanks in advance Quote Link to comment
Hippocode Posted February 26, 2014 Share Posted February 26, 2014 (edited) Just load the "hatchparameter" static text you mention in your main script. After drawing the rectangle,use whatever SetHatch function there is to change your rectangle. Your button will update that parameter and reset the object. Edited February 26, 2014 by hippothamus Quote Link to comment
twk Posted February 26, 2014 Author Share Posted February 26, 2014 Riight.. I see now, so normal variables can't be passed between events, even if they're declared globally? Quote Link to comment
Hippocode Posted February 27, 2014 Share Posted February 27, 2014 (edited) A global param is a global param, but you can't just jump from one event through another in one go. Only the triggered event will run so not all of your code will be used. This means that if you would "draw" the rectangle in your buttonIsClicked event, it would probable be drawn outside your pio, not bound to it. After changing your paramfield/recordfield with SetRField, a RESET event will be triggered. The complete code of your object will run again ( refreshing any parameter value you had loaded, also the globals ) and excecute the correct event ( reset in this case ). That is why you need to alter an object parameter and load it to use your selected hatch. Edited February 27, 2014 by hippothamus Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.