Page 1 of 1

Qbasic & File Saving_First Post

Posted: Fri Mar 11, 2005 1:54 am
by Jedanor
Hi. It has been some time since I did any programming. To get to the point.

First, I have a program written in QuickBasic which controls a peripheral device hooked to the seriel port of my computer. The program is sophisticated yet primitive at the same time. It crashes when I try to save or retrieve a file. I looked at the code and it doesn't appear it has a way to create directories or have any flow control for saving and retrieving files. Does anyone have some simple code for this I can put into this program?

Second, I have been toying with Visual Basic. I'd love to rewrite this program to work in a windows type environment. The code to control the analyzer is simple ASCII commands so I figured it wouldn't matter what kind of driver program was written as long as the seriel connection can be established. Has anyone taken old QuickBasic code and used them in Visual Basic programs?

Third, there seems to be some timing issues when the peripheral dumps seriel data back to the RS232 port. Is there a way I can poll the port to ensure the entire data stream made it back to the computer before the computer sends any extra commands to the peripheral and causes conflicts?

I hope I don't sound like a n00b but I just want to modernize this software and make this peripheral device "usable" again. Any suggestions or comments are welcome. Thanks in advance.

Posted: Sun Mar 13, 2005 11:10 am
by Dr_Davenstein
To get rid of the conflicts, you want to use the WAIT command. Where P is the port id and R is the return value to wait for, WAIT P,R.

Posted: Tue Mar 15, 2005 2:55 am
by Guest
How do I determine the Port ID? Also, the data stream changes each time I poll the data so I am not sure what data I would tell the program to "wait" for. Thanks for your input.