DSETWINDOW() Reroutes external functions and programs to a window ------------------------------------------------------------------------------ Syntax DSETWINDOW([<lNewDisplayMode>]) --> lOldDisplayMode Argument <lNewDisplayMode> Designates whether the screen output from external programs or other language UDF's displays in the current window. Returns When called without a parameter, the function returns the current setting for DSETWINDOW(). If a parameter is passed, it returns the previous setting. Description DSETWINDOW() allows you to determine if only CA-Clipper screen outputs should appear in a window, or if all outputs (all external modules and programs, including DOS) should appear. If you would like to implement a subroutine for screen handling with CA-Clipper Tools window functions, you can use this switch to turn off these functions for a short time. Important! Before you call external programs using RUN, you should set DSETWINDOW() to .F.; if you do not, some programs will not run correctly. Notes Important! The standard setting for DSETWINDOW() is on. This means that all program output, not written directly into the screen memory, displays in the currently active window. þ CA-Clipper screen output is always written in a window if one is open and active. Only screen output from external routines (like Assembler or C UDF's, or external programs called using RUN) can be affected. CA-Clipper Tools functions are also viewed as foreign or external. þ If you call DSETWINDOW() with .T., a change in cursor position in an external module or program also affects the cursor position in CA-Clipper. If you do not want to change the cursor position in CA-Clipper, then set DSETWINDOW() to .F. so that the CA-Clipper cursor position remains unchanged. If you still want to pass the cursor position to CA-Clipper, then use the SETRC() function without parameters. þ Some CA-Clipper Tools functions ignore this switch because they work directly with the physical screen memory. þ CA-Clipper Tools has a public variable available for your own Assembler or C routines to affect the DSETWINDOW() function. It can be addressed as follows: EXTR _WINDOW:WORD MOV _WINDOW, 0 // Window functions OFF, all // other values switched ON! þ If the switch is set to on, then interrupt 16 (10h, video) and function 19 (13h, write string), normally only available on AT's, become available on PC XT's. Examples þ Do not reroute other program output to the selected window: DSETWINDOW(.F.) þ Do a test to see if ANSI.SYS has been linked in to CONFIG.SYS: lVar := DSETWINDOW(.F.) ? ISANSI() DSETWINDOW(lVar) // Reset to old status To download this example - click here.
See Also: SCREENFILE() FILESCREEN()