BASIC Programming Quick Question.

Pharoah1

Beta member
Messages
1
How do I get something to happen once someone clicks on, lets say, the 'Start' button in the lower-left hand corner? Or maybe when someone accesses the internet, something will happen, like a notice or something.

Thanks :)
 
Sorry to tell you but what you are requesting can't be done in QBasic. That's one of the biggest limitations of QBasic, it doesn't have file I/O and it can't reference system functions (such as functions found in the API). About the only thing you can use it for, concerning external events/programs, is to use the "Shell" command, which interupts your current QBasic program and allows you to run an exe, batch, or com file, then will resume your QB program. So in actuality you would have to write code for what you wanted into a completely different language and compile it to an exe for it to work w/ QBasic (which by that time QB will be completely useless to you). Or you could do something quick n' dirty with a batch file (batch programming is simple to learn just look up a few tutorials).

Actually, if I may make a suggestion, for refrences to things such as clicking on the start button I would try to use VBS (VBScript) to do it. VBS is very simple, its easier than HTML, and it is a subset of VisualBasic and VBA. And best of all it has a built in language support in windows (like HTML) and can be entered in notepad (like HTML). VBS can access the registry, and all you have to do it tell it to fetch a value from a certain registry location. You can either look online to find out how to do this or just goto "search" on the start menu and search for *.vbs and view some of the vbs files that are already on your computer (you're almost guaranteed to have atleast 1 vbs file if not several) and view the code. Some of them should have calls to registry values (which are distinguishable by the underscores between names such as HKEY_CLASSES_ROOT) that you can look at to reverse engineer a custom program. If you are new to VBS just enter a simple one-liner into notepad by typing msgbox "Hello world",vbinformation,"whatever" and do save as... "all file types": yourfilename.vbs. You'll pick up on it immediately.

In the case of the start menu just look on the internet for where the registry keys for the start menu values in the registry are (I know there is one, I've seen it before) and write some quick code in VBS for it.

Plus you really wouldn't want to write code for a popup notice in QB or batch programming. That would be a mess, as they are not object oriented languages (and Windows is an object oriented environment) and even if you could get it to work in QB or Batch you'd open up a DOS emulation window (which could or couldn't maximize on your screen) and either way you'd open a window not a convenient little popup box. Using the easy one-line msgbox VBS command in conjunction with the registry value for your Start button in your code, will produce a very nice result if you can pull it off.

Hope that helps,

~Cybershark5886

The Master has spoken.
 
I think it says Quick question, not Quick basic...

:)

Anyway, the answer stands the same...
 
I think it says Quick question, not Quick basic...

Hehe very funny. ;)

P.S. I assumed BASIC meant QBasic. I hope he isn't using old BASIC (ya know, with the numbered lines). That has even less functionality than QBasic.
 
Back
Top Bottom