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!

Moderators: Pete, Mods

Post Reply
Posts: 1
Joined: Wed Nov 30, 2005 3:58 am

Using the function keys

Post by Bobby227 » Thu Dec 01, 2005 5:10 am

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

Posts: 109
Joined: Thu Feb 10, 2005 12:38 pm

Post by RayBritton » Thu Dec 01, 2005 8:14 am

to get all key codes check this tutorial ... ycodes.txt

but this should work

Code: Select all


loop until key$<>""

if key$=CHR$(0) + CHR$(59) then CALL yoursub

User avatar
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR

Post by Nodtveidt » Thu Dec 01, 2005 9:00 am

CALL isn't required; it's mainly in there for compatibility reasons.

Posts: 3
Joined: Thu Dec 01, 2005 10:49 am
Location: Mexico

Re: Using the function keys

Post by Atrapado » Thu Dec 01, 2005 11:07 am

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.

Posts: 72
Joined: Sat Oct 29, 2005 10:07 am

Post by DaveUnit » Thu Dec 01, 2005 3:20 pm

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

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



Post by Guest » Fri Dec 02, 2005 2:44 am

Thanks for that.

Very helpful.

Post Reply