home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
viscobv6.zip
/
vac22os2
/
ibmcobol
/
samples
/
elookup1
/
elk.cbv
< prev
next >
Wrap
Text File
|
1997-08-19
|
11KB
|
293 lines
* Feature source code generation begins here...
* method
IDENTIFICATION DIVISION.
METHOD-ID. "showResults".
DATA DIVISION.
WORKING-STORAGE SECTION.
LOCAL-STORAGE SECTION.
*
* Begin handcoded Message Box parameters
*
01 MsgText.
03 MsgText-Length PIC 9(9) COMP-5.
03 MsgText-String.
05 MsgText-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON MsgText-Length.
01 MsgSeverityIcon PIC 9(9) COMP-5 VALUE 2.
88 MsgSeverityIcon-None VALUE 1.
88 MsgSeverityIcon-Information VALUE 2.
88 MsgSeverityIcon-Query VALUE 3.
88 MsgSeverityIcon-Warning VALUE 4.
88 MsgSeverityIcon-Error VALUE 5.
01 MsgButtons PIC 9(9) COMP-5 VALUE 1.
88 MsgButtons-Ok VALUE 1.
88 MsgButtons-OkCancel VALUE 2.
88 MsgButtons-Cancel VALUE 3.
88 MsgButtons-Enter VALUE 4.
88 MsgButtons-EnterCancel VALUE 5.
88 MsgButtons-RetryCancel VALUE 6.
88 MsgButtons-AbortRetryIgnore VALUE 7.
88 MsgButtons-YesNo VALUE 8.
88 MsgButtons-YesNoCancel VALUE 9.
01 MsgDefaultButton PIC 9(9) COMP-5 VALUE 1.
88 MsgDefaultButton-Button1 VALUE 1.
88 MsgDefaultButton-Button2 VALUE 2.
88 MsgDefaultButton-Button3 VALUE 3.
01 MsgModality PIC 9(9) COMP-5 VALUE 1.
88 MsgModality-Application VALUE 1.
88 MsgModality-System VALUE 2.
01 MsgMoveable PIC 9(9) COMP-5 VALUE 0.
88 MsgMoveable-False VALUE 0.
88 MsgMoveable-True VALUE 1.
01 MsgHelpId PIC 9(9) COMP-5 VALUE 0.
01 MsgResponse PIC 9(9) COMP-5.
88 MsgResponse-OK VALUE 1.
88 MsgResponse-Cancel VALUE 2.
88 MsgResponse-Retry VALUE 4.
88 MsgResponse-Abort VALUE 8.
88 MsgResponse-Ignore VALUE 16.
88 MsgResponse-Yes VALUE 32.
88 MsgResponse-No VALUE 64.
88 MsgResponse-Enter VALUE 128.
*
* End handcoded Message Box parameters
*
*
* Begin hand coding for using a Container
*
01 ContainerRecord USAGE OBJECT REFERENCE.
01 Contents.
03 Contents-Length PIC 9(9) COMP-5.
03 Contents-String.
05 Contents-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Contents-Length.
01 ParentIndex PIC 9(9) COMP-5.
01 RecordIndex PIC 9(9) COMP-5.
*
* End hand coding for using a Container
*
01 VDE-RC PIC S9(9) USAGE COMP-5.
01 Lindex PIC 9(2).
LINKAGE SECTION.
01 DataArea.
COPY 'dataarea.cpy'.
PROCEDURE DIVISION USING DataArea .
* ========================================
*
If CS-Return-Code = 0
Perform varying Lindex from 1 by 1
until Lindex > Results-Knt
*
* Put each column into the data area of THEDATA class
*
Move 15 to Contents-Length
Move cs-Emp-Last-Data(Lindex) to Contents-String
INVOKE thedata1 "setEmpLastn"
USING Contents
Move 12 to Contents-Length
Move cs-Emp-First-Data(Lindex) to Contents-String
INVOKE thedata1 "setEmpFirstn"
USING Contents
Move 1 to Contents-Length
Move cs-Emp-Initial(Lindex) to Contents-String
INVOKE thedata1 "setEmpMidn"
USING Contents
*
* Add the Container record
*
MOVE 0 TO ParentIndex
SET ContainerRecord TO thedata1
INVOKE InterfaceManager "addContainerRecordWithDetails"
USING CContainerControl1 ParentIndex
ContainerRecord
RETURNING RecordIndex
* Retrieve the return code from the previous INVOKE
*
INVOKE InterfaceManager "getErrorCode" USING
CContainerControl1 RETURNING VDE-RC
* Save the key (RecordIndex) of the first entry in
* the list so that a selected record's key can be
* converted to an offset in the results table.
If Lindex = 1 Then
invoke thedata1 "setFirstRecId" USING RecordIndex
End-If
End-perform
Else
If CS-No-Match
Move 33 to MsgText-Length
Move "Too bad, dude ... no match found."
to MsgText-String
Move 2 TO MsgSeverityIcon
Move 1 TO MsgButtons
Move 1 TO MsgDefaultButton
Move 1 TO MsgModality
Move 1 TO MsgMoveable
Move 0 TO MsgHelpId
INVOKE InterfaceManager "showMessage"
USING MSG1 MsgText
MsgSeverityIcon
MsgButtons
MsgDefaultButton
MsgModality
MsgMoveable
MsgHelpId
RETURNING MsgResponse
Else
If CS-DB-Error
Move 42 to MsgText-Length
String "Sorry, database error; SQL code: "
CS-SQL-Code delimited by Size into MsgText-String
Move 5 TO MsgSeverityIcon
Move 1 TO MsgButtons
Move 1 TO MsgDefaultButton
Move 1 TO MsgModality
Move 1 TO MsgMoveable
Move 0 TO MsgHelpId
INVOKE InterfaceManager "showMessage"
USING MSG1 MsgText
MsgSeverityIcon
MsgButtons
MsgDefaultButton
MsgModality
MsgMoveable
MsgHelpId
RETURNING MsgResponse
Else
Move 32 to MsgText-Length
Move "Bad news .... unexpected error."
to MsgText-String
Move 5 TO MsgSeverityIcon
Move 1 TO MsgButtons
Move 1 TO MsgDefaultButton
Move 1 TO MsgModality
Move 1 TO MsgMoveable
Move 0 TO MsgHelpId
INVOKE InterfaceManager "showMessage"
USING MSG1 MsgText
MsgSeverityIcon
MsgButtons
MsgDefaultButton
MsgModality
MsgMoveable
MsgHelpId
RETURNING MsgResponse
End-if
End-if
End-If
GOBACK.
END METHOD "showResults".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getdetails".
DATA DIVISION.
WORKING-STORAGE SECTION.
*
01 ContainerRecord USAGE OBJECT REFERENCE.
01 VDE-RC PIC S9(9) USAGE COMP-5.
01 RecordIndex PIC 9(9) COMP-5.
*
* Begin handcoded Message Box parameters
*
01 MsgText.
03 MsgText-Length PIC 9(9) COMP-5.
03 MsgText-String.
05 MsgText-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON MsgText-Length.
01 MsgSeverityIcon PIC 9(9) COMP-5 VALUE 2.
88 MsgSeverityIcon-None VALUE 1.
88 MsgSeverityIcon-Information VALUE 2.
88 MsgSeverityIcon-Query VALUE 3.
88 MsgSeverityIcon-Warning VALUE 4.
88 MsgSeverityIcon-Error VALUE 5.
01 MsgButtons PIC 9(9) COMP-5 VALUE 1.
88 MsgButtons-Ok VALUE 1.
88 MsgButtons-OkCancel VALUE 2.
88 MsgButtons-Cancel VALUE 3.
88 MsgButtons-Enter VALUE 4.
88 MsgButtons-EnterCancel VALUE 5.
88 MsgButtons-RetryCancel VALUE 6.
88 MsgButtons-AbortRetryIgnore VALUE 7.
88 MsgButtons-YesNo VALUE 8.
88 MsgButtons-YesNoCancel VALUE 9.
01 MsgDefaultButton PIC 9(9) COMP-5 VALUE 1.
88 MsgDefaultButton-Button1 VALUE 1.
88 MsgDefaultButton-Button2 VALUE 2.
88 MsgDefaultButton-Button3 VALUE 3.
01 MsgModality PIC 9(9) COMP-5 VALUE 1.
88 MsgModality-Application VALUE 1.
88 MsgModality-System VALUE 2.
01 MsgMoveable PIC 9(9) COMP-5 VALUE 0.
88 MsgMoveable-False VALUE 0.
88 MsgMoveable-True VALUE 1.
01 MsgHelpId PIC 9(9) COMP-5 VALUE 0.
01 MsgResponse PIC 9(9) COMP-5.
88 MsgResponse-OK VALUE 1.
88 MsgResponse-Cancel VALUE 2.
88 MsgResponse-Retry VALUE 4.
88 MsgResponse-Abort VALUE 8.
88 MsgResponse-Ignore VALUE 16.
88 MsgResponse-Yes VALUE 32.
88 MsgResponse-No VALUE 64.
88 MsgResponse-Enter VALUE 128.
*
* End handcoded Message Box parameters
*
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
PROCEDURE DIVISION .
*
* Get the key (RecordIndex) of the selected record
*
SET ContainerRecord TO thedata1
INVOKE InterfaceManager "getFirstSelected"
USING CContainerControl1
RETURNING RecordIndex
* Retrieve the return code from previous INVOKE
Move 0 to VDE-RC
INVOKE InterfaceManager "getErrorCode" USING
CContainerControl1 RETURNING VDE-RC
If VDE-RC not equal 0 Then
Move 25 to MsgText-Length
Move "No employee was selected!" to MsgText-String
Move 5 TO MsgSeverityIcon
Move 1 TO MsgButtons
Move 1 TO MsgDefaultButton
Move 1 TO MsgModality
Move 1 TO MsgMoveable
Move 0 TO MsgHelpId
INVOKE InterfaceManager "showMessage" USING MSG1 MsgText
MsgSeverityIcon
MsgButtons
MsgDefaultButton
MsgModality
MsgMoveable
MsgHelpId
RETURNING MsgResponse
Else
* Process the key of the selected container record
*
Invoke thedata1 "setProcessIDX" USING RecordIndex
End-if
GOBACK.
END METHOD "getdetails".
* Feature source code generation ends here.