Re: variable values disappearing after using ON KEY in INPUT statement
Posted in 1994
From John T. Fontanilla: * * Hi there, * * I have the following fragment of code and I'm wondering why the values * I enter in f1 are disappearing (old values keep coming back) after I * press Ctrl-N while in FUNCTION f1, go to FUNCTION f2, * then return to f1. * * Do you know how to solve this? Pls. email. Thanks! I'm trying to re- * member someone posting here about a function that writes to the * variable but I forgot that person. * * FUNCTION f1() * INPUT [part_of_record variable here] WITHOUT DEFAULTS * # I'm sure I had 'WITHOUT DEFAULTS' * ON KEY(CONTROL-N) * CALL f2() * EXIT INPUT * END INPUT * END FUNCTION * * FUNCTION f2() * INPUT [other_part_of-record variable here] WITHOUT DEFAULTS * # I'm sure I had 'WITHOUT DEFAULTS' here also * ON KEY(CONTROL-N) * EXIT INPUT * END INPUT * END FUNCTION Try the following: { Define a screen record in the .per that contains only the fields in this function ( f1 ), ex. SCREEN RECORD first_part( fields ) } FUNCTION f1() INPUT [part_of_record variable here] WITHOUT DEFAULTS ON KEY(CONTROL-N) CALL get_fldubuf( first_part.* ) RETURNING [part_of_record variable here] CALL f2() EXIT INPUT END INPUT END FUNCTION { Define a screen record in the .per that contains only the fields in this function ( f2 ), ex. SCREEN RECORD second_part( fields ) } FUNCTION f2() INPUT [other_part_of-record variable here] WITHOUT DEFAULTS ON KEY(CONTROL-N) CALL get_fldubuf( second_part.* ) RETURNING [other_part_of_record variable here] EXIT INPUT END INPUT END FUNCTION Hope this helps, Robert Minter |Data Systems Support| \\\\\\_/// Programmer, Software Development | Orange, CA | ( _ _ ) internet: rob@dssmktg.com | Tel: 714.771.0454 | (| ^ |) bangpath: uunet.uu.net!dssmktg!rob| Fax: 714.771.3028 | \\`-'/ #include <disclaimer.h> \\_/