On 20 Jun 1998 19:23:50 GMT, "alleycat"
Quote:
>I use QuickBasic Extended Edition 7.0 with windows95.
>My computer's modem uses COM 3 for its modem. Although
>com1 and com2 will open fine with this code, Com3 produces an error.
>open "com3:9600,N,8,1" for output as #1 ---> generates, "Bad FileName"
>print #1, "ATDT phoneno"
>close #1
>Is there any way I could either change my modem's com port or
>modify my code to support Com3?
QB only supports COM1: and COM2: - other COM ports are not supported.
The only way around this is to poke the port address of COM3: to the memory
location of COM1: or COM2:, and then simply open COM1: -- this will now
point to COM3:, and hence you'll open COM3 instead.
However, you better make sure that the COM-port you 'fix' isn't used by
other applications at the same time, or weird things may occur.
View Memory location:
DEF SEG=&H40
PRINT HEX$(PEEK(1)) + HEX$(PEEK(0)): ' COM1:
PRINT HEX$(PEEK(3)) + HEX$(PEEK(2)): ' COM2:
PRINT HEX$(PEEK(5)) + HEX$(PEEK(4)): ' COM3:
PRINT HEX$(PEEK(7)) + HEX$(PEEK(5)): ' COM4:
Now, if you want to open COM3: from QB, all you have to do is PEEK it's
address from the COM3: location shown above, and POKE it into the location
that's occupied by COM1: or COM2:, whichever one you do not use.
--
Marc van den Dikkenberg
-----------------------
The powerbasic Archives
http://www.xs4all.nl/~excel/pb.html