The text of a manual · part 20 of 25
Attended Workstations (Catalog Nos. 2708-DH5B2L & -DH5B4L) (Series B) User Manual, pages 143 to 145
Pages 143 to 145 of 186: I - Time Display Formats; J - VBASIC Language Development Kit Programming Conventions and Tips
The original document is the PDF (513 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 2708
Page 143
Appendix
A–B
I
Time Display Formats These are the possible formats for date and time displays on the LCD. The desired format can be specified by selecting Clock Mode from the System Menu either via the keyboard or via the comm line and date displays. The code selected here does not have any effect on date/time format obtained from BASIC program variables. Mode
Format
1
9:45:50 PM SUN DEC 3, 1990 9:58 PM 9:58 PM SUN DEC 3, 1990 9:01:15 PM DEC 3, 1990 9:46:23 PM SUN DEC 3, 1990 10:10:01 PM 10:10:12:hh PM 10:10:12:hh PM DEC 3, 1990 10:11:21:hh PM SUN DEC 3, 1990 22:08 22:08 DEC 3, 1990 22:09 SUN DEC 3, 1990 22:10:38 22:10:01 DEC 3, 1990 22:12:00 SUN DEC 3, 1990 22:14:29:hh 22:14:59:hh DEC 3, 1990 22:15:01:hh SUN DEC 3, 1990 DEC 3, 1990 SUN DEC 3, 1990
2 3 5 7 10 12 13 15 16 17 19 20 21 23 28 29 31 33 35
I–1
Page 144
Appendix
A–B
J
VBASIC Language Development Kit Programming Conventions and Tips Programming Conventions
The A-B VBASIC Application Library uses a common set of conventions for naming of constants, variables, functions, and subroutines. Upper and lower case are used within names for legibility. Global constants, variables, functions, and subroutines begin with an upper case letter. Global variables and functions end with %, &, !, #, or $ when they are integer, long integer, real, long real, or string. Local variables always begin with a lower case letter. All BASIC keywords and functions are in all UPPER case. Labels are used VERY rarely. GOTO is avoided. WHILE... WEND is not used. ON ERROR, ON TIMER, etc. are not used. Indentation is 2 spaces for any bracketing statements such as FOR .. NEXT, TYPE .. END TYPE, SUB .. END SUB, etc. SELECT statements attempt to indent thelines of each case far enough to allow the case selector to be easily notices. ELSE is required on all SELECT Statements.
J–1
Page 145
Appendix J VBASIC Language Development Kit Programming Conventions and Tips
Programming Tips
Always put a semicolon ( ; ) on the end of PRINT statements when writing to the second line of the display or scrolling will occur. Always check for the semicolon before running the program since they are easy to leave off. Use PC1 and PC2 (in READ.BAS) to print centered strings on the first and second lines of the display. When using Read... and Menu%, with timeouts, make sure to set TIMEOUT% and GLOBALMASK% before each call. While they are not modified by these routines, you may frequently find yourself calling a routine which changes them. An alternate way to use TIMEOUT%, GLOBALMALSK% and GLOBALATTR% is to set them to the most comonly used values at the start of your program. Then, any routine which changes these values should save the prior value and restore it after use. Note: The GLOBALMASK% variable should be assigned a value of 0 for keyboard only READs, 1 for keyboard READs which can timeout in TIMEOUT% 100ths of a second, or a 2 for READs from both the keyboard and bar code scanner with a timeout. If you need your READ to wait for more than 0, 1, or 2 can accomplish, then you must compose GLOBALMASK by (OR)ing together values from: KbdMask, TimeoutMask, BadgeMask, Mask, NetMask, ComMask, AuxMask. Example: GLOBALMASK% = NetMask OR TimeoutMask
So, what’s the common error? Since the read statement returns a value of TimeoutEvent or NetEvent, you might code: GLOBALMASK% = NetEvent OR TimeoutEvent ‘ ! ! ! WRONG ! ! !
The READ.BAS module contains subroutines whose purpose is formatted input from the keyboard. If you enable the Badge Mask and use ReadStr, ReadInt or another read function, the data must be retrieved from InbBuf$ if e = BadgeEvent. See the details of ReadStr for a sample program.
J–2