Re: Construct on a int field
Posted in 1998
Abraham Perl - Application Developer wrote: > > I have the following problem: > i construct on a int/smallint field, if the user enters characters in the > field and presses enter he gets an error "error in field". but the field > does not get cleared if he presses the interupt key then the program > terminates. > is there a simple solution to this problem You do not specify but I assume you are asking about 4GL. You can put a BEFORE FIELD clause in the CONSTRUCT and clear the field before the user enters the field by DIPSLAYing blanks to the field. As far as the interrupt key, add an ON INTERRUPT CONTINUE statement and you can check for the interrupt key by checking the global variable int_flag which is set to 1 if the user presses the interrupt key, you just have to initialize it to zero before the CONSTRUCT statement and you can have an ON KEY INTERRUPT clause in the CONSTRUCT to capture the interrupt event and do whatever seems proper, exit the CONSTRUCT, etc. After the construct you can choose whether to execute the statement you were building based on the value of int_flag. BTW without the ON KEY INTERRUPT the interrupt key will still cause the CONSTRUCT statement to exit but the ON INTERRUPT CONTINUE will allow the program to continue following the END CONSTRUCT clause. Art S. Kagel