home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
viscobv6.zip
/
vac22os2
/
ibmcobol
/
samples
/
dde
/
ddec.cbv
< prev
next >
Wrap
Text File
|
1998-01-08
|
6KB
|
167 lines
* Feature source code generation begins here...
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "ddedata".
* *******************************************************
* ddedata Method
* --------------
* This feature code method is used to get the
* data that is sent from the server as the
* result of a DDERequest or is sent when a
* hot-link is established with the server.
* This method returns the actual data sent
* by the server.
*
* The method is invoked by the data event for the
* DDE1 part and the returned value is used to
* set the contents of one of the entry fields.
* *******************************************************
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 datafunc.
03 datafunc-Data-Length PIC 9(9) COMP-5.
03 datafunc-Item-Length PIC 9(9) COMP-5.
03 datafunc-Data-String.
05 datafunc-Data-Chars PIC X(255).
03 datafunc-Item-String.
05 datafunc-Item-Chars PIC X(255).
01 p2.
03 p2-Length PIC 9(9) COMP-5.
03 p2-String.
05 p2-Chars PIC X OCCURS 1 TO 255 TIMES DEPENDING ON
p2-Length.
PROCEDURE DIVISION USING datafunc
RETURNING p2.
* Enter your code here..........
MOVE datafunc-Data-Length TO p2-Length
MOVE datafunc-Data-String(1:datafunc-Data-Length) TO
p2-String
GOBACK.
END METHOD "ddedata".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "ddepoke".
* *******************************************************
* ddepoke Method
* --------------
* This feature code method is used to create
* a status message when data is sent to the
* server as the result of a DDEPoke.
*
* This method returns a string that contains
* the poke status, the name of the server item,
* and the actual data sent.
*
* The method is invoked by the pokeAck event for the
* DDE1 part and the returned value is displayed
* in the Status Messages aea.
* *******************************************************
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 stat PIC X(9) USAGE IS DISPLAY.
LINKAGE SECTION.
01 pokefunc.
03 pokefunc-Status PIC 9(9) COMP-5.
88 Poke-UnSuccessful VALUE 0.
88 Poke-Successful VALUE 1.
03 pokefunc-Data-Length PIC 9(9) COMP-5.
03 pokefunc-Item-Length PIC 9(9) COMP-5.
03 pokefunc-Data-String.
05 pokefunc-Data-Chars PIC X(255).
03 pokefunc-Item-String.
05 pokefunc-Item-Chars PIC X(255).
01 p2.
03 p2-Length PIC 9(9) COMP-5.
03 p2-String.
05 p2-Chars PIC X OCCURS 1 TO 255 TIMES DEPENDING ON
p2-Length.
PROCEDURE DIVISION USING pokefunc
RETURNING p2.
* Enter your code here..........
MOVE 255 TO p2-Length
MOVE pokefunc-Status TO stat
* *******************************************************
* Here we create the string containing the
* poke status, the name of the server item,
* and the actual data sent.
* *******************************************************
STRING
"Poke Status: " Delimited by Size
stat Delimited by Spaces
" " Delimited by Size
"Data sent to " Delimited by size
" " Delimited by Size
pokefunc-Item-String(1:pokefunc-Item-Length) Delimited
by Spaces
": " Delimited by Size
pokefunc-Data-String(1:pokefunc-Data-Length) Delimited
by Size
Into p2-String
GOBACK.
END METHOD "ddepoke".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "ddedata1".
* *******************************************************
* ddedata1 Method
* --------------
* This feature code method is used to create
* a status message when data is sent from the
* the server as the result of a DDERequest or
* is sent when a host-link is established with
* with the server.
*
* This method returns the a string that contains
* name of the server item that is involved in the
* DDE communications.
*
* The method is invoked by the data event for the
* DDE1 part and the returned value is displayed
* in the Status Messages area.
* *******************************************************
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 datafunc.
03 datafunc-Data-Length PIC 9(9) COMP-5.
03 datafunc-Item-Length PIC 9(9) COMP-5.
03 datafunc-Data-String.
05 datafunc-Data-Chars PIC X(255).
03 datafunc-Item-String.
05 datafunc-Item-Chars PIC X(255).
01 p2.
03 p2-Length PIC 9(9) COMP-5.
03 p2-String.
05 p2-Chars PIC X OCCURS 1 TO 255 TIMES DEPENDING ON
p2-Length.
PROCEDURE DIVISION USING datafunc
RETURNING p2.
* Enter your code here..........
MOVE 255 TO p2-Length
* *******************************************************
* Here we create the string containing the
* the name of the server item that sent the
* data.
* *******************************************************
STRING
"Data came from " Delimited by size
" " Delimited by Size
datafunc-Item-String(1:datafunc-Item-Length) Delimited
by Size
"." Delimited by Size
Into p2-String
GOBACK.
END METHOD "ddedata1".
* Feature source code generation ends here.