| Home CBM ASCII-X BASIC Disk Commands Enter RUN mode Program Format Secret Variables Variable Format Expressions Keywords (divide) (equal) (less) (minus) (more) (multiply) (plus) (power) Abs And Append Asc Atn Auto Backup Bank Begin Bend Bload Boot Box Bsave Bump Catalog Char Chr Circle Close Clr Cmd Collect Collision Color Concat Cont Copy Cos Data Dclear Dclose Dec Def Delete Dim Directory Dispose Dload Do Dopen Draw Ds Ds string Dsave Dverify El Else End Envelope Er Err Exit Exp Fast Fetch Filter Fn For Fre Get Get num Getkey Go Gosub Goto Graphic Gshape Header Help Hex If Input Input num Instr Int Joy Key Left Len Let List Load Locate Log Loop Mid Monitor Movspr New Next Not Off On Open Or Paint Peek Pen Pi Play Pointer Poke Pos Pot Print num Pudef Quit Rclr Rdot Read Record Rem Rename Renumber Restore Resume Return Rgr Right Rlum Rnd Rreg Rspcolor Rsppos Rsprite Run Rwindow Save Scale Scnclr Scratch Sgn Sin Sleep Slow Sound Spc Sprcolor Sprdef Sprite Sprsav Sqr Sshape St Stash Step Stop Str Swap Sys Tab Tan Tempo Then Ti Ti string To Trap Troff Tron Until Using Usr Val Verify Vol Wait While Width Window Xor Syntax Tokens C128 D64plus Disk Escape Codes Hardware PCxface PETSCII Pet2asc Futurama IBM PC-AT Contact Games Glossary Hall of fame Hall of shame Miscellaneous Privacy policy Programming Twisty puzzles |
RUN [ lineNumber ] ~ or ~ RUN fileName [ , D driveNumber ] [ { , | ON } U unitNumber ] ... [ , ItwoChar ] [ , R ] ...
Program flow control. Start program execution.
RUN is most typically entered without any parameters. For those with v7.0, supplying a fileName (and sometimes a unitNumber) may occur on a regular basis. If a fileName is given, RUN will first load the program (fileName) into memory. Should the specfied fileName not be found on the device, a FILE NOT FOUND ERROR message will be generated. The RUN fileName form, like all disk commands, updates the secret variable "DosFA" (sets it equal to unitNumber), and clears DS$. See DLOAD for more information about parameters when a fileName is used. Next, the RUN command perfors the equivalant of CLR : GOTO lineNumber (where lineNumber defaults to the first line of the program). When a fileName is specified, execution always begins on the first program line; as it turns out, you can not supply both a fileName and a lineNumber... one or the other... if you try to specify both, you get SYNTAX ERROR. Specifiying a lineNumber implies (but does not gaurantee) that one or more program lines will be skipped. Skipping initial program line(s) is generally a bad idea. Occassionaly it may be useful for debugging. Much more useful for debugging are CONT and GOTO. If lineNumber is specified, it must exist; otherwise an UNDEF'D STATEMENT ERROR is generated. If you are into hard-core debugging/analysis, be sure to see the topic about Entering RUN Mode and of course the details of CLR. This statement updates a secret variable "Run Mode" by setting it to 128. It is secret because BASIC provides no way to read the value (except for machine-specific PEEK). Example:
I almost forgot! The "R" and "I" parameters (only allowed in BASIC 7.0) do nothing.
If present, the "I" parameter must be immediately followed twoChars (any two two literal characters).
The "R" is suppose to specifiy Read mode for the device; anyway you can use it multiply times if you like.
© H2Obsession, 2014 |