ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ DB/C Newsletter ³ ³ February 1993 ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Editor's Notes I was one of 65 hardy souls who braved the 75 degree sunshine in Scottsdale, Arizona to attend the International DATABUS Users Group (IDUG) conference the last week in January. The attendance was lower than hoped for, but the attendees were positively impressed with the demonstrations and the program of speakers. For me, the highlight of the conference was the comraderie of talking with fellow DATABUSers. The audio/video database demo in the Subject, Wills & Company booth was another highlight of the conference. Three machines were connected in a LAN with Ethernet: an Apple Macintosh and two AST 486s. One AST was running Novell Netware 3.11 and the other was running MS-DOS and Windows 3.1. A ComputerEyes/RT SCSI Video Frame Grabber was connected to a video camera and was connected to the Macintosh by a SCSI cable. A standard capture program running on the Macintosh was used to take a snapshot of someone. That picture was then copied to the clipboard. The DB/C Personal Information Database program was then activated and a screen of personal information (e.g. name, hobbies and favorite food) was entered about the person in the picture. The operator then chose Paste from the Modify menu to copy the picture from the clipboard and display it on the same screen with the personal information. The person was then asked to talk into the microphone of the Macintosh to store a greeting that could be played back by clicking on a button. The person's information, picture and greeting was then stored on the NetWare file server. The same application was running on the Windows machine and the information and picture could be displayed on it because the data was shared on the NetWare file server. The most interesting aspects of the demo were these: 1. The entire application was written in DB/C 8.0 2. The same .DBC, stored on the NetWare file server, was running on both the Macintosh and the Windows machine. 3. The same .TXT, .ISI and .TIF files, again on the Netware file server, were used to store the data and picture. The next IDUG conference is tentatively scheduled for March 1994 at (or near) the NASA Space Center outside of Houston, Texas. We will be attending, and hope to see you there. DB/C 8.0 has not yet shipped in final form. A few minor adjustments are being made. We expect to ship it the second week in February (just in time for Valentine's Day). This newsletter will focus on two of the new features of DB/C 8.0. If there are any topics that you want us to discuss in future newsletters, please let me know and we will try to address them. DNW SETENDKEY, GETENDKEY and CLEARENDKEY Traditionally, one of the most powerful features of DATABUS has been the KEYIN verb. Unfortunately, KEYIN has not kept up with the advancement of keyboards over the last few years. Its primary area of deficiency has been in the control and sensing of keys that cause KEYIN to terminate. In traditional DATABUS, the ENTER key and F1 through F5 were the only keys that caused the KEYIN verb to terminate. This could be overridden with *KCON (keyin continuous), but then all keys caused KEYIN to terminate. As more function keys became available, they were added as keys that could be tested with GOTO, but with today's interface needs, the number of named keys has been growing without any end in sight. In DB/C, these keys are now testable with GOTO: F1 through F20, INSERT, DELETE, HOME, END, PAGEUP, PAGEDOWN, UP, DOWN, LEFT, RIGHT, ESC, TAB, BKTAB, and CANCEL. Many users have requested shifted, control and alternate combinations of these and other keys for KEYIN termination. Even worse than the growth of number of keys, the inability to control which specific keys cause the KEYIN to terminate has led to poor user interfaces in most DATABUS and DB/C applications. When a function key is not active, it should be ignored. Unfortunately, this was impossible to do before DB/C 8.0. The SETENDKEY verb allows the programmer to specify exactly which keys will cause a KEYIN to terminate. The CLEARENDKEY verb allows the programmer to specify one, some or all of the function keys to be disallowed as keys that terminate KEYIN. The GETENDKEY verb provides the programmer with a number that corresponds with the key that caused the most recent KEYIN verb to terminate. Each of the ending keys is identified by a number. Here is a list of the currently supported KEYIN ending keys (this list can also be found on page 52 of the DB/C 8.0 Language Reference Manual): 1 through 26 CTRL + A, CTRL + B, ... CTRL + Z 32 through 127 the printable ASCII characters 128 through 255 other ASCII or international use characters 256 through 260 ENTER, ESC, BKSPC, TAB, BKTAB 261 through 270 UP, DOWN, LEFT, RIGHT, INSERT, DELETE, HOME END, PGUP, PGDN 271 through 280 SHIFT + UP, SHIFT + DOWN, ... SHIFT + PGDN 281 through 290 CTRL + UP, SHIFT + DOWN, ... SHIFT + PGDN 291 through 300 ALT + UP, SHIFT + DOWN, ... SHIFT + PGDN 301 through 320 F1, F2, ... F20 321 through 340 SHIFT + F1, SHIFT + F2, ... SHIFT + F20 341 through 360 CTRL + F1, SHIFT + F2, ... SHIFT + F20 361 through 380 ALT + F1, SHIFT + F2, ... SHIFT + F20 381 through 406 ALT + A, ALT + B, ... ALT + Z Here is an example that allows an operator to enter the UP, DOWN, LEFT and RIGHT keys, possibly in combination with SHIFT: WORK1 CHAR 1 KEYNUM NUM 3 CLEARENDKEY 0 SETENDKEY 261, 262, 263, 264, 271, 272, 273, 274 KEYIN WORK1 GETENDKEY KEYNUM SWITCH (KEYNUM) CASE 256 DISPLAY "ENTER" CASE 261 DISPLAY "UP" CASE 262 DISPLAY "DOWN" CASE 263 DISPLAY "LEFT" CASE 264 DISPLAY "RIGHT" CASE 271 DISPLAY "SHIFT+UP" CASE 272 DISPLAY "SHIFT+DOWN" CASE 273 DISPLAY "SHIFT+LEFT" CASE 274 DISPLAY "SHIFT+RIGHT" ENDSWITCH The CLEARENDKEY 0 statement resets the KEYIN ending key list to the default, which is 256 (ENTER) only. The SETENDKEY statements sets the ending keys to UP, DOWN, LEFT, RIGHT, SHIFT+UP, SHIFT+DOWN, SHIFT+LEFT, SHIFT+RIGHT. The GETENDKEY statement stores the numeric value of the key that was pressed into KEYNUM. Everything works fine, but remembering which numbers correspond with which keys is a major inconvenience. Fortunately, EQUATE can be used to give names to the ending key numbers. Here is an example: KEY_ENTER EQUATE 256 KEY_UP EQUATE 261 KEY_DOWN EQUATE 262 KEY_LEFT EQUATE 263 KEY_RIGHT EQUATE 264 SETENDKEY KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT KEYIN KEYNUM SWITCH (KEYNUM) CASE KEY_ENTER DISPLAY "ENTER" CASE KEY_UP DISPLAY "UP" CASE KEY_DOWN DISPLAY "DOWN" CASE KEY_LEFT DISPLAY "LEFT" CASE KEY_RIGHT DISPLAY "RIGHT" ENDSWITCH The include file "EXTVERBS.TXT" that is part of DB/C 8.0 Fast Programming contains KEY_ equates for all of the KEYIN ending keys. FORMAT and *FORMAT One of the most mistrusted and unused verbs in the DATABUS language is the EDIT verb. This lack of use is not unwarranted. Surprises abound when using EDIT to format numeric data for display or printing. In addition, the inability to handle non-US formatting requirements has led to almost complete lack of use of EDIT. DB/C 8.0 includes a new verb, FORMAT, and a new display and print control code, *FORMAT, that attempts to fix all of problems of EDIT. Here is a quick list of its features: 1. Automatic alignment of decimal point in source with mask 2. Programmer-specified currency symbol 3. Programmer-specified replacement for decimal point 4. Programmer-specified blank replacement character 5. The ability to ignore characters from the source 6. The ability to put any character from the mask into the destination 7. Use of parentheses to specify negative value Here are the fourteen FORMAT mask control characters available for use with a numeric variable: Z A digit or blank character is moved from the source to the destination 9 A character is moved unless it is blank, then a zero is moved instead , A comma is moved to the destination unless no digits have been moved, in which case a blank is moved instead ( A ( is moved to destination if source is negative; else a blank is moved ) A ) is moved to destination if source is negative; else a blank is moved - A - is moved to destination if source is negative; else a blank is moved + A + or - is moved to destination if depending on the sign of the source < The character following the < is the new blank replacement character > The character following the > is floated to the left of the next first digit moved $ Equivalent to >$ ^ Defines the position of the decimal point in the destination. The character following the ^ is used in place of a decimal point. . Equivalent to ^. ~ One character from the source is ignored \ The following character is moved to the destination without any other action For example: N NUM 4.2 MOVE "123" TO N DISPLAY *FORMAT="<*$ZZZ,ZZZ.ZZ", N will display "***$123.00" DISPLAY *FORMAT="\$<*ZZZ,ZZZ.ZZ", N will display "$****123.00" DB/C Class Schedule The next DB/C class begins on February 22nd. The class is being expanded from three days to four, so the class dates will be February 22-25. As always, it will be held in the Oak Brook, Illinois office of Subject, Wills & Company. For more information, contact Judi Tamkevic at (708) 572-0240.