Bay Six Software Forum Index Bay Six Software
Beyond the Basics
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Porting MS-DOS BASIC code to LB More Info
The following list summarizes differences between Liberty BASIC and MS-DOS BASICs that would normally not cause a syntax error, but nonetheless have significant differences.

Jump to A B C D E F G I L M

  • ASC
    • (PB) Is a function only.
    • ASC("") returns zero rather than generating an error.
  • BEEP does not make any sound.
  • BYREF - cannot pass arrays to SUBs and FUNCTIONs.
  • CALL
    • Requires that parentheses be omitted.
      E.g. Call MySub "Testing", 1, 2, 3
    • Is a required keyword to call any SUB.
    • Cannot be used to call a FUNCTION.
  • CHR$ (PB) cannot accept more than one parameter.
    • Requires a #handle or #handle$ variable.
    • Cannot accept more than one handle.
  • COMMAND$ becomes CommandLine$
  • DATA
    • (QB) Can appear in the root code or in SUBs/FUNCTIONs. READs apply only to the DATA in the same scope.
    • Cannot embed quoted text within unquoted text.
    • Spaces are not allowed unless text is enclosed in quotes.
  • DATE$
    • Becomes a function.
    • Cannot set the PC's clock
  • DIM
    • Limited to two dimensions.
    • Arrays are always zero-based.
  • EOF requires a #handle or #handle$ variable.
  • ERL is not implemented.
  • ERR
    • Is named Err (case sensitive).
    • Many error codes are different or unassigned (0).
  • EXIT cannot exit nested loops,
    E.g. FOR ... : WHILE ... : EXIT FOR : WEND : NEXT
  • FIELD ?
  • FREEFILE is not implemented.
  • GET
    • Is not a graphics command.
    • Is not used with BINARY files.
  • GOTO (before LB 5) must not be used to exit a structured (DO, FOR, WHILE) loop.
  • IF...THEN IF ... THEN ... ELSE ... (single line) evaluates differently
  • INKEY$
    • Is named Inkey$ (case sensitive).
    • Is filled only for WHEN characterInput events.
    • Never generates "Redo from start" quasi-error. Fills variable(s) with zeros.
    • A comma (,) before the first variable is not allowed.
    • When reading comma-delimited data, quotes are ignored.
  • INPUT$(num, #file) becomes INPUT$(#file, num).
  • INSTR(A, B$, C$) becomes INSTR(B$, C$, A).
  • INT in LB acts exactly like FIX.
    • Only positioning is supported, not cursor changes.
    • LOCATE row, column becomes LOCATE column, row.
  • LOF requires a #handle or #handle$ variable.
  • LPRINT requires DUMP to start printing.
  • MAX (PB)
    • Accepts only two numeric parameters.
    • MAX%, MAX&, and MAX$ are not implemented
  • MID$ is a function only.
  • MIN (PB)
    • Accepts only two numeric parameters.
    • MIN%, MIN&, and MIN$ are not implemented.
  • MKDIR becomes a function.
  • MKx$ functions are not implemented.

Have questions or comments about this article? Discuss it.

Powered by phpBB © 2001, 2005 phpBB Group