BBS: Inland Empire Archive Date: 04-12-93 (18:20) Number: 361 From: SEAN SULLIVAN Refer#: NONE To: ROBERT SCHOENFELD Recvd: NO Subj: Dial.bas 1/3 Conf: (2) Quik_Bas
Greetings and Salutations Robert!
This is the accompanying basic code for the COM3-COM4 Article in QBNEWS 2/4
______O_/_________________| SNIP |________________\_O_____
O \ | HERE | / O
'This file created by PostIt! v5.0 for VB/DOS
'>>> Start of page 1 of DIAL.BAS
' DIAL BAS : Dial a phone number on the screen
' author .....: Dick Dennison [74270,3636] 1:272/34 914-374-3903 *hst
' 24 hrs
' supports ...: COM1 - COM4
' syntax .....: DIAL portnum%
' includes ...: None
' notes ......: Move the cursor with the arrow keys to the phone number
' : Press the ']' key and move the right arrow key across
' : the number and press Enter
' : Uses Basic's OPEN COMx commands
' cost .......: Free = Credit where credit due
' : Do not use as is for commercial use - may not be resold
' : May not be rebundled without prior written consent
' dated ......: 10/19/91
' credits ....: Thanks to Mike Welch for CLIPMSG, and Pete Petrakis for
' his
' : notes on Com Port swapping.
DECLARE SUB Hangup (Port%)
DECLARE SUB Getnum (row%, Col%, markit%, Port%)
DECLARE SUB Setup (Port%)
COLOR 0, 7
LOCATE 25, 1
PRINT " Move the cursor to the beginning of the phone number and"+ _
" press Space ";
LOCATE 10, 1
IF VAL(COMMAND$) < 1 OR VAL(COMMAND$) > 4 THEN 'Get the portnum%
PRINT "Port number must be on command line"
END
ELSE Port% = VAL(COMMAND$)
END IF
'Setup some special key functions
CR$ = CHR$(13)
Nul$ = CHR$(0)
ArrowLt$ = Nul$ + CHR$(75)
ArrowRt$ = Nul$ + CHR$(77)
ArrowUp$ = Nul$ + CHR$(72)
ArrowDn$ = Nul$ + CHR$(80)
EndKey$ = Nul$ + CHR$(79)
Esc$ = CHR$(27)
Home$ = Nul$ + CHR$(71)
SpaceBar$ = CHR$(32)
'Save vectors at bios Addresses for Com1-Com2
OldPort1H = PEEK(&H400)
OldPort1L = PEEK(&H401)
OldPort2H = PEEK(&H402)
OldPort2L = PEEK(&H403)
'Move cursor around
'==================================================================
DO 'This section lets the user move
In$ = INKEY$ 'move the cursor around on the screen
SELECT CASE In$ 'to the beginning of the phone number
CASE CR$
IF markit% THEN 'A CR signals the end of the highlight
row% = CSRLIN
Col% = POS(0) - count%
EXIT DO
END IF
CASE Esc$ 'END
END
CASE Home$ 'Goto the beginning of the line
LOCATE , 1
CASE EndKey$ 'Goto the end of the line
LOCATE , 80
CASE ArrowUp$ 'UpArrow
x% = CSRLIN
IF x% > 1 THEN LOCATE x% - 1
CASE ArrowDn$ 'DownArrow
x% = CSRLIN
IF x% < 25 THEN LOCATE x% + 1
CASE ArrowLt$ 'LeftArrow
IF POS(0) > 1 THEN LOCATE , POS(0) - 1
IF markit% THEN count% = count% - 1 'If markit% then ' ' was
' pressed
CASE ArrowRt$ 'RightArrow
IF markit% THEN
count% = count% + 1 'If markit% then ' ' was
' pressed
row% = CSRLIN: Col% = POS(0)
a% = SCREEN(row%, Col%)
PRINT CHR$(a%);
ELSE
IF POS(0) < 80 THEN LOCATE , POS(0) + 1
END IF
CASE SpaceBar$
IF markit% THEN
count% = count% + 1 'If markit% then ' ' was
' pressed
row% = CSRLIN: Col% = POS(0)
a% = SCREEN(row%, Col%)
'>>> Continued on page 2.
Sean
--- GoldED 2.40.P0623
* Origin: COMNET Point #28 [Watervliet, NY] (1:267/113.28)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET