Note: The Caché for Windows 2000 product does not currently support raw Ethernet-based networking (e.g. DDP or LAT). A new packet driver will be available sometime in the future on the InterSystems Web site which will allow these protocols to run.
The new index structure for Unique and PrimaryKey indices is better for three reasons:
Note that if the TYPE of an index is not defined, the default type of INDEX is used. Prior to Caché 3.2.1, KEY was the default TYPE for indices defined as Unique or PrimaryKey.
ON DELETE <ref-action>where ref-action is one of the following:ON UPDATE <ref-action>
The following example uses both referential action clauses:
CREATE TABLE Patient (
PatID VARCHAR(16),
Name VARCHAR(30),
DOB DATE,
Primary_Physician VARCHAR(16) DEFAULT 'A10001982321',
CONSTRAINT Patient_PK PRIMARY KEY (PatID),
CONSTRAINT Patient_Physician_FK FOREIGN KEY
Primary_Physician REFERENCES Physician (PatID)
ON UPDATE CASCADE
ON DELETE SET NULL
)
These referential action clauses can be used anywhere you can define a Foreign Key constraint, such as a CREATE TABLE statement. For details on syntax and usage, see the Caché SQL Reference.
Physical cursor addressing mode is the preferred method of dealing with wide characters such as Japanese and Korean (Hangul). When initializing CHARWIN, you must issue the command:
WRITE /INIT("Cache Terminal Wide Characters")
In addition, make sure that:
Edit->Display Physical Character Setting->Physical
In physical cursor addressing mode, coordinates in /CUP, /WOPEN, etc, represent physical (i.e., narrow) cells. Therefore, it is possible to overwrite just half of a wide character either with a narrow character or part of another wide character. When this happens, the other half of the wide character is turned into a blank.
Note: As part of implementing physical cursor addressing mode, the "Cache Terminal Wide Characters" terminal type was added to ^mtercap.Logical cursor addressing mode can be used only when physical cursor addressing is disabled in the Caché Configuration Manager (i.e., "Physical Cursor Positioning" must be set to No). In addition, you must specify a character pitch with:
WRITE /PITCH(n)
where n is 1.25, 1.5, 1.75 or 2 and specifies how large a wide character is in
relation to a narrow character. To open windows, the background must contain only
narrow characters. Otherwise the window borders will be misaligned.
The pitch is the width of wide characters as compared with normal width characters. Its value can be:
$ZU(86,17,1,value)
where value is one of the above values.
For example, to generate a spool to be printed on a device that outputs Kanji Zenkaku (wide) characters so that they are twice as wide as ASCII characters, you would execute:
Open 2 ; open spooler
Use 2 Set oldpitch=$ZU(96,17,1,8)
; your code goes here
Close 2
When writing code, please keep in mind that something like:
If $X+$L(string)>132 ...
does not work if the characters have different widths.
In Japanese, for instance, there are Zenkaku (wide) and Hankaku (narrow) characters. $Length still returns the number of characters in the string, but $X is updated according to their widths. For example, if Zenkaku characters are twice as wide as the Hankaku ones, outputing a Zenkaku will increase $X by 2. If you are working in such a locale, it is advisable to use $ZWIDTH() in place of $LENGTH(). $ZWIDTH() will return the effective width of the string on the current device. It takes into account the $X/$Y table and the device pitch.
OPEN port:(:::"portstate":baudrate)The portstate parameter modifies the COM port state as follows (byte position is one-based):
USE port:(:::"portstate":baudrate)
| Disconnect | 'D' ' ' |
Disconnect (hang up) the port Do not disconnect the port |
|
| Modem Control | '1' '0' ' ' |
Use modem control Do not use modem control No change to modem control |
|
| Data Bits | '5' '6' '7' '8' ' ' |
5 data bits 6 data bits 7 data bits 8 data bits No change to bit size |
|
| Parity | '0' '1' '2' '3' '4' ' ' |
No parity Odd parity Even parity Mark parity Space parity No change to parity size |
|
| Stop Bits | '1' '5' '2' ' ' |
1 stop bit 1.5 stop bits 2 stop bits No change to stop bit setting |
|
| Flow Control | 'X' 'C' 'D' ' ' |
Use Xon/Xoff flow control Use CTS/RTS flow control Use DSR/DTR flow control No change to flow control |
|
| DTR | '0' '1' ' ' |
Disable DTR (set it off, keep it off) Enable DTR (set it on, keep it on) No change to DTR state |
|
| $ZA Error Reporting | '0' '1' '2' ' ' |
Disable $ZA error reporting (default). Enable $ZA error reporting. No change to $ZA error reporting. |
baudrate is the desired baud rate. The following baud rates are supported (if the hardware permits):
USE port:/COMPARAMS="portstate"The values for portstate and baudrate are the same as above.
USE port:/DISCONNECT
USE port:/BAUD=baudrate
For both syntaxes, the Disconnect parameter performs a hangup on modem-controlled ports by lowering the DTR signal for two seconds and then restoring it. The Disconnect does not close the port. The program can dial out again without reopening the COM device.
The Modem Control parameter determines how Caché responds to the state of the RLSD (received line signal detector) pin, which is also known as DCD (data carrier detect). If the line is modem controlled, the state of RLSD is monitored by Caché and an error is generated if a READ command is issued when carrier is not present. A WRITE command does not receive an error when carrier is not present because it must be possible to send the dial command to the modem prior to a connection being established. Caché Modem control checking can be enabled or disabled at any time. It is suggested you turn modem control off while sending commands to the modem and turn it on once carrier is detected and connection has been established.
The DTR Setting option can be used to control login from an attached modem. If the DTR Setting is configured as 0 (zero), then the DTR control signal will be off, and modems will not communicate with the computer. This will prevent a dial-in connection from occurring. If the DTR setting is configured as 1 (one), then the DTR control signal will be on, and modems will communicate with the computer. In this case, dial-in can occur. If you configure DTR off, then you must programmatically set DTR with the OPEN or USE command to be able to dial out using a connected modem. The DTR setting is probably unimportant when using a null modem cable to connect directly to a terminal device or serial printer because the null modem cable should force the DTR control pin on.
| MS_CTS_ON | $za\4096#2 | CTS set if TRUE. | |
| MS_DSR_ON | $za\8192#2 | DSR set if TRUE. | |
| MS_RING_ON | $za\16384#2 | Ring set if TRUE. | |
| MS_RLSD_ON | $za\32768#2 | Carrier detect set if TRUE. | |
| CACHE_DTR | $za\16777216#4 | Cache requested DTR setting: 0 DTR off 1 DTR on 2 DTR handshaking |
If $ZA error reporting is enabled, Comm port errors will be cleared with a call to the Windows ClearCommError() function. The port error state will be reported as follows:
| CE_BREAK | $za\65536#2 | ||
| CE_FRAME | $za\131072#2 | ||
| CE_IOE | $za\262144#2 | ||
| CE_OVERRUN | $za\524288#2 | ||
| CE_RXPARITY | $za\1048576#2 | ||
| CE_TXFULL | $za\2097152#2 | ||
| TXHOLD | $za\4194304#2 | Set if any of the following fields are true in the error mask returned
by ClearCommError(): fCtsHold FDsrHold FRlsdHold FXoffHold fXoffSent |
If input appears at an unowned COM port or if RLSD becomes active on an unowned, modem controlled, COM port, the COM server logs in a new Caché process with the COM port as its principal I/O device. How the process starts up (programmer or application mode, namespace, routine name) is determined by the settings for that COM port established in the Caché Control Panel in the Security, User Accounts section. The format is similar to the way LAT and TELNET ports are tied to a routine. Creating an entry for COM2: will direct logins on port COM2. Creating an entry for COM: will direct logins on all COM ports for which no specific entry exists.
The format of the COM section of the .cpf file is as follows:
[Com]
Com=ON
COM1:=1801X11;19200
...
COMnn:=1801X11;19200
The Com=[ON/OFF] line determines if the COM server process is created
when the configuration starts up. The COMn:=params;baud
Note that the size of the COM port table is determined by the
ttysiz=n,m
%SYS> d info^COMMCTRL
configured table size = 2
entries in table = 2
ports in table = COM1:,COM2:,
controller PID = 44
ComDemo ;;02:23 PM 16 Feb 2000
COMDEMO ;Demo COM port enhancements.
;
q
;
dial(n,number) ;
;Dial out on a modem.
;Includes debugging information display.
;Presumes your modem is set to echo control strings.
;Usage: s port=$$dial(2,"5551234") ;call 555-1234 on COM2:
;Return value is "COM"_n_":" on success, "" on failure.
u 0 w !,"testing dialout"
s port="COM"_n_":"
o port:(:"S"):10 e u 0 w !,"Could not open port ",port c port q ""
u port:(:"S"::" 0 11":9600) f i=1:1 r x:.2 e q ;discard any pending input.
u 0 w !,"Modem control reset and DTR raised.",!,"Any residual input from previous sessions discarded"
u port d showza(port,$za) ;show modem state.
u 0 w !,"Resetting modem."
u port:(:"S") w "ATZ",*13 r echo:3 e u 0 w !,"no response to ATZ command" c port q ""
r x,x,ok,y,y:1 s t1=$t i ok'="OK" u 0 w !,"OK not received following ATZ" c port q ""
u 0 w " ",ok
u 0 w !,"Dialing: ATDT",number
u port:(:"S") w "ATDT",number,*13 r echo:3 e u 0 w !,"no echo to dial string" c port q ""
r x,x ;get cr/lf
r reply u 0 w " reply from modem: ",reply
i reply'?1"CONNECT".E c port q ""
u 0 w !,"Setting COM port to modem control."
u port:(:"S"::" 1")
s connect=0 f i=1:1:4 d q:connect ;Wait for carrier detect.
.u port:(:"S") s za=$za
.u 0 w !,i,! d showza(port,za)
.i za\32768#2 s connect=1 q
.h 1
.q
i 'connect u 0 w !,"Not connected" c port q ""
q port
;
showza(port,za) ;This formats and displays the value of $ZA (already obtained) for the port.
n (port,za)
u 0 w !,"$za for ",port," is ",za
W !,"Modem Status:"
w !,?5,"CTS = ",za\4096#2
w !,?5,"DSR = ",za\8192#2
w !,?5,"RING = ",za\16384#2
w !,?5,"RLSD = ",za\32768#2
s dtr=za\16777216#4
w !,?5,"DTR = "
w $s(dtr=0:"Off",dtr=1:"On",dtr=2:"DTR Handshaking enabled",1:"Invalid")," (Cache setting)"
i za\65536=0 q
W !,"Error status:"
w !,?5,"BREAK = ",za\65536#2
w !,?5,"FRAME = ",za\131072#2
w !,?5,"IOE = ",za\262144#2
w !,?5,"OVERRUN = ",za\524288#2
w !,?5,"RXPARITY = ",za\1048576#2
w !,?5,"TXFULL = ",za\2097152#2
w !,?5,"TXHOLD = ",za\4194304#2
q
;
;
Table of Contents | Chapter 1 | Chapter 2 | Chapter 4
Top of Page