Using the function keys

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!
Post Reply
Bobby227
Newbie
Posts: 1
Joined: Wed Nov 30, 2005 3:58 am

Using the function keys

Post by Bobby227 »

Thanks for the welcome.

Another question that may seem silly, are the function keys usable just that same as all other keys?

How do i tell QBasic to begin another SUB on the press of F1 for example?

Thanks for your help
RayBritton
Veteran
Posts: 109
Joined: Thu Feb 10, 2005 12:38 pm

Post by RayBritton »

to get all key codes check this tutorial http://www.petesqbsite.com/sections/tut ... ycodes.txt

but this should work

Code: Select all

key$=""

do
key$=inkey$
loop until key$<>""

if key$=CHR$(0) + CHR$(59) then CALL yoursub
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

CALL isn't required; it's mainly in there for compatibility reasons.
Atrapado
Newbie
Posts: 3
Joined: Thu Dec 01, 2005 10:49 am
Location: Mexico

Re: Using the function keys

Post by Atrapado »

Bobby227 wrote:how do i tell QBasic to begin another SUB on the press of F1 for example?
there are two ways to create a SUB or FUNCTION,
(A) using the menu bar you would touch Alt, E, S.
(B) just writing a line in the editor this way
SUB yourname (parameter)
and then just press Enter.
to go in and out the SUBs and FUNCTIONs press F2.
DaveUnit
Veteran
Posts: 72
Joined: Sat Oct 29, 2005 10:07 am

Post by DaveUnit »

I don't think that's what he was asking Atrapado...

But anyway, just use that tutorial in the first reply, dude.

~Dave~
Guest

Post by Guest »

Thanks for that.

Very helpful.
Post Reply