recall network game

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
mechman

recall network game

Post by mechman »

using a null modem cable i want to send
4 variables
need help on all aspects
PQBC...

Post by PQBC... »

Variables being sent and recieved in order:

Code: Select all

'Host Computer--------
OUT (com port address), var1
OUT (com port address), var2
OUT (com port address), var3
OUT (com port address), var4
'End Host Computer-------------
'Recieving Computer----------
While VarsRecieved <> 4
While IN(com port address) = <null>
WEND
SELECT CASE VarsRecieved
Case 0
Var1 = Temp
Case 1
Var2 = Temp
Case 2
Var3 = Temp
Case 3
Var4 = Temp
End Select
VarsRecieved = VarsRecieved + 1
WEND
Replace (com port address) with the com port address (can't remember it)
Replace <null> with the null string (no value being sent) (can't remember this one either)
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

A few suggestions:

&H400 2 bytes, COM1 port number
&H402 2 bytes, COM2 port number
&H404 2 bytes, COM3 port number
&H406 2 bytes, COM4 port number

I'm guessing, but <null> might be "" or chr$(0)

Shouldn't
While IN(com port address) = <null>
be
While INP(com port address) = <null>
*****
MECHMAN

THANKS A SHIT LOAD

Post by MECHMAN »

U GUYS ARE GREAT !!!!
I WILL REMEMBER U WHEN I DO THE CREDITS !!!!!!!!!!!!!!!!!!!
PQBC says 'Howdy!'

Post by PQBC says 'Howdy!' »

moneo wrote:A few suggestions:

&H400 2 bytes, COM1 port number
&H402 2 bytes, COM2 port number
&H404 2 bytes, COM3 port number
&H406 2 bytes, COM4 port number

I'm guessing, but <null> might be "" or chr$(0)

Shouldn't
While IN(com port address) = <null>
be
While INP(com port address) = <null>
*****
1. Replace all of (com port address) with &H400
2. <null> must be an numeric value, (INP is a function that returns a numeric value.) and can not be a string. I believe a COM port gives off a value of either 0 or 63 when it is not recieving anything.
3. Yes, all IN(com port address) should be replaced with INP(com port address)

Also, if you want to send text over a COM port, you can send ASCII values, then have the recieving computer interpret it.
Post Reply