************************************* * * * DB/C Newsletter * * June 1994 * * * ************************************* Editor's Notes We have had several requests for information about what kinds of DB/C applications have been written. We compiled a DB/C Applications Directory about five years ago, but have not updated it since then. We would like to recompile such a directory. Instead of a printed directory, this time the directory will be disseminated via the Internet. To be included in the new directory, please mail or email me the information that you wish to have included. We will make the information available on both the WWW server and the FTP server. On several occasions in the past 6 weeks, I have made a statement that there would not be an MS-DOS 7.0 and that Windows 4.0 (AKA Chicago) would be the only upgrade from MS-DOS 6.x. I espoused this based on information I received at a one-day seminar given by Microsoft. I recently read in one of the trade journals that there will be an MS-DOS 7.0 that is just Chicago without the GUI. I don't know which is correct, but I do know that our plans for DB/C 9.0 are that it WILL NOT run on MS-DOS 6.x or older. We plan to release DB/C 9.0 at about the same time that Microsoft releases Windows 4.0 and/or MS-DOS 7.0. This month's newsletter article isn't informative, it's inquisitive. It's a quiz. I hope you enjoy it. don.wills@swc.com DB/C Quiz Here are some questions that will test your knowledge of DB/C. Answers and explanations are found at the end of this newsletter. 1. What does the following code fragment display: X INT 3 Y FORM 3.3 Z FLOAT 3.3 MOVE "-1" TO X MOVE "8888.8888" TO Y MULT X BY Y IF LESS DISPLAY "YES" ELSE DISPLAY "NO" ENDIF MOVE "-1" TO X MOVE "8888.8888" TO Z MULT X BY Z IF LESS DISPLAY "YES" ELSE DISPLAY "NO" ENDIF 2. What character does the following code fragment display? A INIT "ABCDEFGHIJKLMNOPQRSTUVWXYZ": "abcdefghijklmnopqrstuvwxyz" C INIT "?" RESET A TO A CMOVE A TO C DISPLAY C 3. Using these data definitions, which of the following statements does not set the EOS flag? X INIT "A" Y INIT "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" Z INIT 1 N INT 3 . statement 1 BUMP X . statement 2 BUMP X BY N . statement 3 RESET X TO 2 . statement 4 RESET X TO N . statement 5 RESET Y TO X . statement 6 RESET Y TO Z . statement 7 REP X IN Y . statement 8 REP Y IN X . statement 9 FLAGREST Z 4. What is the value of X after the following code fragment executes? X INT 3 Y INT "9" FOR X FROM 1 TO Y SUB X FROM Y REPEAT 5. Using these definitions for L, C and N, which of the following statements does not compile successfully? L EXTERNAL C CHAR 10 N INT 5 . statement 1 GOTO L FI EQUAL . statement 2 GOTO L IF ZERO . statement 3 SEARCH C, C, N, N . statement 4 MOVE (INT C * 5) TO N . statement 5 MOVE (CHAR N * 5) TO C . statement 6 MOVE (CHAR N + "5") TO C . statement 7 MOVE (N < 1) TO C . statement 8 DISPLAY (C ! 5.2) . statement 9 DISPLAY N, N , . statement 10 DISPLAY *H:N,*V N,C DB/C Class Schedule The next DB/C class is scheduled for June 13th through 16th. The class is held in the Oak Brook, Illinois office of Subject, Wills & Company. For more information, contact Judi Tamkevic at dbc@swc.com or at (708) 572-0240. Answers to the Quiz Answer 1. With DB/C 8.0, the values displayed are: YES YES. However, the first YES is displayed even though the value of Y after execution of the MULT instruction is the positive value 888.889. The DB/C documentation states that the values of the LESS and EQUAL flags are undefined when the OVER flag is set. The second YES is displayed because the value stored in Z is a negative floating point value. Floating point variables can hold very large values, even though the format specified on the FLOAT definition statement is insufficient to display the actual value (in this case 3.3 is too small to display the value -8888.8888). Answer 2. The letter "h" is displayed. When the second operand of the RESET statement is a character variable, the decimal value of the formpointed character value is used to determine the value. In this case, "A" which has a value of 65 is used. 31 is subtracted from this value. The result is 34 and "h" is the 34th character in the variable A. Answer 3. Statements 2, 4, 5, 8 and 9 do not set the EOS flag. Statements 2, 4, 5 and 8 clear the value of the EOS flag. Statement 9 does not affect the value of the EOS flag because the first character of the operand of FLAGREST is Control-A (decimal value 1), not "0" or "1". Answer 4. After execution, the value of X is 4. Answer 5. Statement 5 does not compile because the precedence of CHAR is higher than the precedence of * (multiplication), therefore the left operand of * is not numeric and is a syntax error. Note that in statement 6, the + operator is concatenation, not addition. All other statements are valid DB/C statements. In statement 1, FI starts the comment, therefore this statement is an unconditional GOTO. Likewise in statement 9, the final comma is a comment.