PxPlus User Forum

Twitter Twitter Twitter

Author Topic: *system object  (Read 1553 times)

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
*system object
« on: March 31, 2021, 06:23:37 PM »
In regular PxPlus/Nomads, we use the system object to generate a timeout event and then use our function key handler to catch the generated CTL value & execute some logic.
Something like:
def object MY_SYSTEM_OBJ,"*system"
enable event on tim=MY_INTERVAL
on event "TimeOut" from MY_SYSTEM_OBJ preinput MY_TIMEOUT_CTL

It looks like that event doesn't get generated or gets swallowed up when running via iNomads/browser - is that correct? If so, is there something analogous we can use in iNomads?


Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: *system object
« Reply #1 on: April 02, 2021, 08:17:55 AM »
Is there a reason you didn't use the standard %Nomads'Timeout property to define a  page timeout then, on receiving the Timeout (CTL=-1900) either execute your Function key logic or do a PREINPUT to queue it up?

This would work on Both whereas setting a system timer on the server will result in an out of sync scenario between the host and browser.  That is the host will receive what it things is input from the browser and try to respond, however since the browser didn't send the event it will not be expecting the response from the host.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
Re: *system object
« Reply #2 on: April 03, 2021, 04:39:18 PM »
Maybe I'm operating on a misconception (wouldn't be the first time). I thought using the timeout event of the *system object meant "trigger the event (& CTL) every X seconds", regardless of how long it had been since user input had been received, whereas the setting the global 'Timeout meant "send a panel close (and CTL=-1900) after X seconds of idle time/no input".

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
Re: *system object
« Reply #3 on: April 12, 2021, 05:28:23 PM »
After poring through the iNomads doc, I think I can use the 'User_poll_routine$ property to pretty much replicate the behavior I want:

User_Poll_Routine$ If set by developer, system will call this routine every time a poll is received from the browser.