QB64 TCP/IP Networking Tutorials?

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
User avatar
bongomeno
Veteran
Posts: 266
Joined: Wed Dec 10, 2008 9:08 am
Location: Arizona
Contact:

QB64 TCP/IP Networking Tutorials?

Post by bongomeno »

I just noticed the TCP/IP networking abilities of QB64 and would like to learn how to use them. The QB64 forum seems to be down. Does anyone know of good example software or tutorials for this? I want to rewrite my BBS in it as well as an online RPG. I will probably end up trying many things.
albertstien3329
Newbie
Posts: 1
Joined: Wed Dec 26, 2012 5:45 am

Post by albertstien3329 »

I get a bad file mode error on the WRITE #1, SalesNum, SalesmanNam$, SalesAmt, CommRt, CommissionAm line


what should I do?

My Code

' This program reads a sequential file
'
'
'
'
' SalesNum = Salesman Number
' SalesmanNam$ = Salesman Name
' SalesAmt = Sales Amount
' CommRt = Commission Rate
' CommissionAm = Commission Amount
'
' *******************************************
' Program mainline
' *******************************************
CLS
GOSUB CreateFile
GOSUB LoadFile
GOSUB CloseFile
END

' ******************* Create The File ***************

CreateFile:
OPEN "SALEDATA" FOR INPUT AS #1
RETURN

' ************ Print The Report ***************

PrintReport:
INPUT #1, SalesNum, Nam$, SaleAmt, CommRt
DO UNTIL SalesNum = 0
LET Comm = SaleAmt * (CommRt / 100)
PRINT USING D$; SalesNum; Nam$; SaleAmt; CommRt; Comm
INPUT #1, SalesNum, Nam$, SaleAmt, CommRt
LOOP
RETURN

LoadFile:
DO UNTIL UCASE$(SalesmanNam$) = "END"
INPUT "Salesman Number", SalesNum
INPUT "Salesman Name", SalesmanNam$
INPUT "Sales Amount", SalesAmt
INPUT "Commission Rate", CommRt
INPUT "Commission Amount", CommissionAm
PRINT
WRITE #1, SalesNum, SalesmanNam$, SalesAmt, CommRt, CommissionAm
LOOP
RETURN
'****************************************************************************
' Close File
'****************************************************************************

CloseFile:
CLOSE #1
RETURN
jimmy
Post Reply