Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Zu Hilfe!!! Problems with SDL_GetKeyState and if clause
#1
Hi!

When trying to compile the following:
Code:
' inputkeys is dimmed as Uint8 as it should
         inputkeys = SDL_GetKeyState(NULL)
         for tx_pointer = 48 to 58
            if inputkeys(tx_pointer) = 1 then
              
               tx_temp = tx_temp + chr$(tx_ponter)
               end for
            end if
         next

He whines about a missing then in the if clause.
Here is the error message, so if it is a bug that vic sees where to look.

[Image: 227-r]

Any ideas?
color=red]Look at you, Hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" - Shodan, AI at Citadel Station orbiting Earth[/color]
Reply
#2
"END FOR". Replace it for "EXIT FOR".

It's also complaining 'cause it seems that the variable inputkeys is not an array, but a UINT. Maybe what you wanted to use is pointer indexing. I don't know SDL so I can't help any further.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
Use
Code:
Peek
to get the val.;*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#4
I have found a solution:
Code:
pressedkey = event.key.keysym.sym
This dude holds the last pressed key, just fine for what i want to do Wink

Admins/Mods: Closing Time!!!
color=red]Look at you, Hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" - Shodan, AI at Citadel Station orbiting Earth[/color]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)