Main
   Home
   About
   DiscussionBoard
Files
   About
   Submit
   Search
Downloads
   Action
   QB64
Links
   Link to us
QB45.org
[ Back to QB45 | FAQ | Search a message | Reply to this message | Back to messages ]

gablea on 08/07/11 - 17:11:20

Hi all,

I have a application I have done in Quickbasic / VBDOS screen 11 but when ever i write to the screen it flickers. Is there a way i can stop this?

Thanks

Andy

TopGun on 08/08/11 - 14:18:52

Well the only way I know of is in screen 9 or 7 (maybe more?). Won't work in screen 11...
If it is possible for you to change to screen 9 then
use screen 9,,1,0 command & then use the pcopy 1,0 command when you want the image to display (usually at the end of a loop before clearing the screen)Other solutions I know of would be the DQB graphics library or QB64 because they both offer multiple screen layers. Let me know if this helps :)

gablea on 08/08/11 - 14:20:40

Well the application is text only so changing it should not be to hard

but do you have a any examples as to how I use the pcopy etc?

as I have a fixed background image ( the screen layout) and then the items and prices etc are what change

TopGun on 08/08/11 - 14:31:13

sure I'll write one up right now lol

cls: screen 9, , 1, 0

do
line (30,30)-(60,60),15,bf
PCOPY 1, 0
CLS
loop

Notice it's looping with no delay while clearing the screen everytime & still no flicker. This will also work with text.

TopGun on 08/08/11 - 14:38:17

as for the larger fonts I used to use a sub function to do that, it would print the text and then scan the text using point and redraw it wherever I want at whatever size (just multiply the coordinates) I could right something like that too if you need it

gablea on 08/08/11 - 14:41:40

Well the application is text only so changing it should not be to hard

but do you have a any examples as to how I use the pcopy etc?

as I have a fixed background image ( the screen layout) and then the items and prices etc are what change

gablea on 08/08/11 - 14:43:29

@TopGun

Please if you do not mind a example for the "Change DUe" screen would be fanastasic (and I may even beable to update the salescreen to have larger text :)

SO what your saying I need to swich to Screen 9

can I still get 640x480 in that?

TopGun on 08/08/11 - 15:01:49

No.. screen 9 is 640*350 close though. But it does have 16 colors & u can customize the palette. Plus no flicker. Not sure if this works for u. I also made a sub routine for larger fonts but it may not be what you're looking for, let me know.

DECLARE SUB Sprint (txt$, x!, y!, size!, col!)
CLS: SCREEN 9, , 1, 0

Sprint "Some text!", 100, 100, 3, 12

PCOPY 1, 0
END

SUB Sprint (txt$, x, y, size, col)

LOCATE 1, 1: PRINT txt$
FOR scany = 0 TO 12
FOR scanx = 0 TO 639
IF POINT(scanx, scany) <> 0 THEN
LINE (scanx * size + x, scany * size + y)-(scanx * size + size + x, scany * size + size+ y),col,BF
END IF
NEXT scanx
NEXT scany
LINE (0, 0)-(639, 12), 0, BF

END SUB

gablea on 08/08/11 - 15:07:25

That is the JUST what I had in mind

Now if I could figure out how to intergrate that into my project I would be a happy boy :)

I sent you a e-mail before I saw the update on here topgun.

Do you have VBDOS? as this is what the project is currenlty done in but I WOULD be more then happy to swap to PDS 7.1 (as that is a real development language VBDOS is really for the Forms but seeing I am not using them I may as well swich to PDS)

TopGun on 08/08/11 - 15:11:35

I only really program in qbasic or qb64.. Some basic html that's about it :)

TopGun on 08/08/11 - 15:18:30

oh man, taking a screen shot from dos not so easy lol I usually run my program under dosbox just so I can use printscreen.. If you find a easier way let me know!

gablea on 08/08/11 - 15:24:57

I MUST be really thick today as I can not for the love of it figure out a way to add the font expanding to my project :(

and I still can not understand the pcopy :( I MUST BE REALLY thick (that or I am spoilt with FreeBASIC)

I would use FB BUT it does not work on the graphics card my customers terminal has. (PDS and VBDOS will support it)

gablea on 08/08/11 - 15:30:09

is it possible to mix screen 11 (640*480) and Screen 9? so I can use the New text expander sub function?

TopGun on 08/08/11 - 15:41:42

Well I suppose you could switch to screen 9 when showing the large text but you would have to clear the screen first.. You are using Qbasic right? When you use the pcopy command it basically tells the computer when to display the images or text. without it, it becomes random and that's why you get a flicker. If you download directqb you can include the library and solve the flicker without modifying your program. this could also be an other option, if you're open to libraries.

TopGun on 08/08/11 - 15:44:22

oh and also the font sub will work in screen 11 just remove the pcopy and screen 9 stuff.

TopGun on 08/08/11 - 15:50:08

woops! no it doesn't lol ok I modified the code to work in screen 11, should help a bit. Sorry I never use screen 11 not enough color lol

DECLARE SUB Sprint (txt$, x!, y!, size!)
CLS: SCREEN 11

Sprint "Some text!", 100, 100, 3

SUB Sprint (txt$, x, y, size)

LOCATE 1, 1: PRINT txt$
FOR scany = 0 TO 12
FOR scanx = 0 TO 639
LINE (scanx * size + x, scany * size + y)-(scanx * size + size + x, scany * size + size + y), POINT(scanx, scany), BF
NEXT scanx
NEXT scany
LINE (0, 0)-(639, 12), 0, BF

END SUB

TopGun on 08/08/11 - 15:51:55

sorry the "BF" got cut, just put it back at the end of the line above it...

gablea on 08/08/11 - 18:07:49

I just sent you a e-mail could you have a look and see the attached app (code as a text file)

and I missing something when I add it to my "screen" app it messes with the formatting and everything

Maybe your expert eye can see what I am missing (after all it is 11:10pm for me)

TopGun on 08/08/11 - 18:55:55

Yeah it way my routine causing the problem. It prints the text but then erases anything behind it in the process, just have to use a get/put instead of clearing it with a black box.

TopGun on 08/08/11 - 19:02:15

Anyways it's fixed, sent u an email.

gablea on 08/09/11 - 06:47:47

thank-you your a genuis :)

Now all I need to fogure out is how to possition the
text so it say with in the box.

I was think about using len(TotalDue) beacuse if the totaldue is 5 chrs (£0.00 -£9.99) then I can use the current x location but when it goes to £10.00 - £99.99) that would be 6 so I have to move it left a bit.

BUT Not sure how much so i will have a play about

THANKS once again that is going to come in sooo handy for messages etc on the screen :)

TopGun on 08/09/11 - 08:17:00

Oh ya no problem, you can try calling the sub like this:

Sprint "Some values:" + str$(TotalDue), 100, 100, 3

obviously the 100 values are where the text will be displayed. Does this help?

TopGun on 08/09/11 - 08:17:48

or

Sprint str$(TotalDue), 100, 100, 3

will also work.

TopGun on 08/09/11 - 08:48:44

Hmmm I may not have understood your question.. I would just move it more to the left to make room or have the price on the left hand side... Or try something like this:

if TodalDue > 99.99 then
shft = 10
else
shft = 0
end if

Sprint str$(TotalDue), 100-shft, 100, 3

gablea on 08/09/11 - 14:28:12

Do I need to have the

LOCATE 1, 1: PRINT txt$

as this is being displayed on the screen and it is getting anoying when the app runs on the PoS terminal

TopGun on 08/09/11 - 19:56:09

that's weird... Not sure why you can see it.. You're using the sprint command I made right? You don't have to repeat the other code.. besides that I may have to look at it again to understand what's wrong... The last fix I gave you should erase the txt completely.

TopGun on 08/09/11 - 19:58:43

just make sure the sub routine is at the end of the code and then you should be able to use Sprint where ever & as often as u want.

gablea on 08/10/11 - 08:14:12

yea I am using the code you sent me

even on my really fast machine I can see see the text being display in the left hand conner for a moment and then it disappers

but on the slower machines it appers for a2-3 seconds while the screen is being updated

STILL Not stopped the flickering maybe I need to swap to screen 9 and just change my code.

TopGun on 08/10/11 - 09:27:50

Well if you can switch to screen 9 it should hide the text (even though I'm not sure why you can see it in the first place) because of pcopy. That way the text will have already been hidden before you even tell the program to display the screen (pcopy)
If you want I can modify your code to screen 9, shouldn't take too long unless you've added a bunch since the last download lol

gablea on 08/10/11 - 12:03:19

remeber in screen 11 you stoped unit the pcopy command (as it does not have that support)

I tried to swich to screen 9 but the till software looks REALLLY stilly (all squiched)

I'm am seeing £1.99 and then when it updates the screen then disappers

gablea on 08/10/11 - 16:14:26

if I moved into PDS 7.1 i could use the Future libary (well i would If I had a clue as to how to use it)

Reply to this message
Name:
Message:
Please enter this number:
No HTML allowed. You may use BB-code in your posting.
Members
Login
Register
QB45 Members
Member List