|
≫ |
|
|
|
日本語 OpenVMS
日本語 OpenVMS
日本語画面管理ライブラリ 利用者の手引き
第 7 章 日本語 SMG ルーチンの呼び出しの例
この章では,VMS Calling Standard に準拠したおもな言語で SMG$READ_KEYSTROKE ルーチンを呼び出す方法を示します。他の日本語 SMG ルーチン (たとえば,SMG$CREATE_VIRTUAL_DISPLAY,SMG$CREATE_PASTEBOARD, SMG$CREATE_VIRTUAL_KEYBOARD,SMG$PASTE_VIRTUAL_DISPLAY, SMG$PUT_LINE ) もこれらの例の中で使用しています。
例 7-1 の FORTRAN プログラムでは,SMG$READ_KEYSTROKE ルーチンの他,SMG$CREATE_VIRTUAL_DISPLAY,SMG$CREATE_PASTEBOARD,SMG$PASTE_VIRTUAL_DISPLAY, SMG$CREATE_VIRTUAL_KEYBOARD,SMG$PUT_LINE ルーチンも使用しています。
C+
C This routine creates a virtual display and writes ti to the PASTEBOARD.
C Data is placed in the virtual display using the routine SMG$PUT_CHARS.
C Include the SMG definitions. In particular, we want SMG$M_BORDER,
C-
INCLUDE '($SMGDEF)'
INTEGER SMG$CREATE_VIRTUAL_DISPLAY, SMG$CREATE_PASTEBOARD
INTEGER SMG$PASTE_VIRTUAL_DISPLAY,
1 SMG$CREATE_VIRTUAL_KEYBOARD
INTEGER SMG$READ_KEYSTROKE, SMG$PUT_LINE
INTEGER DISPLAY1, PASTE1, KEYBOARD1, ROWS, COLUMNS,
1 TERM_CHAR
CHARACTER*3 TEXT
CHARACTER*27 TEXT_OUTPUT
C+
C Create the virtual display with a border.
C-
ROWS = 7
COLUMNS = 60
ISTATUS = SMG$CREATE_VIRTUAL_DISPLAY
1 (ROWS, COLUMNS, DISPLAY1, SMG$M_BORDER)
C+
C Create the pasteboard.
C-
ISTATUS = SMG$CREATE_PASTEBOARD (PASTE1)
C+
C Create a virtual keyboard
C-
ISTATUS = SMG$CREATE_VIRTUAL_KEYBOARD (KEYBOARD1)
C+
C Paste the virtual display at row 3, column 9.
C-
ISTATUS = SMG$PASTE_VIRTUAL_DISPLAY ( DISPLAY1, PASTE1, 3, 9)
ISTATUS = SMG$PUT_LINE (DISPLAY1,
1 'Enter the character K after the >> prompt.')
ISTATUS = SMG$PUT_LINE (DISPLAY1,
1 'This character will not be echoed as you type it.')
ISTATUS = SMG$PUT_LINE (DISPLAY1,
1 'The terminal character equivalent of K is displayed.')
ISTATUS = SMG$PUT_LINE (DISPLAY1, ' ')
C+
C Read a keystroke from the virtual pasteboard.
C-
ISTATUS = SMG$READ_KEYSTROKE ( KEYBOARD1, TERM_CHAR, '>>', ,
1 DISPLAY1)
ISTATUS = SMG$PUT_LINE (DISPLAY1, ' ')
C+
C Convert the decimal value of TERM_CHAR to a decimal ASCII text string.
C-
ISTATUS = OTS$CVT_L_TI( TERM_CHAR, TEXT)
TEXT_OUTPUT = ' TERMINAL CHARACTER IS: ' // TEXT
C+
C Print the decimal ASCII text string.
C-
ISTATUS = SMG$PUT_LINE (DISPLAY1, TEXT_OUTPUT)
ISTATUS = SMG$PUT_CHARS (DISPLAY1, TEXT, 7, 25)
END
|
|