Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Why do I need a double sync ?

Author
Message
Trev C
23
Years of Service
User Offline
Joined: 18th Feb 2003
Location: United Kingdom
Posted: 28th Apr 2003 13:09
Hi,

Can someone look at this code (source button) and tell me why I need to do two sync statements to get the text to appear?

The screen stays blank if I only have the one sync statement, but if I put in the second it displays what I am expecting.

Any ideas? or is it a bug with DBPro?

cheers,
Trev C
AtomR
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 28th Apr 2003 13:26 Edited at: 28th Apr 2003 13:27
:-s

Here, It doesn't display anyway.

Take care
AtomR
Nilrem
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 28th Apr 2003 13:58
I'm not sure, but I think it's because you have to update the information that's just been (sync on etc) and the information after (printing to the screen etc) so you can put the sync just after the else statement, and leave the other sync where it is, that way if I am correct in what I believe (doubt it) your code is easier to read.

I hear and I forget. I see and I remember. I do and I understand.
Trev C
23
Years of Service
User Offline
Joined: 18th Feb 2003
Location: United Kingdom
Posted: 28th Apr 2003 14:43
AtomR: Now try and delete the REM statement away from the second Sync command and run it again. The text then appears. I'm assuming you left it in, which is why you say it didn't work.

The example shows you what I am talking about, with one sync I get a blank screen, two sync's and you get the text?

Is it not correct that in theory the single Sync should force a screen refresh, hence updating the display to show the new printed text?

I have something similar in my Asteroids clone which I ported from DBC. After the game finishes in DBPro I need to do a double sync to get the 'game over' screen to display correctly.

I suspect this problem is also causing bugs with the main game loop too.

Trev C
roswell
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location: United States
Posted: 28th Apr 2003 16:34
Actually, it looks like you only need the sync once. I ran this code as you have it and it worked just like you said -- the text wouldn't appear without the second sync. However, I took the second sync out and re-ran the code. While I was looking at the blank screen, I reselected your program in windows using Alt-Tab. After re-selecting the program, the text appeared. Why it did this, I have no idea, but that could explain a few things for me as well.

/* You are not expected to understand this. */

Dual Athlon 2.0/1GB RAM/GeForce Ti4200-128/Win2000 Pro
CloseToPerfect
23
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 29th Apr 2003 03:44
Your using patch 4 arn't you? Using patch 3.1 it works fine, for some reason patch 4 screwed up something with print and text commands.

CTP

Easily Confused
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 29th Apr 2003 03:53
Should be corrected in Patch 5, well I hope

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Trev C
23
Years of Service
User Offline
Joined: 18th Feb 2003
Location: United Kingdom
Posted: 29th Apr 2003 13:02
Ah, that explains it all, yet another Patch 4 feature :-s

They'll get it right one day

Trev C

Login to post a reply

Server time is: 2026-07-10 19:46:57
Your offset time is: 2026-07-10 19:46:57