palmtree with sun behind it CONTACT US
Phone: (412) 835-9417
Email: sales@vss3.com

TIP # 11 WHEN Data Entry Flow

It is helpful to recognize the flow control used during data entry in filePro. Most of us use the automatic (auto on DOS) and input tables to do processing, but many other levels can be used.

Lets look at WHEN processing this week. WHEN processing is all associated to the data entry fields on a screen.

@WEF5 This label would indicate something to be done WHEN ENTERING FIELD 5 on a data entry screen. This would normally determine if data entry should hit this field, supply default data, or display prompts to help during data entry in this field.
@WLF5 This label would indicate something to be done WHEN LEAVING FIELD 5 on a data entry screen. This would normally test data validity, fetch or post information entered.
@WHP5 This would normally be used to display help. This label would indicate something to be done WHEN HELP KEY is Pressed from FIELD 5 (F10) on a data entry screen. If no label exists for this key, the normal HELP logic to display any field help available would be done.
@WUK5 This label would indicate something to be done WHEN USER KEY is Pressed from FIELD 5 (F8) on a data entry screen. This can be used for a miscellaneous function, since this key is not usually defined, also, activated by pressing F3, F4, F9 in version 4.5.
@WBL5 This would normally be used to activate Browse lists. This label would indicate something to be done WHEN BROWSE KEY is pressed from FIELD 5 (F6) on a data entry screen. If no label exists for this key, the normal Browse Lookup logic would be done.

WHEN logic is a little snip of programming all to itself. When any of the following commands is executed then WHEN processing is finished.

END, SKIP, ESCAPE, EXIT, SCREEN (Can't think of any more.)

WARNING: If you execute any GOSUB commands from a WHEN, be sure that a RETURN is executed before the WHEN process hits one of the ending commands. This can cause "Too Many open GOSUB" errors or other OUT of MEMORY errors.

If you changed data during the WHEN, I suggest that it end with the commands: DISPLAY;END

Display will refresh the screen, END closes the When Process.

If you use the common SCREEN,6 Option to finish the @WLF5 it will always move your cursor to field 6 when you leave field 5. If you press UPARROW, ESCAPE, TAB or any other keystroke that might jump in another direction, you will still move to field 6. I find this annoying, others I have talked to think this gives better control. After I have tested a system like this for a few minutes, I am ready to scream. Just my opinion and I am stuck with it.

If you need to jump over a series of fields, when the first is left blank, use logic like this:

@wef8 If: 'Just labels on previous lines so if 5 is null, it will skip 6, 7 and 8
  Then:  
@wef7 If:  
  Then:  
@wef6 If: 5 eq ""
  Then: skip;end
  If:  
  Then: end

The wildcard version can be used of each of the above. It is executed if no specific WHEN logic is listed for the field.

@wlf* If:  
  Then: show ""; display; end 'This will clear any previous show messages as you enter each field.
@wef* If: @id ne "root"
  Then: skip;end 'This will keep anyone but root out of data entry
  If:  
  Then: end

 


Written by Nancy Palmquist

Copyright, 1997 by Virtual Software Systems.  All rights reserved.


Contact Us by: Email to Virtual Software Systems or Phone: (412) 835-9417