![]() |
maxreason@gmail.com | max reason |
XBasic web-pages
XBasic overview - features, capabilities, screenshots.
XBasic newsbits - the latest news and views of XBasic.
XBasic freeware - download & installation instructions.
XBasic questions - frequently asked questions -- FAQs.
XBasic quick-start - begin programming XBasic quickly.
QuickBasic to XBasic - translate QuickBasic to XBasic.
QuickBasic keywords - QuickBasic to XBasic keywords.
XBasic documentation - complete HTML
documentation online.
XBasic keywords/operators/scopes/types - language reference.
XBasic projects - enhance & extend applications &
documentation.
XBasic e-links - other web-sites with XBasic samples and
information.
XBasic forum - mail-list forum for all
XBasic programmers - questions, answers, advice, samples, etc.
comments, suggestions, corrections
XBasic quick-start
The XBasic program development environment is loaded with capabilities, features and documentation. That's good, but it means mastering the basics can seem like an overwhelming task. Not because any aspect is difficult, but because you need to know "what are the basics" - out of that huge pile of goodies. Perform the steps described in this FAQ as you read them and you'll know the basics in short order. Once you wire the basics, you can experiment with all those capabilities and features one at a time.
step
0 : download XBasic, install XBasic, create XBasic desktop shortcut icon.
If you haven't downloaded or installed XBasic, follow the instructions on the XBasic freeware page.
step
1 : start the XBasic program development environment (abbreviated PDE).
Double-click the XBasic icon on your desktop. The XBasic main window will appear in
the lower-right corner of your display, and the default console window will appear in the
upper-left corner.
step
2 : familiarize yourself with the XBasic main window.
Look at the XBasic main window, and notice the keyboard insert cursor in the
lower-text-area. Press the escape-key a few times and notice how this toggles the
keyboard insert cursor back and forth between the upper-text-area and lower-text-area.
You'll find this escape-key toggle feature very useful, because programs are
displayed in the lower-text-area and you'll be entering zillions of keyboard commands in
the upper-text-area during program development.
step
3 : familiarize yourself with XBasic instant help
See the note about "instant help" in the upper-text-area? It says you can
point the mouse cursor at any grid and click the right mouse button to get help.
What's a grid? Any GUI element or control or widget. GUI components like
labels, buttons, menus, scroll-bars and text-areas are all grids. Which means you
can point the mouse cursor at any GUI component and click the right mouse button to learn
about it. Cool.
Point the mouse cursor at the upper-text-area and click the right mouse button. This will make the InstantHelp window appear with information about the upper-text-area. Drag the lower right corner of the InstantHelp window with the mouse to make the InstantHelp window much bigger, then read about the upper-text-area grid for awhile. When you're done, click Cancel on the InstantHelp window to hide it.
step
4 : clear the upper-text-area
Place the mouse-cursor after the .c in the upper-text-area
and press the enter-key. This dot-command clears the
clutter from the upper-text-area. You'll find entering dot-commands into the
upper-text-area is a quick and efficient way to accomplish common tasks. Most
dot-commands are equivalents of the commands in the main pulldown menu. These
dot-commands are easy to remember, because the characters in the dot-commands are the
first characters of the words in the menubar, pulldown-menus, dialogs, etc. For
example, .fl ademo.x means File Load ademo.x, where ademo.x is an
XBasic program on disk.
step
5 : create an empty XBasic program
Okay, let's create a simple XBasic program. Enter .fn p
in the upper-text-area. This is the dot-command equivalent of selecting "File New Program"
on the menubar, pulldown-menu, and dialog.
XBasic creates the framework of a new console-style program - as opposed to a GUI-program or text-file, and displays an empty Entry() function in the lower-text-area. To make the program do something, add PRINT "hello world" to the Entry() function. The entry function should look like this:
'
'
' ######################
' ##### Entry () #####
' ######################
'
' Programs contain:
' 1. A PROLOG with type/function/constant declarations.
' 2. This Entry() function where execution begins.
' 3. Zero or more additional functions.
'
FUNCTION Entry ()
PRINT "hello world"
END FUNCTION
step
6 : run your first XBasic program
To run your program, enter a .rs dot-command in the
upper-text-area.
Did it work? Check the XBasic console-window for hello world.
step
7 : add to your XBasic program
Add PRINT "hello galaxy" and PRINT "hello universe" to your Entry() function to get:
'
'
' ######################
' ##### Entry () #####
' ######################
'
' Programs contain:
' 1. A PROLOG with type/function/constant declarations.
' 2. This Entry() function where execution begins.
' 3. Zero or more additional functions.
'
FUNCTION Entry ()
PRINT "hello world"
PRINT "hello galaxy"
PRINT "hello universe"
END FUNCTION
step
8 : single step through your XBasic program
Find the button between the upper and lower text areas with F6
and a single footprint, and click it. XBasic will compile your program and single
step to the first executable line, which is
PRINT "hello world". You can tell execution stopped here
because XBasic displays a > pause
marker at the beginning of the line where execution pauses. Monitor the > pause-marker and console-window as
you slowly click the F6 button three times. Each time you click the F6 button,
XBasic executes one line, which prints to the console-window and moves the > pause-marker to the next line.
step
9 : XBasic
next step.
step
10 : XBasic
next step.
step
11 : XBasic
next step.
step
12 : XBasic
next step.