Qbasicnews.com
December 09, 2019, 07:04:10 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2] 3 4 ... 20
  Print  
Author Topic: Bug Reports  (Read 62455 times)
adosorken
*/-\*
*****
Posts: 3655



WWW
« Reply #15 on: December 02, 2004, 02:48:18 PM »

When I moved from QB to VB, I found that making a game based on events is a hella challenge when coming from a procedural environment. But now coming back to a procedural environment is like "oh yeah, this stuff rules". Cheesy Anyways...I have some headers that I'm going to write later today for this thing, I hope they'll serve someone well and that they turn out bug-free. Cheesy
Logged

I'd knock on wood, but my desk is particle board.
v3cz0r
I hold this place together
*****
Posts: 924



WWW
« Reply #16 on: December 02, 2004, 03:44:46 PM »

All this should be listed on FAQ's or such, it is and will be a common mistake - PowerBasic doesn't even have an inkey$, iir, no wonder.
Logged

barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #17 on: December 02, 2004, 10:06:51 PM »

something small.  when doing for loops, you can't have:

next y,x

it won't allow it.
Logged

Jumping Jahoolipers!
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #18 on: December 02, 2004, 11:31:51 PM »

heh.  I never knew you could do that with qb.

It doesn't seem necessary.. have lots of fors and one next is confusing and obsfucated.
Logged
barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #19 on: December 02, 2004, 11:39:49 PM »

i guess.  but it's nice for limited line compo's. Smiley

Also found something else when trying to compile a menu program i got from qbnz:

Code:

DECLARE SUB menu (numberofchoices, title$, menuchoices$(), choice)

CLS

title$ = "title"

numofchoices = 3 'number of choices in your menu (1 to numofchoices)

DIM menuchoices(numofchoices) AS STRING
'your menu choices as text:

menuchoices(1) = "first choice"
menuchoices(2) = "choice..."
menuchoices(3) = "exit"

 CALL menu(numbofchoices, title$, menuchoices$(), choice)
ERASE menuchoices 'makes the array inexistant

'  choice   is the selection now you can use : select case or other code

SELECT CASE choice
CASE 1
PRINT "1.first choice"
CASE 2
PRINT "2..."
CASE 3
PRINT "bye"
END SELECT

SUB menu (numofchoices, title$, menuchoices$(), choice)
CLS
choice = 1          'initialize the choice

'menu format:
distancefromtoptomenu = INT((27 - numofchoices) / 3)


'menu title

LOCATE 2, (41 - LEN(title$) / 2): PRINT title$


DO

RESTORE                    '38 - LEN(MENUCHOICES(numofchoices)) / 2

FOR n = 1 TO numofchoices
LOCATE n + distancefromtoptomenu, 34: PRINT n; ") "; menuchoices$(n)
IF n = choice THEN LOCATE n + distancefromtoptomenu, 33: PRINT ">"
IF n = pchoice AND pchoice <> choice THEN LOCATE n + distancefromtoptomenu, 33: PRINT " "


NEXT

    k$ = ""

   DO
       
    k$ = INKEY$
    vakey = VAL(k$)
    k$ = UCASE$(k$)
   

   LOOP UNTIL k$ <> ""

     pchoice = choice ' save the past choice

    IF k$ = (CHR$(0) + "P") AND numofchoices >= choice THEN choice = choice + 1
    IF k$ = (CHR$(0) + "H") AND 1 <= choice THEN choice = choice - 1
    IF k$ = (CHR$(0) + "P") AND numofchoices < choice THEN choice = 1
    IF k$ = (CHR$(0) + "H") AND 1 > choice THEN choice = numofchoices

    IF VAL(k$) = vakey AND vakey <= numofchoices AND vakey >= 1 THEN pchoice = choice: choice = VAL(k$)
    IF k$ = CHR$(13) THEN EXIT DO
    IF k$ = CHR$(27) THEN choice = 0: k$ = "": EXIT DO
   
LOOP

END SUB



I got this error:

free.bas(9) : error 11: Expected constant, found: ')'

to me the syntax looks legal.
Logged

Jumping Jahoolipers!
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #20 on: December 02, 2004, 11:51:41 PM »

Use REDIM or '$DYNAMIC.  Plain ol' static DIM requires a constant, it's in the keyword file.
Logged
ShadowWolf
Wandering Guru
***
Posts: 389



« Reply #21 on: December 03, 2004, 12:10:36 AM »

i noted somthing strange while final finshing up my little pixl ploting fucation for sdl .

Pset screen ,X,Y,23+X,43+Y,X,255

everything works nice and good untill i add an extra verablie into the fucation like

Pset screen ,X,Y,23+X,43+Y,X + Y  ,255
once i do this the compiler spits out stuff about

test2.asm: Assembler messages:
test2.asm:196: Error: Unrecognized token '(null)'
test2.asm:200: Error: Unrecognized token '(null)'
test2.asm:201: Error: Unrecognized token '(null)'
test2.asm:202: Error: Unrecognized token '(null)'
test2.asm:206: Error: Unrecognized token '(null)'
Logged
marzecTM
Ancient Guru
****
Posts: 688


« Reply #22 on: December 03, 2004, 12:14:51 AM »

ow, v1c i told you don't throw that bag of bugs onto ppl. post the entire source or put it on a server, otherwise v1c can't reproduce the error
Logged

quote="NecrosIhsan"]

[/quote]
Z!re
*/-\*
*****
Posts: 4599


« Reply #23 on: December 03, 2004, 12:20:25 AM »

Windows 98

If you have a graphical window focused, or are in fullscreen, inkey$ doesent work.. at all...

You have to select the console window to be able to press keys...


Annoying.. lots..
Logged
marzecTM
Ancient Guru
****
Posts: 688


« Reply #24 on: December 03, 2004, 12:22:55 AM »

ehm how do you generate the window? sdl?
Logged

quote="NecrosIhsan"]

[/quote]
ShadowWolf
Wandering Guru
***
Posts: 389



« Reply #25 on: December 03, 2004, 12:26:06 AM »

defint a-z
option explicit

'$include: "sdl\sdl.bi"
'$include: "gl\gl.bi"
'$include: "gl\glu.bi

declare sub PSET (screen as SDL_Surface ptr , x as integer , y as integer, R as UBYTE , G as UBYTE, B as UBYTE, A as UBYTE)

dim screen as SDL_Surface ptr
dim a as string
Dim X as integer
Dim Y as integer
Dim T as UBYTE
screen = SDL_SetVideoMode( 640, 480, 32, SDL_HWSURFACE or SDL_DOUBLEBUF)
   if screen = 0 then
      SDL_Quit
      end 1
   end if



do
 a = inkey$
 if a = chr$(27) then exit do
 SDL_LockSurface (screen)
 
  For X = 1 to 100
   for Y = 1 to 100
    Pset screen ,X,Y,23+X,43+Y,X,255  ' <-- add +X +Y anywhere in
   next                                                 '  the parmitor list or even
  next                                                  ' a +10 or somthing
 
 SDL_unlocksurface (screen)
 SDL_Flip screen
loop

SDL_Quit
end


sub PSET (screen as SDL_Surface ptr , x as integer , y as integer, R as UBYTE , G as UBYTE, B as UBYTE, A as UBYTE)
 dim cl as uinteger ptr  
 dim colkey as uinteger
 dim Colptr as UBYTE ptr
 
 colptr = @colkey : *colptr = R
 colptr = @colkey + 1 : *colptr = G
 colptr = @colkey + 2 : *colptr = B
 colptr = @colkey + 3 : *colptr = A
 cl = screen->pixels + y * screen->pitch + x * len( integer )
 *cl = colkey
end sub
Logged
Z!re
*/-\*
*****
Posts: 4599


« Reply #26 on: December 03, 2004, 12:33:41 AM »

Quote from: "marzecTM"
ehm how do you generate the window? sdl?


Yes
Logged
marzecTM
Ancient Guru
****
Posts: 688


« Reply #27 on: December 03, 2004, 12:38:36 AM »

@zire well then inkey won't work, as it won't work if you do a win32 api window. cause as you create a window you also have to handle a message loop. i did a hack around that in my qbgfx legacy lib, sterling did so too in his lib, so you could still use inkey$ if you have a graphical window (would be like invoking SCREEN), but it won't work with pure sdl. that's not a bug, nor do you have to blame fb. that's windows programming
Logged

quote="NecrosIhsan"]

[/quote]
ShadowWolf
Wandering Guru
***
Posts: 389



« Reply #28 on: December 03, 2004, 12:41:18 AM »

doesn't SDL have input handleing ?
Logged
marzecTM
Ancient Guru
****
Posts: 688


« Reply #29 on: December 03, 2004, 12:45:02 AM »

yeah and? whats the point? the thing is inkey$ is a runtime library function. it must be overwritten when you use sdl, or win32 api or whatever other graphical api that comes to your mind, that starts a message queue
Logged

quote="NecrosIhsan"]

[/quote]
Pages: 1 [2] 3 4 ... 20
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!