help not a programmer
Posted: Tue Mar 22, 2005 8:10 am
hello
i am trying to demonstrate a simple example of time division multiplexing with 3 equal length text files between 2 serial connected computers
it is not working
here is the code
if anyone can help
CLS
start:
INPUT "Is this computer (t)ransmitting or (r)eceiving data?:", answer$
IF answer$ = "t" THEN
GOTO transmitting
ELSEIF answer$ = "r" THEN
GOTO receiving
ELSE
GOTO start
END IF
transmitting:
CLS
FILES "*.txt"
INPUT "Enter first file name:", file1$
INPUT "Enter second file:", file2$
INPUT "Enter last file:", file3$
OPEN file1$ FOR INPUT AS #1
OPEN file2$ FOR INPUT AS #2
OPEN file3$ FOR INPUT AS #3
OPEN "COM1:9600,N,8,1,ASC,CD0,CS0,DS0,RS" FOR OUTPUT AS #36
ON ERROR GOTO errhandle
PRINT "COM1 opened"
DO WHILE NOT EOF(3)
c$ = INPUT$(1, #1)
d$ = INPUT$(1, #2)
e$ = INPUT$(1, #3)
PRINT #36, c$; d$; e$;
LOOP
CLOSE #1, #2, #3, #36
END
receiving:
CLS
OPEN "1test.txt" FOR OUTPUT AS #5
OPEN "2test.txt" FOR OUTPUT AS #6
OPEN "3test.txt" FOR OUTPUT AS #7
OPEN "COM1:9600,N,8,1,ASC,CD0,CS0,DS0,RS" FOR INPUT AS #36
ON ERROR GOTO errhandle
PRINT "COM1 opened"
DO WHILE NOT EOF(36)
f$ = INPUT$(1, #36)
PRINT #5, f$;
g$ = INPUT$(1, #36)
PRINT #6, g$;
h$ = INPUT$(1, #36)
PRINT #7, h$;
LOOP
CLOSE #36, #5, #6, #7
END
errhandle:
SELECT CASE ERR
CASE 68: PRINT "COM1 is unavailable on this computer.": END
CASE ELSE: END
END SELECT
i am trying to demonstrate a simple example of time division multiplexing with 3 equal length text files between 2 serial connected computers
it is not working
here is the code
if anyone can help
CLS
start:
INPUT "Is this computer (t)ransmitting or (r)eceiving data?:", answer$
IF answer$ = "t" THEN
GOTO transmitting
ELSEIF answer$ = "r" THEN
GOTO receiving
ELSE
GOTO start
END IF
transmitting:
CLS
FILES "*.txt"
INPUT "Enter first file name:", file1$
INPUT "Enter second file:", file2$
INPUT "Enter last file:", file3$
OPEN file1$ FOR INPUT AS #1
OPEN file2$ FOR INPUT AS #2
OPEN file3$ FOR INPUT AS #3
OPEN "COM1:9600,N,8,1,ASC,CD0,CS0,DS0,RS" FOR OUTPUT AS #36
ON ERROR GOTO errhandle
PRINT "COM1 opened"
DO WHILE NOT EOF(3)
c$ = INPUT$(1, #1)
d$ = INPUT$(1, #2)
e$ = INPUT$(1, #3)
PRINT #36, c$; d$; e$;
LOOP
CLOSE #1, #2, #3, #36
END
receiving:
CLS
OPEN "1test.txt" FOR OUTPUT AS #5
OPEN "2test.txt" FOR OUTPUT AS #6
OPEN "3test.txt" FOR OUTPUT AS #7
OPEN "COM1:9600,N,8,1,ASC,CD0,CS0,DS0,RS" FOR INPUT AS #36
ON ERROR GOTO errhandle
PRINT "COM1 opened"
DO WHILE NOT EOF(36)
f$ = INPUT$(1, #36)
PRINT #5, f$;
g$ = INPUT$(1, #36)
PRINT #6, g$;
h$ = INPUT$(1, #36)
PRINT #7, h$;
LOOP
CLOSE #36, #5, #6, #7
END
errhandle:
SELECT CASE ERR
CASE 68: PRINT "COM1 is unavailable on this computer.": END
CASE ELSE: END
END SELECT