Hello,
I have the following code:
def var vtax as char label "Taxable" format "x(1)".
def var v_yn as character INITIAL "y,n".
form
vtax skip(1)
with frame frma with side-label
Title 'Tax Information - Enter y/n' overlay CENTER.
update vtax with frame frma.
if LOOKUP(vtax,v_yn) = 0 THEN DO:
message "Enter either y/n for IC Taxable Field".
next-prompt vtax with frame frma.
undo, retry.
end.
What I need to do is that if the user types in anything else other than y/n and then hits the F1 key, it prompts them with the following message "Enter either y/n for IC Taxable Field" THIS WORKS. But if the user hits the F4 key at anytime, I need to validate that vtax is y/n. Only if it is, then the user can exit by hitting the F4 key.
What i came up with was the following but does not work:
def var vtax as char label "Taxable" format "x(1)".
def var v_yn as character INITIAL "y,n".
form
vtax skip(1)
with frame frma with side-label
Title 'Tax Information - Enter y/n' overlay CENTER.
mainloop:
repeat.
update vtax with frame frma.
if lastkey = keycode("F6") and LOOKUP(vtax,v_yn) = 0 then next mainloop.
else leave.
if LOOKUP(vtax,v_yn) = 0 THEN DO:
message "Enter either y/n for IC Taxable Field".
next-prompt vtax with frame frma.
undo, retry.
end.
end. /* repeat */
I simply cannot this get code to work if the F4 key hit and need to validate that the field has a value of either y or n .
Thanks for the heop
I have the following code:
def var vtax as char label "Taxable" format "x(1)".
def var v_yn as character INITIAL "y,n".
form
vtax skip(1)
with frame frma with side-label
Title 'Tax Information - Enter y/n' overlay CENTER.
update vtax with frame frma.
if LOOKUP(vtax,v_yn) = 0 THEN DO:
message "Enter either y/n for IC Taxable Field".
next-prompt vtax with frame frma.
undo, retry.
end.
What I need to do is that if the user types in anything else other than y/n and then hits the F1 key, it prompts them with the following message "Enter either y/n for IC Taxable Field" THIS WORKS. But if the user hits the F4 key at anytime, I need to validate that vtax is y/n. Only if it is, then the user can exit by hitting the F4 key.
What i came up with was the following but does not work:
def var vtax as char label "Taxable" format "x(1)".
def var v_yn as character INITIAL "y,n".
form
vtax skip(1)
with frame frma with side-label
Title 'Tax Information - Enter y/n' overlay CENTER.
mainloop:
repeat.
update vtax with frame frma.
if lastkey = keycode("F6") and LOOKUP(vtax,v_yn) = 0 then next mainloop.
else leave.
if LOOKUP(vtax,v_yn) = 0 THEN DO:
message "Enter either y/n for IC Taxable Field".
next-prompt vtax with frame frma.
undo, retry.
end.
end. /* repeat */
I simply cannot this get code to work if the F4 key hit and need to validate that the field has a value of either y or n .
Thanks for the heop