************************************* * * * DB/C Newsletter * * November 1998 * * * ************************************* News and Comments Two notable Java-related events occurred recently. One of these is the decision by the judge in the Sun vs. Microsoft lawsuit to implement an injunction that requires Microsoft to conform to the Java specification set by Sun. The most important part of this is the requirement that Microsoft implement the native executable interface (called JNI). This means that the native libraries for Win32 platforms (.DLLs) that are part of the DB/C JX runtime will run in the Microsoft Java runtime environment. The second notable event is Sun's announcement of direct support of LINUX by Javasoft. This brings to 4 the number of platforms directly supported by Sun: (1) Windows 95/98/NT, (2) Solaris for SPARC, (3) Solaris for Intel, and (4) LINUX for Intel. This is more proof of the importance and legitimacy of LINUX. This month's newsletter addresses several questions that have been asked about DB/C 9.1. It is the start of an FAQ document that will reside in the DB/C area at www.swc.com. If you have any other questions that you think might be interesting to a wider audience, please email them to me. don.wills@swc.com ***************************************************************************** DB/C 9.1 Frequently Asked Questions Question: Why do we get random data corruptions (index and/or data files), spurious runtime errors including I 1751, I 1753 and R 301? The problems occur on local area networks with one or more Windows 95 computers. Answer: Sometime after the initial release of Windows 95, Microsoft started shipping versions of the network client software (redirectors) for both Netware and Microsoft networks that included local (on the client) read/write file caching. Performance improved, sometimes dramatically, but unfortunately DB/C and many other database applications failed miserably. Microsoft acknowledged that they created the problem. The solutions are varied, depending on the environment. For problems with files on Novell Netware servers, the solution is simple - use the Novell client software for Netware instead of the Microsoft client software for Netware. You can get this software (Client v3.01 for Windows 95/98) from the Novell web site. When you install this software, the Microsoft Netware client software is automatically uninstalled. After installation, be sure to set the following properties in the Control Panel: Properties: Advanced Settings: Cached Writes OFF File Cache Level 0 True Commit ON For problems with NT server networks, changes need to be made at the server and possibly to the client. For Windows peer-to-peer networks, the solution is unclear. In Windows 95, there are one or more .DLL files that may need to be replaced with later versions. Microsoft states that the peer-to-peer problems are fixed in Windows 98. We aren't sure what applies in an NT workstation environment. Here are three web links that will get you started: http://support.microsoft.com/support/kb/articles/q148/3/67.asp http://support.microsoft.com/support/kb/articles/q134/6/37.asp http://support.microsoft.com/support/kb/articles/q126/0/26.asp ----------------------------------------------------------------------------- Question: Why do we get an E 506 error executing the SCRNREST verb on some computers but not others? Answer: The size of the character variable required to store the screen information varies depending on the size of the screen and operating system in use. In the past, almost all screen sizes were 80 characters wide by 25 lines. However, in Windows 95/98/NT, the user can set the size of the console to be various larger sizes. DB/C 9.1 senses the larger screen size. When the SCRNSAVE verb is executed and the destination character variable is too small, the OVER flag is set. Unfortunately, most programs ignore that flag. The error doesn't appear until the attempt to refresh the screen is done with SCRNREST. The SCRNSIZE verb was added to provide the programmer with a way to dynamically figure out how large the variable needs to be. Here is some example code: CWORK CHAR @ NWORK INT 6 SCRNSIZE NWORK MAKEVAR ("C" + SQUEEZE CHAR NWORK) TO CWORK SCRNSAVE CWORK ----------------------------------------------------------------------------- Question: How do you pass parameter from the command line into a DB/C program? Answer: Use the CLOCK CMDLINE verb. This provides the entire command line. Your program must parse the parameters out of this line. ----------------------------------------------------------------------------- Question: What is the use of the ISNULL operator? Answer: The ISNULL operator is used to test the null state of character and numeric variables. This new variable state was added for support of SQL. SQL character and numeric values can have the null value. Thus when reading data from an SQL database, the DB/C variables are set to the null state if the source value is null. Likewise, when writing to an SQL database, if the source DB/C variable is null, then the value stored in the database is null. Note that the null state is different from the DB/C character variable value of zero length (the formpointer is zero) and the DB/C numeric variable value 0. You can change the state of a DB/C variable to the null state like this: DIM1 CHAR 1 SETNULL DIM1 . DIM1 is now in the null state You change a variable to the non-null state by modifying it in any way, such as with MOVE or CLEAR: CLEAR DIM1 . DIM1 is now in the non-null state After reading from an SQL table, you can ascertain if a variable is in the null state like this: IF (ISNULL DIM1) DISPLAY "DIM1 is in the null state" ENDIF There is no corresponding verb to accomplish the ISNULL test. ----------------------------------------------------------------------------- Question: Why can't I display a character in the lower right corner of the screen when using DB/C in UNIX? Answer: This problem occurs when using dumb terminals and the termdef capability. See the DB/C Programmer's Reference documentation for tdcmp for a description of termdef. Many dumb terminals roll up one line when a character is displayed in the lower right corner character position. Therefore, by default, DB/C suppresses display of that character. In the termdef file, if you specify the no_roll flag function, the character will be displayed. If your terminal can be switched between roll and no-roll modes with an escape sequence, you should specify the enable_roll and disable_roll terminal control string functions. ----------------------------------------------------------------------------- Question: Why can't I gray out tabs in a GUI panel or dialog? Answer: Microsoft does not provide that capability in the Win32 API. ----------------------------------------------------------------------------- Question: What is the purpose of disable and enable statements? Answer: They provide a way to guarantee that a section of code will complete execution without a trap key or trap timeout interrupting it. In GUI programs, they provide an interlock between the user interface thread and the DB/C execution thread so that you can, for example, disallow a change to the state of a control without having a small window of time when the control is in the wrong state. ----------------------------------------------------------------------------- Question: We have a some programs for which the program source is missing. Is there a de-compiler tool available to recreate the source for these programs from their .DBC files? Answer: There is no DB/C decompiler tool that we are aware of. We have never publicly documented the format of the .DBC file, so I suspect there won't be one. ***************************************************************************** DB/C Class Schedule Class: DB/C DX and JX Language Fundamentals Date: January 1999 (tentative) Location: Oak Brook, Illinois For information, contact Judi Tamkevic at: voice 630.572.0240 email dbc@swc.com ***************************************************************************** Subscribing to the DB/C Newsletter If you don't already have the DB/C Newsletter delivered to your email address and would like to have it emailed to you when it is produced, just send an email message to 'request@swc.com' and put the line 'subscribe dbcnews' in the body of the email message (omit the ' characters). The newsletter will be delivered to the email address from which the message was sent. To stop delivery, put the line 'unsubscribe dbcnews' in the body of the message.