[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

OpenVMS/Hanzi RTL Chinese Screen Management (SMG$) Manual


Previous Contents


SMG$REPLACE_INPUT_LINE

The Replace Input Line routine replaces the specified lines in the recall buffer with the specified string.

Format

SMG$REPLACE_INPUT_LINE keyboard-id [,replace-string] [,line-count] [,flags] [,character-set]


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

keyboard-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Keyboard identifier. The keyboard-id argument is the address of an unsigned longword containing the identifier of the virtual keyboard from which to read.

You create a virtual keyboard by calling the SMG$CREATE_VIRTUAL_KEYBOARD routine.

replace-string


OpenVMS usage char_string
type character string
access read only
mechanism by descriptor

String that contains the line to be entered into the recall buffer. The replace-string argument is the address of a descriptor pointing to this string. The default is a null string, which removes the last line entered.

line-count


OpenVMS usage byte_unsigned
type byte (unsigned)
access read only
mechanism by reference

Number of lines to be replaced. The line-count argument is the address of an unsigned byte containing the number of lines to be replaced with replace-string. The default value for the line-count argument is 1 (the last line entered).

flags


OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by reference

Specifies optional behavior. The flags argument is the address of an unsigned longword that contains the flag. Valid values are as follows:
SMG$M_KEEP_CONTENTS The string specified by replace-string replaces the existing string specified by line-count. By using this flag in a loop, the line recall buffer can be preloaded with information by the application.

character-set


OpenVMS usage longword_unsigned
type longword (unsigned)
access read only
mechanism by reference

Character set specifier. The optional character-set argument is the address of an unsigned longword that specifies the character set for the replace-string. If this argument is omitted, the default character set value is UNKNOWN.
Value Character Set
SMG$C_ASCII ASCII
SMG$C_SPEC_GRAPHICS DEC Special Graphics
SMG$C_HANZI DEC Hanzi

1One of DEC supplemental character set and Latin-1 character set.


Description

SMG$REPLACE_INPUT_LINE replaces the requested lines in the recall buffer with the specified string. The remaining (line-count--1) lines are deleted. This routine is intended to aid in processing line continuations.

Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_INVKBD_ID Invalid keyboard-id.
SMG$_WRONUMARG Wrong number of arguments.
LIB$_INSVIRMEM Insufficient virtual memory.

Example


!+
! This FORTRAN example uses the routine
! SMG$REPLACE_INPUT_LINE to concatenate
! the last 2 lines in the recall buffer.
!-

        IMPLICIT INTEGER (A-Z)
        INCLUDE '($SMGDEF)'
        INCLUDE '($SMGMSG)'
        CHARACTER*20 TEXT, TEXT1

        WRITE (5,*) 'Enter number of lines to save.'
        READ  (5,*) R

        S = SMG$CREATE_PASTEBOARD(PBID)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$CREATE_VIRTUAL_DISPLAY(22,70,DID,SMG$M_BORDER)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$CREATE_VIRTUAL_KEYBOARD(KBID,,,,R)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$PUT_LINE(DID,'Enter lines of text:')
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$PASTE_VIRTUAL_DISPLAY(DID,PBID,2,2)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))

!+
! Read in lines of text.
!-
        DO 10 I = 1,R
            S = SMG$READ_COMPOSED_LINE(KBID,,TEXT,'Example>',,DID)
            IF (.NOT. S) CALL LIB$STOP(%VAL(S))
  10    CONTINUE

!+
! Recall last 2 lines in the buffer.
!-

        S = SMG$RETURN_INPUT_LINE(KBID,TEXT,,1,LEN)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$RETURN_INPUT_LINE(KBID,TEXT1,,2,LEN1)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        TEXT(LEN:20) = TEXT1(1:LEN1)

!+
! Concatenate them and replace the last 2
! lines in the buffer with the new line.
!-

        S = SMG$REPLACE_INPUT_LINE(KBID,TEXT,2)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))

!+
! Recall the last line which is now the
! concatenated line.
!-

        S = SMG$RETURN_INPUT_LINE(KBID,TEXT,,1)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))

        S = SMG$PUT_LINE(DID,'**** The last line of text is:')
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$PUT_LINE(DID,TEXT)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))

        END

      

One sample of the output generated by this FORTRAN program is as follows:


$ RUN REPLACE
Enter number of lines to save.
  3
Enter lines of text:
Example> PASTEBOARD
Example> DISPLAY
Example> KEYBOARD
****The last line of text is:
KEYBOARDDISPLAY

SMG$RESTORE_PHYSICAL_SCREEN

The Restore Physical Pasteboard routine rewrites the pasteboard image as it was at the time the SMG$SAVE_PHYSICAL_SCREEN routine was called.

Format

SMG$RESTORE_PHYSICAL_SCREEN pasteboard-id ,display-id


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

pasteboard-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the pasteboard to be restored. The pasteboard-id argument is the address of an unsigned longword that contains the pasteboard identifier.

Pasteboard-id is returned by the SMG$CREATE_PASTEBOARD routine.

display-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the virtual display created by the SMG$SAVE_PHYSICAL_SCREEN routine. The display-id argument is the address of an unsigned longword that contains this display identifier.

Description

SMG$RESTORE_PHYSICAL_SCREEN reproduces the pasteboard image saved by the SMG$SAVE_PHYSICAL_SCREEN routine. You must pass the display-id returned by the SMG$SAVE_PHYSICAL_SCREEN routine to the SMG$RESTORE_PHYSICAL_SCREEN routine. Note that when performing multiple calls to SMG$SAVE_PHYSICAL_SCREEN and SMG$RESTORE_PHYSICAL_SCREEN, the calls must be performed in a nested fashion; that is, the last pasteboard saved must be the first one restored.

Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_INVDIS_ID Invalid display-id.
SMG$_INVPAS_ID Invalid pasteboard-id.

SMG$RETURN_CURSOR_POS

The Return Cursor Position routine returns the current virtual cursor position in a specified virtual display.

Format

SMG$RETURN_CURSOR_POS display-id ,start-row ,start-column


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

display-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the virtual display whose current virtual cursor position you are requesting. The display-id argument is the address of an unsigned longword that contains the display identifier.

Display-id is returned by SMG$CREATE_VIRTUAL_DISPLAY.

start-row


OpenVMS usage longword_signed
type longword (signed)
access write only
mechanism by reference

Receives the virtual cursor's current row position within the specified virtual display. The start-row argument is the address of a signed longword into which is written the current row position.

start-column


OpenVMS usage longword_signed
type longword (signed)
access write only
mechanism by reference

Receives the virtual cursor's current column position within the specified virtual display. The start-column argument is the address of a signed longword into which is written the current column position.

Description

SMG$RETURN_CURSOR_POS returns the virtual cursor's current row and column positions in a specified virtual display.

Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_INVDIS_ID Invalid display-id.
SMG$_WRONUMARG Wrong number of arguments.

SMG$RETURN_INPUT_LINE

The Return Input Line routine returns to the caller the requested line from the recall buffer. This line is retrieved either by matching it with a specified string or by specifying the appropriate line number.

Format

SMG$RETURN_INPUT_LINE keyboard-id ,resultant-string [,match-string] [,byte-integer-line-number] [,resultant-length] [,character-set]


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

keyboard-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Keyboard identifier. The keyboard-id argument is the address of an unsigned longword containing the identifier of the virtual keyboard from which to read.

The virtual keyboard is created by calling the SMG$CREATE_VIRTUAL_KEYBOARD routine.

resultant-string


OpenVMS usage char_string
type character string
access write only
mechanism by descriptor

String into which is written the complete recalled line. The resultant-string argument is the address of a descriptor pointing to this string.

match-string


OpenVMS usage char_string
type character string
access read only
mechanism by descriptor

Match string to be used when searching for the line to be recalled. The optional match-string argument is the address of a descriptor pointing to this match string. The search begins with the last line typed.

byte-integer-line-number


OpenVMS usage byte_unsigned
type byte (unsigned)
access read only
mechanism by reference

Line number to be used when searching for the line to be recalled. The optional byte-integer-line-number argument is the address of an unsigned byte containing the number of the line to be recalled. The last line typed is line number 1.

resultant-length


OpenVMS usage word_unsigned
type word (unsigned)
access write only
mechanism by reference

Length of the resultant-string string. The optional resultant-length argument is the address of an unsigned word containing either the number of characters read or the maximum length of resultant-string, whichever is less.

character-set


OpenVMS usage longword_unsigned
type longword (unsigned)
access write only
mechanism by reference

Receives the default character set for the requested line from the recall buffer. The optional character-set argument is the address of an unsigned longword that specifies the character set. If the character set is undefined, receives SMG$C_UNKNOWN.
Value Character Set
SMG$C_ASCII ASCII
SMG$C_SPEC_GRAPHICS DEC Special Graphics
SMG$C_HANZI DEC Hanzi
SMG$C_UNKNOWN Unknown character set

1One of DEC supplemental character set and Latin-1 character set.


Description

SMG$RETURN_INPUT_LINE returns to the caller the specified line in the recall buffer. This routine is intended to aid in the implementation of a DCL-style "RECALL" command.

If you specify the match-string argument, SMG$RETURN_INPUT_LINE searches for and returns the line that matches the specified string. If you specify the byte-integer-line-number argument, SMG$RETURN_INPUT_LINE returns the line that corresponds to the specified line number. If you specify both match-string and byte-integer-line-number, SMG$_INVARG is returned. If you specify match-string and a match is not made, SMG$_LINNOTFND is returned.


Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_INVARG Invalid argument.
SMG$_INVKBD_ID Invalid keyboard-id.
SMG$_LINNOTFND Matching line was not found.
SMG$_WRONUMARG Wrong number of arguments.
LIB$_xxx Any error from LIB$COPY_R_DX.

Example


!+
! This FORTRAN example uses the routine
! SMG$RETURN_INPUT_LINE to implement a
! RECALL/ALL command.
!-

        IMPLICIT INTEGER (A-Z)
        INCLUDE '($SMGDEF)'
        INCLUDE '($SMGMSG)'
        CHARACTER*20 TEXT

        WRITE (5,*) 'Enter number of lines to save.'
        READ  (5,*) R

        S = SMG$CREATE_PASTEBOARD(PBID)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$CREATE_VIRTUAL_DISPLAY(22,70,DID,SMG$M_BORDER)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$CREATE_VIRTUAL_KEYBOARD(KBID,,,,R)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$PUT_LINE(DID,'Enter lines of text:')
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$PASTE_VIRTUAL_DISPLAY(DID,PBID,2,2)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))

!+
! Read in lines of text.
!-
        DO 10 I = 1,R
            S = SMG$READ_COMPOSED_LINE(KBID,,TEXT,'Example>',,DID)
            IF (.NOT. S) CALL LIB$STOP(%VAL(S))
  10    CONTINUE

        S = SMG$PUT_LINE(DID,'**** The lines of text are:')
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
!+
! Recall all lines in the buffer.
!-
        DO 30 N = 1,R
            S = SMG$RETURN_INPUT_LINE(KBID,TEXT,,N)
            IF (.NOT. S) CALL LIB$STOP(%VAL(S))
            S = SMG$PUT_LINE(DID,TEXT)
            IF (.NOT. S) CALL LIB$STOP(%VAL(S))
  30    CONTINUE

!+
! Recall the line containing 'fox'
!-
        S = SMG$PUT_LINE(DID,'**** The line containing "fox" is:',2)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))
        S = SMG$RETURN_INPUT_LINE(KBID,TEXT,'FOX')
        IF (S .EQ. SMG$_LINNOTFND) TEXT = 'None found!'
        S = SMG$PUT_LINE(DID,TEXT)
        IF (.NOT. S) CALL LIB$STOP(%VAL(S))

        END

      

One sample of the output generated by this FORTRAN program is as follows:


$ RUN RETURN
Enter number of lines to save.
  3
Enter lines of text:
Example> PASTEBOARD
Example> DISPLAY
Example> KEYBOARD
****The lines of text are:
KEYBOARD
DISPLAY
PASTEBOARD
****The line containing "fox" is:

None found!


Previous Next Contents