Search code examples
informix4gl

How can I make the Informix 4GL press a key for me?


I have a situation where the program waits for the user to press accept and then starts to do some actions. If a certain condition is true, I would like to get all the actions. I could type:

if condition = true then ...

But the 'then' is too much of codes. It would be much easier if I can write something like:

if true then press accept

So it will treat as if the user pressed it. I couldn't find any way so far. Is there a way to do it?


Solution

  • You will need to explain why it would be better to do what you're suggesting than to write:

    IF condition != TRUE THEN
        …input operation waiting for ACCEPT…
    END IF
    CALL function_to_do_actions(…)
    

    (You don't even have to call a function; you can simply write the actions following the test.)

    I don't think there's a documented way of doing what you're asking — faking a key-press.