home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Product
/
Product.zip
/
oncmd.zip
/
SERVER.PRG
< prev
next >
Wrap
Text File
|
1996-02-13
|
713b
|
32 lines
*
* SAMPLE ADMINISTRATOR ... receives messages, prints 1st 20 chars
* quits when "q" received
setwin( 17, 5, 10, 35 )
wintitle( 'Server Task' )
clear
admin = 'OI_ADMIN'
i = 0
rc = name_attach( admin, 200, 200 )
if rc <> 0
msgbox("Name Attach", '('+str(rc)+') Could not attach' + admin, 7 )
quit
endif
run /w /n /b client
s=space(80)
do while .t.
rbytes = receive(s)
if left( s, 1 ) = 'q'
reply( 'OK' )
exit
endif
reply( 'OK' )
if i = 0
@0,0 say admin + ' accepting messages.'
endif
@ 2,0 say alltrim(str(i++)) + ' messages received / replied to.'
enddo
? 'Request to terminate received.'
name_detach()
inkey(.1)