VOGONS


First post, by Willie...

User metadata
Rank Newbie
Rank
Newbie

Hello, Forum! This is my first post.

I'm trying to run a GWBASIC program that relies upon the TIME$ and DATE$ variables working. It's running on a P4, 1.5Ghz machine with 768 megs of RAM and Windows XP/SP3. I'm using DOSBOX .74

The BASIC program is communicating via the serial port as desired, so I'm happy with that! The only issue I have is that the TIME$ just keeps incrementing, rather than starting at 00:00:00 at midnight each night. The DATE$ never updates, it holds the date that DOSBOX was started. I've tried exiting BASIC (with the SYSTEM command) to drop to DOS. This doesn't restore the clock/calendar, so it's obviously a bug in DOSBOX.

If I run my program directly in the XP DOS window, the TIME$ and DATE$ work... but the serial port doesn't.

For those who may be curious, it is a data logging program that accepts serial data strings, displaying them on screen in a logical format, and permits saving them as text strings to disk. So obviously, the time & date are important. 😀

Thanks! 😀

Willie...

Reply 1 of 17, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

One of the reasons Dosbox is intended for games only and not for programs that are "mission critical". There is a patch for dosbox that might make it work reliable but you'd need a special build for that...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 17, by Willie...

User metadata
Rank Newbie
Rank
Newbie

Ok... can you point me to a site where I could get that? 😀

I even tried PC-BASIC 3.23, but that didn't work, either. It "times out" when trying to access the COM1 port, just like it does in DOSBOX.

Reply 3 of 17, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Again, Dosbox is not suited for this task.

I don't know whether there is a build with just this patch around, there are builds that have a multitude of patches applied, which might not help in the way you want to use Dosbox

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 9 of 17, by Willie...

User metadata
Rank Newbie
Rank
Newbie

Well.... unfortunately, QB64 doesn't support the important COM(x) port functions that I need! Sigh. 🙁

SO FAR, the issue is either the serial works or the clock works. They are thus far mutually exclusive, due to limitations in the BASIC emulation software I've tried! Sigh.... 🙁

The thought of having to re-write the GWBASIC software in some other, very different language, is DAUNTING!

Reply 10 of 17, by collector

User metadata
Rank l33t
Rank
l33t

A rewrite might be your best solution. How big is the program? I don't know what other languages you know. Here is some advice for converting from GWBasic to VB.NET:

https://social.msdn.microsoft.com/Forums/en-u … rum=Vsexpressvb

But I suspect that it might be quicker to rewrite from scratch.

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 11 of 17, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

And how does SVN of Dosbox cope?

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 12 of 17, by Willie...

User metadata
Rank Newbie
Rank
Newbie

I think I found a solution! With some clever use of loops in a BAT file, I can make the program drop to DOS at midnight, where the looping batch re-launches DOSBOX, thus re-syncing the system clock.

I will leave it running for a few days this way, and see how well it holds up. 😀

Re-writing the code is pretty much out of my realm... so far, I THINK this solution should work.

I will limit my future replies to THIS thread, only. 😀

Reply 13 of 17, by Willie...

User metadata
Rank Newbie
Rank
Newbie

In case anyone is curious... that did the trick! 😀 Even if the clock drifts a few seconds by the end of the day, that's not too serious. The midnight re-sync has been working all week.

The looping BAT files also have the added advantage of re-launching the program, if it's accidentally closed. (Closing the DOSBOX "status" window breaks the loop, which is good.)

Thanks for the suggestions! 😀 The SVN version of DOSBOX also seems to have been an important factor to getting this working properly. 😀

Reply 14 of 17, by Willie...

User metadata
Rank Newbie
Rank
Newbie

Just for the sake of those that have followed this thread, the looping BAT files did, indeed, do the trick. It's been running flawlessly for months, now. 😀 (Not counting the fact that Windows, itself, gets stupid and needs a reboot about once a month.)

Reply 16 of 17, by keenmaster486

User metadata
Rank l33t
Rank
l33t

That's cool that it's working, but your solution seems kind of convoluted... how about using FreeBasic? It supports COM ports. Edit: Just use the #lang "fblite" command at the beginning, and your QB code should run with minimal modifications.

World's foremost 486 enjoyer.

Reply 17 of 17, by Willie...

User metadata
Rank Newbie
Rank
Newbie

Another geek (MUCH more advanced than I!) whipped up a nice little EXE file that syncs the DOS clock to the Windows system clock. It's not NTP, itself, but Windows calls an NTP to sync itself so this utility gets accurate time.

One of the BAT files calls the EXE and exits back to the GWBASIC program. I use that file in another application where I needed to keep the clock in a different BASIC program in sync with Windows. (It has no need of COM ports, so it runs in a Windows DOS box.)

I'm using GWBASIC because the manufacturer created the original logging program in it, and I am fairly familiar with this language, so I just kept with it. 😀

Thanks folks! 😀