QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Petr on July 15, 2018, 05:56:53 am
-
soultion is bigger _newimage in begin. Is this known bug, if this is bug?
next bug:
program print nothing - but resolution is enough:
-
I found, in first souce do it PRINT, with newimage 20x20 program starts, but as show second source, A is not printed.
-
SLEEP 'hit a key twice to close window
-
Hi Bplus. Yes, but try use it in SCREEN 0. For example if you print to virtual screen, you need not graphic screen, but _PRINTSCREEN need it.
-
OK I got another idea, be right back!
-
Didn't work.
Isn't 256 a graphics screen? specially from _NEWIMAGE
-
for _PRINTSTRING you need grphic screen, for _PUTIMAGE too. In case, you need print to small text screen, with PRINT, it works not. I ask why :-D Next ask is, if PRINT fail, why first program is quit. This muss be something in C level. Maybe textscreen need headers and footers, I do not know...
-
I do next experiments, so it works not in graphic mode only. In text mode it works.
-
so is your image(window) a text area or a graphical area? if you want text you need to use 0(zero) not 256. your first example flat out crashes on my computer. probably cause windows can not fit the title bar in a space 10 pixels wide.
if you want a text area 10 characters square then you need to use _newimage(10,10,0)
otherwise I'm going to guess that the area is just too small for the OS to use.
-
@Petr:
Your first example interestingly doesn't crash on my Windows XP machine. It probably crashes on other systems for the reasons already outlined by Cobalt above: your OS has trouble creating a window that small.
"Is this a known bug, if this is a bug", you ask? I wouldn't call it a bug especially since it works as expected on my Windows XP VM, but it definitely doesn't sound like something productive or practical. Why would you have a program screen that small? It looks like malpractice.
For the next "bug" in your original post: You create a screen that's small enough to fit a character, but then you use PRINT, which will create a new line immediately after printing. Then what happens to your expected "A" character? It gets scrolled up. It wouldn't happen if you did this:
Notice the semicolon (;) after the PRINT line? That'll keep the cursor from going down and creating a new blank line.
About _PRINTSTRING, it does work well on text screens but instead of pixel coordinates it takes character positions. It becomes a macro to replace a LOCATE and a PRINT:
Just notice that row/column parameters are swapped (LOCATE takes a row and a column, while _PRINTSTRING takes x, y coordinates).
-
Jesus Maria, how could me escape? How could I not have noticed? Semicolon! This can not be true. :-D Thank you very much. With this practice - yeah, it's probably a stupid practice, today am i do one stupid thing and it's not going and it's not going again... and it's still not going.... I have weaker days ... last twenty years ....: D