Quoting Pedro Jaramillo to All:
PJ> Anyone has a tiny terminal program written in PowerBasic v.2.01?
PJ> Please let me know. I have written so many in the past but never saved
ny
PJ> copies. I posted one in this echo a few months ago and now I need it
ck.
rem ** PBCOMM.BAS
rem ** started by Lawrence J. Gordon
rem ** Fidonet POWER_BAS echo project
rem ** Requires TXZM.EXE (TexasZmodem) in path for Zmodem transfers
rem ** Requires ANSI.SYS or equivalent ansi driver
rem ** everything here is hard-coded
rem ** obviously, we want to make the program user configurable
$COM 8192
defint a-z
CALL SETPORTS
on error goto errorroutine
F10$ = chr$(0)+chr$(68) 'exits program
DSR$ = chr$(27)+"`6n" 'checks for ansi escape sequence
PGUP$ = chr$(0)+chr$(73) 'begins upload sequence
PGDN$ = chr$(0)+chr$(81) 'begins download sequence
SO$ = chr$(0)+chr$(31) 'shell to DOS
HANGUP$ = chr$(0)+chr$(35) 'disconnect
buffer$ = space$(4) 'allocate a 4 byte buffer
init$ = "ATH0E1M1" 'initialize modem
color 11,0
cls
locate ,,1
monitor% = freefile
open "CONS:" for output as monitor%
modem% = freefile
open "COM2:38400,N,8,1,DS,CS" for random as #modem%
print #modem%, init$
print "Initializing modem..."
print init$
input "Enter number to call: ",dial$
dial$ = "ATDT" + dial$
print #modem%, dial$
do
a$ = inkey$
if a$ = PGUP$ then
locate 24,1
print chr$(13)+chr$(10)
locate 24,1
line input "File to send: ",a$
mempack
shell "txzm com2 -b14400 -l38400 -h -s " + a$
cls
elseif a$ = PGDN$ then
mempack
shell "txzm com2 -b14400 -l38400 -h -e2 -r "
cls
elseif a$ = HANGUP$ then
print #modem%,"+++ "
delay 1
print #modem%,"ATH1"
elseif a$ = SO$ then
cls
olddir$ = curdir$
olddrive$ = left$(olddir$,1)
mempack
shell
chdrive olddrive$
chdir olddir$
cls
elseif len(a$) then
print #modem%,a$;
end if
if not eof(modem%) then
b% = asc(input$(1,modem%))
buffer$ = right$(buffer$,3)+chr$(b%)
if buffer$ = DSR$ then
print #modem%,chr$(27);
end if
if b% 12 then
print #monitor%, chr$(b%);
else
print #monitor%, chr$(27)+"`2J";
end if
end if
loop until a$ = F10$
close
view text (1,1)-(80,25)
color 7,0
cls
end
errorroutine:
resume next
SUB SETPORTS
def seg=&h40
poke 0,&hf8 '03F8 sets com1 address irq 4
poke 1,&h03
poke 2,&hf8 '02F8 sets com2 address irq 3
poke 3,&h02
poke 4,&he8 '03E8 sets com3 address irq 4
poke 5,&h03
poke 6,&he8 '02E8 sets com4 address irq 3
poke 7,&h02
def seg
END SUB
* WCE 2.1G1/2081 *
--- WILDMAIL!/WC v4.12
---------------
* Origin: Toast House * (314) 994-0312 * (1:100/560.0)
|