forge Documentation

first-steps

First Steps

This guide will help you write and run your first FORGE program.

Starting FORGE

To run FORGE from the included disk image, simply type FORGE at the DOS prompt. This will load the IDE and present you with a help screen:

--D:HELP.TXT-------------------0--
'  FORGE %VERSION% - (c) 2026 Rick Collette & AtariFoundry.com
'
' Editor Help
' -----------
'  Ctrl-A : Move to beginning of line
'  Ctrl-E : Move to end of line
'  Ctrl-U / Ctrl-I : Page up / down
'  Ctrl-Z : Undo (only current line)
'  Ctrl-C : Set Mark to current line
'  Ctrl-V : Paste from Mark to here
'  Ctrl-Q : Exit to DOS
'  Ctrl-S : Save file
'  Ctrl-L : Load file
'  Ctrl-N : New file
'  Ctrl-R : Parse and run program
'  Ctrl-W : Compile to binary file
'  Ctrl-G : Go to line number
'
'- Press CONTROL-N to begin -

The Editor Interface

You are now in the integrated editor. On the first line of the screen the name of the currently edited file is shown, and at the right the line on which the cursor is located.

Note: Lines that show an arrow pointing to the top-left are empty lines beyond the last line of the current file.

In this example, the cursor is in the first column of the first line of the file being edited.

Creating a New File

Press CONTROL and N (at the same time) to begin editing a new file. If the text was changed, the editor asks if you want to save the current file to disk:

  • To skip saving, type CONTROL-C
  • To cancel the New File command, type ESC

Your First Program

Now you are ready to start writing your own BASIC program. Try the following example, pressing RETURN after each line to advance to the next:

INPUT "WHAT IS YOUR NAME?";NAME$
?
? "HELLO", NAME$

Making Corrections

The parser will let you know if you made any mistakes. To make corrections:

  • Move back using the cursor keys: CONTROL and -, =, + or *
  • Press BACKSPACE to delete the character before the cursor
  • Press DELETE (CONTROL and BACKSPACE) to delete the character below the cursor
  • To join two lines, go to the end of the first line and press DELETE

Running Your Program

After typing the last line, you can run the program by pressing CONTROL and R.

If there are no errors with your program, it will run now: the computer screen will show WHAT IS YOUR NAME?, type anything and press RETURN, the computer will reply with a greeting and the program will end.

After this, the IDE waits for any key press before returning to the editor, so you have a chance to see your program's output.

Interrupting Programs

If you press the BREAK key when the program is running, it will terminate, wait for a key press and return to the IDE.

Error Handling

If you made a mistake typing in the program code, instead of the program running, the cursor will move to the line and column of the error so you can correct it and retry.

Saving Your Work

Remember to save often by pressing CONTROL and S keys and entering a filename. Type the name and press ENTER to save. As with any prompt, you can press ESC to cancel the save operation. Use the BACKSPACE over the proposed file name if you want to change it.

Common Mistakes

Syntax Errors

  • Missing quotes around strings
  • Forgetting to end statements properly
  • Using incorrect variable names

Logic Errors

  • Variables not initialized before use
  • Array bounds not checked
  • Type mismatches (integer vs floating point)

Troubleshooting

Program won't run:

  • Check for syntax errors (cursor will point to the error)
  • Ensure all variables are properly declared
  • Verify all statements are spelled correctly

Can't see output:

  • Program may be waiting for input
  • Check if program completed successfully
  • Press any key to return to editor

Editor seems slow:

Next Steps