home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progbas / bb.arj / BB.DOC < prev    next >
Encoding:
Text File  |  1989-01-06  |  54.0 KB  |  1,698 lines

  1.  
  2.  
  3.  
  4.  
  5. First Edition (January, 1990)
  6. (c) 1990 Excess-3/(Gh), All rights reserved including those to reproduce this
  7. manual and software parts thereof in any form without first obtaining written
  8. permission from Excess-3.
  9.  
  10. This manual may contain technical errors or typographical errors. Every effort
  11. has been made to keep all relevant information up to date and as accurate as
  12. possible. Changes to the contents of this manual will be incorporated in
  13. future releases.
  14.  
  15.  
  16. Berlinetta is a copyright of Excess-3 and author Mohsen Al-Ghosein.
  17. Microsoft, GW-BASIC, QuickBASIC, MS-DOS are all trademarks of Microsoft Inc.
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                                 BERLINETTA BASIC
  26.                    User Guide
  27.  
  28.                    Version 1.0
  29.  
  30.         Copyright 1990 Excess-3/(Gh). All rights reserved.
  31.                               
  32.                                     Excess-3
  33.                                TEL (818) 962-0060     
  34.                                FAX (818) 960-4969
  35. ===============================================================================
  36.  
  37. Table Of Contents
  38.  
  39. 1. Copyright notice
  40. 2. Introduction
  41. 3. Installation
  42. 4. Sample session
  43.     4.1 Command line format
  44.     4.2 Using the editor
  45.     4.3 Writing a program
  46. 5. Syntax
  47. 6. Concepts
  48.     6.1 Background processing
  49.     6.2 Low level interface
  50.     6.3 File handling
  51.     6.4 Memory management
  52.     6.5 Screen management
  53. 7. Command reference
  54. 8. Appendices
  55.     8.1 Differences between BERLINETTA & GW-Basic (tm)
  56.  
  57. ==============================================================================
  58.  
  59.             2. INTRODUCTION
  60.  
  61.  
  62. BERLINETTA BASIC:
  63.             A Resident BASIC Interpreter
  64.  
  65. This TSR interpreter works on the push of a button allowing inexperienced
  66. users to create sophisticated memory resident applications without having
  67. to learn about the PC DOS & memory architecture.
  68.  
  69. Advanced programmers can create very specialized applications that can even
  70. run in the background and control DOS tasks or display information in
  71. windows or use menus...etc
  72.  
  73. APPLICATIONS:
  74.  
  75. 1. Resident Programs:    Available at the press of a button these include:
  76.     - Calculators
  77.     - File Managers
  78.     - Note Programs
  79.     - Calendars
  80.     - Monitors (Memory mons., Port Mons., Device Mons...etc)
  81.  
  82. 2. Background Applications:
  83.     Programmers can design applications that run in the background
  84.     with optionally displaying information in windows or directly
  85.     on screen, or even give DOS programs key strokes.
  86.     Examples:
  87.     - On Screen Clocks
  88.     - Background Communications
  89.     - Printer Queuing
  90.     - Keyboard Macros
  91.     - Appointments & P.I.M.
  92.     - Time or Date Alarms
  93.     - As a sophisticated example, a background task can monitor
  94.       the network server for the presence of a particular file and
  95.       call a General Ledger to update an entry from AP or AR.
  96.     - Monitoring ports (cash registers or bar readers) for
  97.       special conditions. A user can set an alarm when the modem
  98.       gets dialed to for example.
  99.  
  100. 3. Application Development:
  101.     'BB' is interpreted which means that it provides a very
  102.     easy and user friendly user environment for program development.
  103.     Changes to the program are immediately reflected without the need
  104.     to re-compile or re-assemble. Single Stepping and debugging are very
  105.     easy.
  106.             
  107. 4. Expression Evaluation
  108.     Users can write small pieces of code that they use most frequently
  109.     (Calculate next payment on mortgage or loan) and have them available
  110.     from within their applications at the press of a button.
  111.     Dynamic evaluation of expressions means that you can also use 'BB'
  112.     as a very powerful calculator.
  113.  
  114. BERLINETTA BASIC is a Copyright of Excess-3 & Author Mohsen Al-Ghosein.
  115. All Rights Are Reserved.
  116.  
  117. ==============================================================================
  118.             3. INSTALLATION
  119.  
  120.  
  121. Berlinetta comes on a 5.25" 360K diskette. The contents of the diskette are as
  122. follows:
  123.  
  124.     File            Remarks
  125.     ___________________________________________________________
  126.     BB.COM            Berlinetta BASIC Interpreter
  127.     ALARM.BAS        Alarm & time & date sample code
  128.     KEYMAC.BAS        Keyboard macro utility sample code
  129.     GAME.BAS        Sample TSR game
  130.     FILEMAN.BAS        Small file manager TSR
  131.         SCRDMP.BAS        A TSR to dump screen to a file
  132.  
  133. Before you proceed with the installation process, it is advisable to make
  134. a working copy of Berlinetta for backup purposes. You are allowed only to make
  135. one copy for personal use.
  136.  
  137. To install Berlinetta on your hard disk (e.g. C:),
  138.  
  139.     ■ Make a subdirectory called 'BB'
  140.       (C:\>MD \BB)
  141.  
  142.     ■ Copy all files from the Berlinetta distribution disk to the sub-
  143.       directory
  144.       (C:\>COPY A:*.* C:\BB)
  145.  
  146. You are now ready to proceed with using Berlinetta
  147.  
  148. ==============================================================================
  149.             4. SAMPLE SESSION
  150.  
  151. 4.1 COMMAND LINE FORMAT
  152.  
  153. To start Berlinetta, you have to change to the directory in which Berlinetta was
  154. installed (e.g. C:\BB). The command line format is as follows:
  155.  
  156. C:\BB>BB [-] [mXXXX]
  157.  
  158. The square brackets '[]' represent optional parameters.
  159.  
  160. Since Berlinetta is a memory resident program, the program initially only
  161. initializes the workspace, allocate all necessary memory, and then terminate and
  162. stays resident. The actual interpreter is only active when the key combination
  163. is pressed.
  164.  
  165. To Un-install Berlinetta from memory:
  166.  
  167. C:\BB>BB -
  168.  
  169. This removes Berlinetta from memory and restores all memory allocated.
  170.  
  171. The "m" command line parameter specifies the amount of additional Pool Memory
  172. required for Berlinetta. The value specified in "XXXX" is an actual decimal
  173. number between 1 and 30000.
  174.  
  175. Example:
  176.  
  177. C:\BB>BB m20000
  178.  
  179. This command loads Berlinetta, and specifies that additional memory of 20000
  180. bytes is to be allocated from program and data areas. This feature is very
  181. unique to .COM and .EXE DOS files since all DOS programs have to declare the
  182. amount of memory used prior to installation. Berlinetta on the other hand, can
  183. allocate memory only as required with the advanced Berlinetta memory manager.
  184.  
  185. For more details about memory allocation consult section 6.4 (Memory
  186. Management).
  187.  
  188. After Berlinetta is installed a message similar to the following is displayed:
  189.  
  190. ┌───────────────────────────────────────────────────────────────────────┐
  191. │  BERLINETTA BASIC TSR Interpreter v1.0, 01/04/1990                    │
  192. │  Hot Key: <CTRL> + <Right Shift>                                      │
  193. │  (C) 1990 Excess-3/(Gh). All Rights Reserved                          │
  194. └───────────────────────────────────────────────────────────────────────┘
  195.  
  196.  
  197. ==============================================================================
  198. 4.2 USING THE EDITOR
  199.  
  200.  
  201. After Berlinetta becomes resident in memory, it can be activated at any time by
  202. pressing the control keys <CTRL> and <RIGHTSHIFT> simultaneously. The Berlinetta
  203. window pops up displaying a copyright message at the top left corner of the
  204. screen.
  205.  
  206. The cursor is shown as a highlight that can be moved using the cursor keys.
  207.  
  208. ■ To add a BASIC line just type the line number followed by the code corresponding
  209. to that line.
  210.  
  211. ■ To delete a line just type the line number and press enter (no code).
  212.  
  213. ■ If you type a command without a preceding line number, the command is
  214. executed.
  215.  
  216. ■ While using the editor, the following keys are utilized:
  217.  
  218. ┌───────────────────────────────────────────────────────────────────────┐
  219. │Key        Function                                                │
  220. │-----------------------------------------------------------------------│
  221. │^C        Clear the screen                (CLS)   │
  222. │^R        Start execution of current program           (RUN)   │
  223. │^L        Display a listing of the current program        (LIST)  │
  224. │        Use PGUP & PGDN to browse the source, press             │
  225. │        <ESC> to stop the listing                               │
  226. │^W        Resize the window & Redraw it for programs that         │
  227. │        change the size of the window                           │
  228. │ESC        Go back to DOS or application, the background of        │
  229. │        the Berlinetta window is restored                       │
  230. │PGUP        Move cursor to top left corner of the screen            │
  231. │PGDN        Move cursor to bottom left corner of the screen         │
  232. │DEL        Delete character under the cursor                       │
  233. │HOME        Go to left of current line                              │
  234. │END        Go to end of current line                               │
  235. │^C        Stop execution of program (if program is running)       │
  236. │                                                                       │
  237. └───────────────────────────────────────────────────────────────────────┘
  238.  
  239. ■ For programs that specify ENTRY_EXEC (Execution on entry), you may have to un-
  240. install Berlinetta, and install it again to load the code and change the source
  241. code.
  242.  
  243. ==============================================================================
  244. 4.3 WRITING A PROGRAM
  245.  
  246. In this section, a sample program that reads two numbers and prints out the
  247. result.
  248.  
  249. ■ Start Berlinetta, and pop it up using the Hot Keys
  250. ■ Type in the following program:
  251.  
  252.     ┌─────────────────────────────────────────────┐
  253.     │    10 CLS                                │
  254.     │    20 PRINT "Enter Your Name: " ;        │
  255.     │    30 INPUT n$                           │
  256.     │    40 PRINT "Hello " ;                   │
  257.     │    50 PRINT n$                           │
  258.     │    60 PRINT "First #: " ;                │
  259.     │    70 INPUT x                            │
  260.     │    80 PRINT "Second #: " ;               │
  261.     │    90 INPUT y                            │
  262.     │    100 PRINT "The sum is: " ;            │
  263.     │    110 z = x + y                         │
  264.     │    120 PRINT z                           │
  265.     └─────────────────────────────────────────────┘
  266.  
  267.  
  268. Note that the commands can be entered in either upper or lower case.
  269. Also Note that variable names must have a space before and after them, eg.
  270.  
  271.               100 a= a +b       is  incorrect syntax
  272.               100 a = a + b     is  correct syntax
  273.   
  274. Now type 'RUN' at the prompt, and the program will execute.
  275.  
  276. ==============================================================================
  277.             5. SYNTAX
  278.  
  279. This section presents a brief overview of Berlinetta's Syntax:
  280.  
  281. ■ Data Types
  282.  
  283. Berlinetta has only two data types:
  284.  
  285. Integers are two byte variables that can represent unsigned values between 0 and
  286. 65535 ( 0 and @FFFF hexadecimal). Unlike languages like 'C', and integer
  287. variable can hold the address of another variable (a pointer), or can be a file
  288. handle (FILE).
  289.  
  290.  
  291. String variables are followed by a dollar sign "$", and hold up to 80 bytes of
  292. string data.
  293.  
  294. Both integer and string variables can have a maximum of two letters for the
  295. variable name with the first one having to be alpha-numeric.
  296.  
  297. ■ Constants
  298.  
  299. Integer constants are specified as either a decimal number or as a hexadecimal
  300. number. A hexadecimal constant is preceded by the '@' character.
  301.  
  302. Example:
  303.     ┌─────────────────────────────────────────────┐
  304.     │    10 a = 65535                  │
  305.     └─────────────────────────────────────────────┘
  306.  
  307. is equivalent to
  308.  
  309.     ┌─────────────────────────────────────────────┐
  310.     │    10 a = @FFFF                          │
  311.     └─────────────────────────────────────────────┘
  312.  
  313. String constants are represented by a literal string between quotation marks.
  314.  
  315.  
  316. ■ Expressions
  317.  
  318. Berlinetta has a simple syntax designed for optimizing its performance and
  319. efficiency. The following rules apply for Berlinetta's expressions:
  320.  
  321. 1. Only variable assignment can have an operator as part of the syntax
  322.  
  323.     ┌─────────────────────────────────────────────┐
  324.     │    10 a = b + c                          │
  325.     └─────────────────────────────────────────────┘
  326.  
  327. 2. No more than one operator can be placed in a single expression
  328.  
  329.     ┌─────────────────────────────────────────────┐
  330.     │    10 a = c + b / d                      │
  331.     └─────────────────────────────────────────────┘
  332. Is wrong and might produce erroneous results.
  333.  
  334.  
  335. 3. Command and function parameters are either constants or variables only
  336.  
  337.     ┌─────────────────────────────────────────────┐
  338.     │    10 a = GETCHAR( x , 5 )               │
  339.     └─────────────────────────────────────────────┘ 
  340.  
  341. ■ Operators
  342. ┌───────────────────────────────────────────────────────────────────────┐
  343. │    +            a + b                                   │
  344. │    Adds two integers                                               │
  345. │                                                                       │
  346. │    -            a - b                                   │
  347. │    Subtracts two integers                                          │
  348. │                                                                       │
  349. │    *            a * b                                   │
  350. │    Multiplies two integers                                         │
  351. │                                                                       │
  352. │    /            a / b                                   │
  353. │    Divides two integers                                            │
  354. │                                                                       │
  355. │    &            a & b                                   │
  356. │    Bitwise and two integers                                        │
  357. │                                                                       │
  358. │    |            a | b                                   │
  359. │    Bitwise or two integers                                         │
  360. │                                                                       │
  361. │    <<            a << b                                  │
  362. │    Return the value of 'a' shifted left 'b' bits                   │
  363. │                                                                       │
  364. │    >>            a >> b                                  │
  365. │    Returns the value of 'a' shifted right 'b' bits                 │
  366. │                                                                       │
  367. │    COMP            COMP( a )                               │
  368. │    Returns ones compliment of 'a'                                  │
  369. └───────────────────────────────────────────────────────────────────────┘
  370.  
  371. ==============================================================================
  372.             6. CONCEPTS
  373.  
  374. 6.1 BACKGROUND PROCESSING
  375.  
  376. One of the unique features of Berlinetta is the capability to develop
  377. applications that run in the background while other DOS applications continue
  378. running in the foreground. Three commands relate directly to background
  379. processing.
  380.  
  381. ■ SET TICKS n
  382.  
  383. Sets the number of clock ticks required before next execution of a Berlinetta
  384. program. 18 Clock ticks happen every second. In other words, setting the number
  385. of TICKS to 36 instructs Berlinetta to execute a specified program once every
  386. two seconds provided that the program enables background processing with
  387. PROC_BACK.
  388.  
  389.  
  390. ■ PROC_BACK
  391.  
  392. This command instructs Berlinetta to go back to DOS. Execution resumes every
  393. n clock ticks specified using the SET command. If a line number is specified in
  394. the command, execution begins at the specified line.
  395.  
  396.  
  397. ■ BACK_OFF
  398.  
  399. Stops background processing mode.
  400.  
  401. The following program illustrates a simple background processing clock that
  402. displays the time on the top right corner of the screen. For more sophisticated
  403. background processing examples see the included programs.
  404.  
  405.     ┌─────────────────────────────────────────────┐
  406.     │    10 SET TICKS 18                       │<--- Execute very second
  407.     │    20 ALOCATE 72 , 0                     │<--- Set cursor to 74, 0
  408.     │    30 PRINT TIME$()                      │<--- Print current time
  409.     │    40 PROC_BACK 20                       │<--- Go back & re-enter
  410.     └─────────────────────────────────────────────┘
  411.  
  412. ==============================================================================
  413. 6.2 LOW LEVEL INTERFACE
  414.  
  415. Berlinetta hosts a number of low level access features. These features provide
  416. programmers with full bitwise operations, access to the I/O ports, the entire
  417. 1MB segment of memory, and intel 8086 software interrupts (for DOS, BIOS, and
  418. applications).
  419.  
  420. Low level operators provide bitwise operations such as bitwise and '&'.
  421.  
  422. The commands relating to low level operations are:
  423.  
  424.     ┌────────────────────┐
  425.     │    POKE         │
  426.     │    PEEK         │
  427.     │    POKEB        │
  428.     │    PEEKB        │
  429.     │    INT86        │
  430.     │    INT86X       │
  431.     │    IN           │
  432.     │    OUT          │
  433.     │    SET R_..     │
  434.     └────────────────────┘
  435.  
  436. ==============================================================================
  437. 6.3 FILE & DIRECTORY HANDLING
  438.  
  439. Files are operated on using file handles. The application obtains a file handle
  440. when it opens a file for writing or reading, or when creating a new file.
  441.  
  442. Berlinetta handles file I/O in a manner similar to C. 
  443. ■ FGETC and FPUTC use a sequential mode of file operations. 
  444. ■ FSEEK moves the file pointer to specific locations.
  445. ■ FREAD, and FWRITE dump record buffers to files.
  446. ■ FCREATE create a new file.
  447. ■ FOPEN opens a file for reading, writing, or both.
  448. ■ FPRINT prints formatted data to a file.
  449. ■ FEOF checks for the end of the file.
  450. ■ FDEL deletes a file.
  451. ■ FREN renames a file.
  452. ■ MKDIR makes a new directory.
  453. ■ RMDIR removes a directory.
  454. ■ CHDIR changes to a specific directory.
  455. ■ FEXIST, and DIREXIST check for presence of files or directories.
  456.  
  457. ==============================================================================
  458. 6.4 MEMORY MANAGEMENT
  459.  
  460. One of Berlinetta's most unique features is the ability to dynamically allocate
  461. and release (free) memory. Programs can request buffers to be allocated
  462. dynamically for use with file I/O for example. The next diagram provides a view
  463. of Berlinetta's memory architecture:
  464.  
  465.         ┌────────────────┐
  466.         │                │
  467.         │    OTHER       │
  468.         │                │
  469.         │────────────────│
  470.         │   Variables    │
  471.         │────────────────│
  472.         │  Interpreter   │
  473.         │────────────────│
  474.         │  Memory Pool   │
  475.         │────────────────│
  476.         │      DOS       │
  477.         └────────────────┘
  478.  
  479.  
  480. When Berlinetta is loaded, only 1000 bytes of Memory Pool space. If the mXXXX
  481. command line parameter is provided , more memory is allocated as required.
  482.  
  483. The memory pool is used by the editor to allocate storage for newly added lines.
  484. Each line occupies 80 bytes of memory so if you have an application that is to
  485. use 100 lines it is required that you start Berlinetta with a memory pool size
  486. of at least 8000 bytes (BB m8000). In addition a program may request the system
  487. for dynamic memory using the Alloc call. This provides programs with C like
  488. dynamic buffer management.
  489.  
  490. It is highly recommended that you load Berlinetta with a large memory block
  491. (e.g. 25000 bytes) , and develop your application. After the program is
  492. developed, only the memory required by the program and its buffers needs to be
  493. allocated for Berlinetta saving memory for other DOS applications.
  494.  
  495. ==============================================================================
  496. 6.5 SCREEN MANAGEMENT
  497.  
  498. Berlinetta provides a full set of character screen management functions and
  499. commands. These provide capabilities to:
  500.  
  501.     ■ Print Integers and strings            PRINT
  502.     ■ Print hexadecimal values            PRINT HEX$( n )
  503.     ■ Put characters directly to the screen        PUTCHAR
  504.     ■ Write attributes to the screen        PUTATTR
  505.     ■ Read characters from the screen        GETCHAR
  506.         ■ Read attributes from the screen        GETCHAR
  507.     ■ Save portions of the screen to a buffer    WSAVE
  508.     ■ Restore memory from buffer            WLOAD
  509.     ■ Control the system window parameters        SET
  510.  
  511. ==============================================================================
  512.             7. COMMAND REFERENCE
  513.  
  514.  
  515.  
  516. ALLOC                                FUNCTION
  517.  
  518. FORMAT
  519. p = ALLOC(n)
  520.  
  521. Allocate n bytes, and return pointer to allocated memory. If no memory is
  522. available, a value of zero is returned.
  523.  
  524.                                     1.
  525. ===============================================================================
  526. BEEP                                COMMAND
  527.  
  528. FORMAT
  529. BEEP
  530.  
  531. Make a beep sound. This function uses the BIOS PRINT CHR(7) routine.
  532.  
  533.                                                                         2.
  534. ===============================================================================
  535. BOXTYPE                                COMMAND
  536.  
  537. FORMAT
  538. BOXTYPE n
  539.  
  540. Change BOX type for next box to be redrawn. The available box types are:
  541.  
  542.     n = 0 ------------> Single Line Box
  543.     n = 1 ------------> Double Line Box
  544.     n = 2 ------------> Block Box
  545.  
  546. Note that CLS actually draws a box around the screen, and should be treated like
  547. a draw box command.
  548.  
  549.                                                                         3.
  550. ===============================================================================
  551. COMINIT                                FUNCTION
  552.  
  553. FORMAT
  554. a = COMINIT(p,b,t,s,w)
  555.  
  556. Initialize COM port 'p' to baud rate 'b', parity 't', stop bits 's', and word
  557. length 'w'. The actual parameter options are:
  558.  
  559.     p = 0 to 3.
  560.     b = 150, 300, 600, 1200, 2400, 4800, or 9600 bits per second.
  561.     t = 0 for no parity, 1 for even parity, 3 for odd parity.
  562.     s = 0 for 1 stop bit, and 1 for 2 stop bits.
  563.     w = 0 for 7 bit word length, 1 for 8 bit word length.
  564.  
  565.  
  566. Returns the COM port Line Status. See Appendix
  567.  
  568.                                                                         4.
  569. ===============================================================================
  570. COMGETC                                FUNCTION
  571.  
  572. FORMAT
  573. a = COMGETC(p)
  574.  
  575. Get a character from port 'p' and returns it. To check status of COM port, use
  576. function COMSTATUS(p).
  577.  
  578.  
  579.                                                                         5.
  580. ===============================================================================
  581. COMPUTC                                FUNCTION
  582.  
  583. COMPUTC(p,c)
  584.  
  585. Put character 'c' to port 'p'. It returns the line status of the port.
  586.  
  587.  
  588.                                                                          6.
  589. ===============================================================================
  590. COMPUTS                                FUNCTION
  591.  
  592. FORMAT
  593. COMPUTS(p,s)
  594.  
  595. Copy string 's' to COM port 'p'. It returns the line status of port 'p'.
  596.  
  597.                                                                         7.
  598. ===============================================================================
  599. COMSTAT                                FUNCTION
  600.  
  601. FORMAT
  602. COMSTAT(p)
  603.  
  604. Return the line status of COM port 'p'.
  605.  
  606.                                                                         8.
  607. ===============================================================================
  608. COMP                                FUNCTION
  609.  
  610. FORMAT
  611. a = COMP(n)
  612.  
  613. Return one's compliment of 'n'.
  614.  
  615.                                                                         9.
  616. ===============================================================================
  617. CHDIR                                FUNCTION
  618.  
  619. FORMAT
  620. a = CHDIR(str)
  621.  
  622. Change directory to string 'str'. If a zero is returned, then the function was
  623. successful, otherwise a value of 65535 (@FFFF) is returned.
  624.  
  625.  
  626.                                                                         10.
  627. ===============================================================================
  628. CHR$                                FUNCTION
  629.  
  630. FORMAT
  631. b$ = CHR$(n)
  632.  
  633. Return a string representing character ASCII 'n'.
  634.                                                                         11.
  635. ===============================================================================
  636. CLS                                COMMAND
  637.  
  638. FORMAT
  639. CLS
  640.  
  641. Clear BERLINETTA's Window, and reset the cursor position to the top left corner
  642. of the window.
  643.  
  644.                                                                         12.
  645. ===============================================================================
  646. DATA                                COMMAND
  647.  
  648. FORMAT
  649. DATA [int const] | [str const] ....
  650.  
  651. Store data items for use by the READ command.
  652.  
  653.                                                                         13.
  654. ===============================================================================
  655. DATE$                                FUNCTION
  656.  
  657. FORMAT
  658. a$ = DATE$()
  659.  
  660. Return today's date in month/day/year format. The date can be set by using the
  661. BIOS setup routine.
  662.  
  663.                                                                         14.
  664. ===============================================================================
  665. DEBUG                                COMMAND
  666.  
  667. FORMAT
  668. DEBUG on/off
  669.  
  670.  
  671. Enable or disable the BERLINETTA Source Code Debugger. See 'DEBUGGING' for
  672. details.
  673.  
  674.                                                                         15.
  675. ===============================================================================
  676. DBOX                                COMMAND
  677.  
  678. FORMAT
  679. DBOX x1,y1,x2,y2
  680.  
  681. Draw a box with corners at (x1,y1) for the top left, and (x2,y2) as the bottom
  682. right corner. The box line type is determined by the BOXTYPE command. Note that
  683. the DBOX command uses absolute (Screen) coordinates.
  684.  
  685.                                                                         16.
  686. ===============================================================================
  687. DVAL                                FUNCTION
  688.  
  689. FORMAT
  690. a = DVAL(str$)
  691.  
  692. Return the date value of a particular string. The date value is required for
  693. comparing dates.
  694.  
  695.  
  696. Example:
  697.  
  698. 10 d$ = DATE$
  699. 20 dv = DVAL( d$ )
  700. 30 lm = DVAL("12/22")
  701. 40 IF dv > lm THEN 60
  702. 50 STOP
  703. 60 PRINT "Date Alarm Active....!!!!!"
  704.  
  705.                                                                         17.
  706. ===============================================================================
  707. DIREXIST                            FUNCTION
  708.  
  709. FORMAT
  710. a = DIREXIST(str$)
  711.  
  712. Returns TRUE (1) is the directory exists, and FALSE (0) is it doesn't exist.
  713.  
  714.                                                                         18.
  715. ===============================================================================
  716. ERASEWINDOW                            COMMAND
  717.  
  718. FORMAT
  719. ERASEWINDOW
  720.  
  721. Restore the system window's background from the background buffer. This command
  722. is used when the actual starting position or dimensions of the system windows
  723. are changed. To actually redraw the system window, two commands must be used:
  724. REDRAW, and CLS respectively.
  725.  
  726. Example
  727.  
  728. 10 ERASEWINDOW
  729. 20 SET WINDOWX 5
  730. 30 SET WIDTH 40
  731. 40 REDRAW
  732. 50 CLS
  733.  
  734.                                                                         19.
  735. ===============================================================================
  736. ENTRY_EXEC                            COMMAND
  737.  
  738. FORMAT
  739. ENTRY_EXEC
  740.  
  741.  
  742. Enable automatic execution when the Berlinetta control keys are pressed
  743.  
  744.                                                                         20.
  745. ===============================================================================
  746. FOR                                COMMAND
  747.  
  748. FORMAT
  749. FOR n = start TO end
  750.  
  751. Initialize variable 'n' to 'start' and start a loop to 'end'. The loop is
  752. executed when a NEXT n command is issued.
  753.                                                                         21.
  754. ===============================================================================
  755. FLAGS                            SET / GET PARAMETER
  756.  
  757. FORMAT
  758. SET FLAGS n
  759. a = GET( FLAGS )
  760.  
  761. Provides access to the flags register.
  762.  
  763.                                                                         22.
  764. ===============================================================================
  765. FCOLOR                            SET / GET PARAMETER
  766.  
  767. FORMAT
  768. SET FCOLOR n
  769. a = GET( FCOLOR )
  770.  
  771. Provides access to the system window color.
  772.  
  773. Example
  774.  
  775. SET FCOLOR @47        Sets the window color to white on red
  776.  
  777.                                                                         23.
  778. ===============================================================================
  779. FCREATE                            FUNCTION
  780.  
  781. FORMAT
  782. h = FCREATE(str$)
  783.  
  784. Create file 'str$'. A File handle is returned that can be used to close, open,
  785. or write  to the file. If the file cannot be created a zero value is returned as
  786. the handle.
  787.  
  788.                                                                         24.
  789. ===============================================================================
  790. FOPEN                             FUNCTION
  791.  
  792. FORMAT
  793. h = FOPEN(str$,mode$)
  794.  
  795. Open file str$ and return handle of the file to read, write, seek, or close. The
  796. mode$ specifies what the file is opened for:
  797.  
  798.     mode$ = "r"        Open file for reading only
  799.     mode$ = "w"        Open file for write only
  800.     mode$ = "rw"        Open file for read and write
  801.  
  802. Example
  803.  
  804. fp = FOPEN("sys$cfg","rw")
  805.  
  806.                                                                         25.
  807. ===============================================================================
  808. FCLOSE                                 FUNCTION
  809.  
  810. FORMAT
  811. a = FCLOSE(n)
  812.  
  813. Close file with handle 'n', and flush all I/O Buffers associated with the file.
  814. Further use of the file handle is not possible.
  815.  
  816.                                                                         26.
  817. ===============================================================================
  818. FDEL                                 FUNCTION
  819.  
  820. FORMAT
  821. f[ = FDEL ( str$ )
  822.  
  823. Delete file with the name 'str$'.
  824.  
  825.                                                                         27.
  826. ===============================================================================
  827. FREN                                 COMMAND
  828.  
  829. FORMAT
  830. FREN f1$ f2$
  831.  
  832. Rename file 'f1$' to 'f2$'
  833.  
  834.                                                                         28.
  835. ===============================================================================
  836. FPRINT                                 COMMAND
  837.  
  838. FORMAT
  839. FPRINT fp, string expression
  840. FPRINT fp, integer expression
  841.  
  842. Print a string or a value to a file. If the value to be printed is an integer
  843. then the actual value is stored not the string representing the value. To store
  844. the value as a string use the function 'STR$' to convert the integer to a
  845. string, and then use FPRINT.
  846.  
  847.                                                                         29.
  848. ===============================================================================
  849. FINPUT                                COMMAND
  850.  
  851. FORMAT
  852. FINPUT fp, a
  853. FINPUT fp, b$
  854.  
  855. Read an integer or string from file pointed to by handle 'fp'. Integer input
  856. expects the byte value of the integer and not it's string representation.
  857.  
  858.  
  859.                                                                         30.
  860. ===============================================================================
  861. FSEEK                                FUNCTION
  862.  
  863. FORMAT
  864. a = FSEEK( fp , mode , offset )
  865.  
  866. This function sets / returns the offset within a file pointed to by file handle
  867. 'fp'. The movement of the pointer depends on 'mode':
  868.  
  869.     If mode = 0 then move relative to beginning of file
  870.     If mode = 1 then move relative to the current position
  871.     If mode = 2 then move relative to the end of file
  872.  
  873. This function is very versatile since it can be used to position the file
  874. pointer, return the current position, or determine the file size:
  875.  
  876. Examples:
  877.  
  878. ■ To determine the size of a file pointed to by handle 'fp':
  879.  
  880.     s = FSEEK( fp , 2 , 0 )        ; Point to end of file and return offset
  881.     b = FSEEK( fp , 0 , 0 )        ; Point back to beginning of file
  882.  
  883. ■ To access record 'n' in a file pointed to by 'fp' when the record size is 80
  884. bytes:
  885.  
  886.     p = n * 80            ; Get position of record
  887.     a = FSEEK( fp , 0 , p )        ; Point to the record
  888.  
  889. ■ To determine the current position:
  890.  
  891.     p = FSEEK( fp , 1 , 0 )
  892.  
  893.  
  894. In all of the previous cases, FSEEK always returns the new offset.
  895.  
  896.                                                                         31.
  897. ===============================================================================
  898. FEOF                                FUNCTION
  899.  
  900. FORMAT
  901. a = FEOF( fp )
  902.  
  903. Returns TRUE if the file pointer in file 'fp' is at the end.
  904.  
  905.                                                                         32.
  906. ===============================================================================
  907. FEXIST                                FUNCTION
  908.  
  909. FORMAT
  910. a = FEXIST( str$ )
  911.  
  912. Returns TRUE if file 'str$' exists, otherwise it returns false.
  913.  
  914.  
  915.                                                                         33.
  916. ===============================================================================
  917. FFLUSH                                COMMAND
  918.  
  919. FORMAT
  920. FFLUSH fp
  921.  
  922. Flushes all file buffers associated with file 'fp', and writes them to disk.
  923. This command can be used to make sure that all changes are updated to a database
  924. after adding a record for example.
  925.  
  926.                                                                         34.
  927. ===============================================================================
  928. FREE                                 COMMAND
  929.  
  930. FORMAT
  931. FREE pt
  932.  
  933. Frees memory previously allocated by ALLOC function. The memory manager attempts
  934. to un-fragment the memory as much as possible, but that does not guarantee that
  935. memory will be fully restored to previous state.
  936.  
  937.                                                                         35.
  938. ===============================================================================
  939. FREAD                                COMMAND
  940.  
  941. FORMAT
  942. FREAD fp , pt , n
  943.  
  944. Reads 'n' bytes from file pointed to by 'fp' and store the data to buffer
  945. pointed to by pointer 'pt'.
  946.  
  947.                                                                         36.
  948. ===============================================================================
  949. FWRITE                                COMMAND
  950.  
  951. FORMAT
  952. FWRITE fp, pt , n
  953.  
  954. Write 'n' bytes to file with handle 'fp' from the buffer pointed to by pointer
  955. 'pt'.
  956.  
  957.                                                                         37.
  958. ===============================================================================
  959. FETCH                                COMMAND
  960.  
  961. FORMAT
  962. FETCH pt , a$
  963.  
  964. Get string 'a$' from buffer 'pt'. This command is used to retrieve a particular
  965. field from a database buffer.
  966.  
  967.                                                                         38.
  968. ===============================================================================
  969. FILL                                COMMAND
  970.  
  971. FORMAT
  972. FILL pt , chr , n                        
  973.  
  974. Fill buffer pointed to by pointer 'pt' with 'n' characters 'chr'. This command
  975. is used to initialize a record buffer to a particular state.
  976.  
  977.                                                                         39.
  978. ===============================================================================
  979. GOTO                                COMMAND
  980.  
  981. FORMAT
  982. GOTO n
  983.  
  984. Branch processing to line number 'n'. If 'n' is beyond the end of the program,
  985. execution stops. If line 'n' does not exist, a jump to the next line is
  986. performed.
  987.  
  988.                                                                         40.
  989. ===============================================================================
  990. GOSUB                                COMMAND
  991.  
  992. FORMAT
  993. GOSUB n
  994.  
  995. Jump to subroutine at line 'n', and resume processing until a 'RETURN' command
  996. is encountered.
  997.  
  998.                                                                         41.
  999. ===============================================================================
  1000. GETCHAR                                FUNCTION
  1001.  
  1002. FORMAT
  1003. a = GETCHAR( x , y )
  1004.  
  1005. Returns a word with the low byte as the character ASCII at screen location
  1006. (x,y), and the high byte with the attributes of that character. This function is
  1007. useful for writing screen dump, or character based games.
  1008.  
  1009.                                                                         42.
  1010. ===============================================================================
  1011. GET                                FUNCTION
  1012.  
  1013. FORMAT
  1014. a = GET( sysvar )
  1015.  
  1016. Return the value of one of BERLINETTA's System Variables. The system variables
  1017. can be set by using the 'SET' command. Currently supported System variables
  1018. include:
  1019.  
  1020.     R_AX, R_BX, R_CX, R_DX, R_SI, R_DI, FLAGS    ; 8086 registers
  1021.     WINDOWX                        ; Current window x
  1022.      WINODWY                     ; Current window y
  1023.         WIDTH                         ; Current width
  1024.         HEIGHT                         ; Current height
  1025.         TICKS                        ; No ticks before
  1026.                             ; next execute.
  1027.  
  1028.  
  1029.                                                                         43.
  1030. ===============================================================================
  1031. HEX$                                FUNCTION
  1032.  
  1033. FORMAT
  1034. a$ = HEX$( n )
  1035.  
  1036. Return a string representing a four digit hex number of integer 'n'.
  1037.  
  1038.                                                                         44.
  1039. ===============================================================================
  1040. INPUT                                COMMAND
  1041.  
  1042. FORMAT
  1043. INPUT a$
  1044. INPUT a
  1045.  
  1046. Read a string / value from the keyboard and store it in variable.
  1047.  
  1048.                                                                         45.
  1049. ===============================================================================
  1050. IF                                COMMAND
  1051.  
  1052. FORMAT
  1053. IF cond THEN line1
  1054. IF cond THEN line1 ELSE line2
  1055.  
  1056. If condition is true jump to 'line1', if ELSE is required then goto 'line2'.
  1057.  
  1058.  
  1059.                                                                         46.
  1060. ===============================================================================
  1061. INT86                                COMMAND
  1062.  
  1063. FORMAT
  1064. INT86 n
  1065.  
  1066. Execute 8086 software interrupt 'n'. To set values of registers use the 'SET'
  1067. command. The returned values of registers can be obtained by using the 'GET'
  1068. command. This command does not recognize segment registers R_DS, and R_ES.
  1069.  
  1070.  
  1071.                                                                         48.
  1072. ===============================================================================
  1073. INT86X                                COMMAND
  1074.  
  1075. FORMAT
  1076. INT86X n
  1077.  
  1078. Execute 8086 software interrupt 'n' with access to segment registers.
  1079.  
  1080.                                                                         49.
  1081. ===============================================================================
  1082. INKEY                                FUNCTION
  1083.  
  1084. FORMAT
  1085. a = INKEY()
  1086.  
  1087. Wait for a key to be pressed and return a word with the high byte representing
  1088. the Scan Code, and the low byte representing the ASCII code.
  1089.  
  1090.                                                                         50.
  1091. ===============================================================================
  1092. IN                                FUNCTION
  1093.  
  1094. FORMAT
  1095. a = IN( p )
  1096.  
  1097. Fetch a byte from port 'p'. This provides access to the 8086 I/O port
  1098. addressing.
  1099.  
  1100.                                                                         51.
  1101. ===============================================================================
  1102. KBSTATUS                            FUNCTION
  1103.  
  1104. FORMAT
  1105. a = KBSTATUS()
  1106.  
  1107. Returns the current status of the keyboard. The byte returned represents the
  1108. following:
  1109.  
  1110.         Bit        Significance
  1111.         7        Insert ON
  1112.         6        Caps Lock ON
  1113.         5        Num Lock ON
  1114.         4        Scroll Lock ON
  1115.         3        Alt key is down
  1116.         2        Ctrl key is down
  1117.         1        Left shift is down
  1118.         0        Right shift is down
  1119.  
  1120.                                                                         52.
  1121. ===============================================================================
  1122. KBHIT                                FUNCTION
  1123.  
  1124. FORMAT
  1125. a = KBHIT()
  1126.  
  1127. Returns a character if the keyboard has been hit, otherwise it returns a FALSE
  1128. (zero).
  1129.  
  1130.                                                                         53.
  1131. ===============================================================================
  1132. LOCATE                                COMMAND
  1133.  
  1134. FORMAT
  1135. LOCATE x , y
  1136.  
  1137. Set cursor position to 'x' column, and 'y' row relative to the starting window
  1138. coordinates.
  1139.  
  1140.                                                                         54.
  1141. ===============================================================================
  1142. LIST                                COMMAND
  1143.  
  1144. FORMAT
  1145. LIST
  1146. LIST n
  1147.  
  1148. Display a listing of the current program code. This is an editor command. 
  1149.  
  1150.     ■ To stop the list press <ESC>...
  1151.     ■ To view the previous page press <PageUp>...
  1152.     ■ To view the next page press <PageDown>...
  1153.  
  1154.                                                                         55.
  1155. ===============================================================================
  1156. LOAD                                COMMAND
  1157.  
  1158. FORMAT
  1159. LOAD "filename"
  1160. LOAD a$
  1161.  
  1162. Load the program "filename" into memory.
  1163.  
  1164.                                                                         56.
  1165. ===============================================================================
  1166. LOWER                                FUNCTION
  1167.  
  1168. FORMAT
  1169. a$ = LOWER("SYSTEM")
  1170.  
  1171. Return a lower case representation of its parameter.
  1172.  
  1173.                                                                         57.
  1174. ===============================================================================
  1175. LRTIM                                FUNCTION
  1176.  
  1177. FORMAT
  1178. a = LTRIM(str)
  1179.  
  1180. Remove blanks from the left (start) of the string.
  1181.  
  1182. Example:
  1183.  
  1184. PRINT LTRIM( "     this is text" )
  1185. this is text
  1186.  
  1187.                                                                         58.
  1188. ===============================================================================
  1189. LEN                                FUNCTION
  1190.  
  1191. FORMAT
  1192. a = LEN( str )
  1193.  
  1194. Return the length of a given string.
  1195.  
  1196.                                                                         59.
  1197. ===============================================================================
  1198. LPTSTAT                                FUNCTION
  1199.  
  1200. FORMAT
  1201. a = LPTSTAT( p )
  1202.  
  1203. Return the status of Centronics (Parallel) port 'p'. The status byte can be
  1204. interpreted as follows:
  1205.  
  1206.         Bit        Significance
  1207.         7        Printer not busy
  1208.         6        Printer acknowledge
  1209.         5        Out of paper
  1210.         4        Printer selected
  1211.         3        I/O Error
  1212.         2        unused
  1213.         1        unused
  1214.         0        Printer timed-out
  1215.  
  1216.                                                                         60.
  1217. ===============================================================================
  1218. LPTINIT                                FUNCTION
  1219.  
  1220. FORMAT
  1221. a = LPTINIT( n )
  1222.  
  1223. Initialize printer port 'n', and return the status of the port (See LPTSTAT).
  1224.  
  1225.  
  1226.                                                                         61.
  1227. ===============================================================================
  1228. LPTPUTC                                FUNCTION
  1229.  
  1230. FORMAT
  1231. a = LPTPUTC( p ,  c )
  1232.  
  1233. Output character 'c' to printer port 'p', and return the status of the port.
  1234.  
  1235.                                                                         62.
  1236. ===============================================================================
  1237. MIN                                FUNCTION
  1238.  
  1239. FORMAT
  1240. a = MIN( x , y )
  1241.  
  1242. Returns the minimum of 'x' and 'y'.
  1243.                                                                         63.
  1244. ===============================================================================
  1245. MAX                                FUNCTION
  1246.  
  1247. FORMAT
  1248. a = MAX( x , y )
  1249.  
  1250. Returns the Maximum of 'x' and 'y'.
  1251.                                                                         64.
  1252. ===============================================================================
  1253. MID$                                FUNCTION
  1254.  
  1255. FORMAT
  1256. a$ = MID$( s$ , p1 , p2 )
  1257.  
  1258. Return the substring of string 's$' starting at position 'p1' with a length of
  1259. 'p2' characters.
  1260.  
  1261. Example
  1262.  
  1263. PRINT MID$( "123456789", 3, 2)
  1264. 34
  1265.                                                                         65.
  1266. ===============================================================================
  1267. MKDIR                                FUNCTION
  1268.  
  1269. FORMAT
  1270. a = MKDIR( path )
  1271.  
  1272. Make a directory pointed to by string expression 'path' if possible. It returns
  1273. a hex value of @FFFF is an error is encountered.
  1274.  
  1275.                                                                         66.
  1276. ===============================================================================
  1277. NEXT                                COMMAND
  1278.  
  1279. FORMAT
  1280. NEXT var
  1281.  
  1282. Increment the variable 'var', and return to the loop starting with the 'FOR'
  1283. command using the same variable.
  1284.  
  1285.                                                                         67.
  1286. ===============================================================================
  1287. NEW                                COMMAND
  1288.  
  1289. FORMAT
  1290. NEW
  1291.  
  1292. Erase current program from memory.
  1293.  
  1294.                                                                         68.
  1295. ===============================================================================
  1296. OUT                                COMMAND
  1297.  
  1298. FORMAT
  1299. OUT port, value
  1300.  
  1301. Output a byte 'value' to 'port' through the 8086 I/O port ranges.
  1302.  
  1303.                                                                         69.
  1304. ===============================================================================
  1305. PRINT                                COMMAND
  1306.  
  1307. FORMAT
  1308. PRINT string
  1309. PRINT int
  1310.  
  1311. Display string constant (or variable), or integer value on the screen. If the
  1312. end of the command is a semicolon ';' then the cursor position will point to the
  1313. end of the displayed value, otherwise the cursor is moved to the first column of
  1314. the next line.
  1315.  
  1316.                                                                         70.
  1317. ===============================================================================
  1318. PUTCHAR                                COMMAND
  1319.  
  1320. FORMAT
  1321. PUTCHAR a
  1322.  
  1323. Display character with the ASCII value of 'a' on the screen and move cursor to
  1324. next position.
  1325.  
  1326.                                                                         71.
  1327. ===============================================================================
  1328. PUTATTR                                COMMAND
  1329.  
  1330. FORMAT
  1331. PUTATTR x , y , attr , n
  1332.  
  1333. Put 'n' 'attr' attributes on the screen starting at column 'x', and row 'y'.
  1334.  
  1335.                                                                         72.
  1336. ===============================================================================
  1337. PROC_BACK                            COMMAND
  1338.  
  1339. FORMAT
  1340. PROC_BACK
  1341. PROC_BACK n
  1342.  
  1343. Restore the background screen and start processing in background mode. If a
  1344. parameter 'n' is specified then execution will start at line 'n'.
  1345.  
  1346.                                                                         73.
  1347. ===============================================================================
  1348. PUSHKEY                                COMMAND
  1349.  
  1350. FORMAT
  1351. PUSHKEY n
  1352.  
  1353. Push a key value into the keyboard buffer. The lower byte of the value specifies
  1354. the actual ASCII value, and the upper byte represents the keyboard scan code.
  1355.  
  1356.                                                                         74.
  1357. ===============================================================================
  1358. PUSHWORD                            COMMAND
  1359.  
  1360. FORMAT
  1361. PUSHWORD str
  1362.  
  1363. Push the word represented by 'str' into the keyboard buffer. This command is
  1364. useful if execution of a particular action is required at a specific time.
  1365.  
  1366. Example
  1367. 10 a$ = TIME$()
  1368. 20 a = TVAL( a$ )
  1369. 30 b = TVAL( "12:00" )
  1370. 40 IF a >= b then 100
  1371. 50 PROC_BACK
  1372. 60 STOP
  1373. 100 PUSHWORD "dir/w"
  1374. 110 PUSHKEY 13
  1375. 120 BACK_OFF
  1376. 130 STOP
  1377.  
  1378.                                                                         75.
  1379. ===============================================================================
  1380. PEEKB                                FUNCTION
  1381.  
  1382. FORMAT
  1383. a = PEEKB( addr )
  1384.  
  1385. Return the byte value stored at memory location 'addr'. The address offset is
  1386. always relative to BERLINETTA's data segment.
  1387.  
  1388.                                                                         76.
  1389. ===============================================================================
  1390. PEEK                                FUNCTION
  1391.  
  1392. FORMAT
  1393. a = PEEK( addr )
  1394.  
  1395. Return the word stored at memory location 'addr'.
  1396.  
  1397.                                                                         77.
  1398. ===============================================================================
  1399. POKEB                                COMMAND
  1400.  
  1401. FORMAT
  1402. POKEB addr , value
  1403.  
  1404. Store the byte represented by 'value' at memory location 'addr'
  1405.  
  1406.                                                                         78.
  1407. ===============================================================================
  1408. POKE                                COMMAND
  1409.  
  1410. FORMAT
  1411. POKE addr , value
  1412.  
  1413. Store the word represented by 'value' at memory location 'addr'.
  1414.  
  1415.                                                                         79.
  1416. ===============================================================================
  1417. RUN                                COMMAND
  1418.  
  1419.  
  1420. FORMAT
  1421. RUN
  1422.  
  1423. Start execution of current program in memory
  1424.  
  1425.                                                                         80.
  1426. ===============================================================================
  1427. READ                                COMMAND
  1428.  
  1429. FORMAT
  1430. READ a
  1431. READ a$
  1432.  
  1433. Get next data value and store it in parameter.
  1434.  
  1435.                                                                         81.
  1436. ===============================================================================
  1437. RESTORE                                COMMAND
  1438.  
  1439. FORMAT
  1440. RESTORE
  1441.  
  1442. Restore the data pointer to the top of the program.
  1443.  
  1444.                                                                         82.
  1445. ===============================================================================
  1446. RETURN                                COMMAND
  1447.  
  1448. FORMAT
  1449. RETURN
  1450.  
  1451. Return from subroutine to next line after being called by a 'GOSUB' command.
  1452.  
  1453.                                                                         83.
  1454. ===============================================================================
  1455. REDRAW                                COMMAND
  1456.  
  1457. FORMAT
  1458. REDRAW
  1459.  
  1460. Redraw background screen and hide editor window.
  1461.  
  1462.                                                                         84.
  1463. ===============================================================================
  1464. REM                                COMMAND
  1465.  
  1466. FORMAT
  1467. REM comment line
  1468. ; comment line
  1469.  
  1470. This command places a comment within the file, and is not actually executed.
  1471.  
  1472.                                                                         85.
  1473. ===============================================================================
  1474. RAND                                FUNCTION
  1475.  
  1476. FORMAT
  1477. a = RAND()
  1478.  
  1479. Returns a random value between 0 and 65535.
  1480.                                                                         86.
  1481. ===============================================================================
  1482. RTRIM                                COMMAND
  1483.  
  1484. FORMAT
  1485. RTRIM b$
  1486.  
  1487. Remove blanks from the end of string 'b$'.
  1488.  
  1489.                                                                         87.
  1490. ===============================================================================
  1491. RMDIR                                FUNCTION
  1492.  
  1493. FORMAT
  1494. a = RMDIR( path )
  1495.  
  1496. Remove directory with name 'path' and returns a value of @FFFF if the function
  1497. call was not successful.
  1498.  
  1499.                                                                         88.
  1500. ===============================================================================
  1501. SYSTEM                                COMMAND
  1502.  
  1503. FORMAT
  1504. SYSTEM
  1505.  
  1506. Go back to DOS prompt from the editor.
  1507.  
  1508.                                                                         89.
  1509. ==============================================================================
  1510. SET                                COMMAND
  1511.  
  1512. FORMAT
  1513. SET sysvar value
  1514.  
  1515. Sets one of BERLINETTA's system variables to the specified value.
  1516.  
  1517. Example
  1518.  
  1519. SET R_AX @FFE1        ; Sets register AX the hexadecimal value @FFE1
  1520.  
  1521.                                                                         90.
  1522. ==============================================================================
  1523. SAVE                                COMMAND
  1524.  
  1525. FORMAT
  1526. SAVE fname
  1527.  
  1528. Save current file in memory as 'fname'. If fname does not have an extension, the
  1529. extension '.BAS' is automatically appended.
  1530.  
  1531.  
  1532.                                                                         91.
  1533. ==============================================================================
  1534. STOP                                COMMAND
  1535.  
  1536. FORMAT
  1537. STOP
  1538.  
  1539. Stop execution of current program.
  1540.  
  1541.                                                                         92.
  1542. ==============================================================================
  1543. STR$                                FUNCTION
  1544.  
  1545. FORMAT
  1546. a$ = STR$( n )
  1547.  
  1548. Returns a string representation of integer 'n'.
  1549.  
  1550.                                                                         93.
  1551. ==============================================================================
  1552. SUBSTR                                FUNCTION
  1553.  
  1554. FORMAT
  1555. a = SUBSTR( s1$ , s2$ )
  1556.  
  1557. Returns the position of string 's1$' within string 's2$'. If 's1$' does not
  1558. exist in 's2$' a value of @FFFF is returned.
  1559.  
  1560. ==============================================================================
  1561. SCMP                                FUNCTION
  1562.  
  1563. FORMAT
  1564. a = SCMP( s$ , i$ )
  1565.  
  1566. Compares two strings and returns TRUE if the strings are equal, and false if
  1567. they are not.
  1568.  
  1569.                                                                         94.
  1570. ==============================================================================
  1571. SJOIN                                FUNCTION
  1572.  
  1573. FORMAT
  1574. a$ = SJOIN( s1$ , s2$ )
  1575.  
  1576. Returns a string consisting of the concatenation of 's1$', and 's2$'.
  1577.  
  1578.                                                                         95.
  1579. ==============================================================================
  1580. STORE                                COMMAND
  1581.  
  1582. FORMAT
  1583. STORE ptr , s$
  1584.  
  1585. Store string variable 's$' at memory location 'ptr'.
  1586.  
  1587.                                                                         96.
  1588. ==============================================================================
  1589. TIME$                                FUNCTION
  1590.  
  1591. FORMAT
  1592. a$ = TIME$()
  1593.  
  1594. Returns a string representing the current time in "hh:mm:ss" format. The hour
  1595. format is in 24 hours.
  1596.  
  1597.                                                                         97.
  1598. ==============================================================================
  1599. TVAL                                FUNCTION
  1600.  
  1601. FORMAT
  1602. a$ = TVAL( s$ )
  1603.  
  1604. Returns an integer representing the time in numeric format. This can be used 
  1605. to compare two time strings.
  1606.  
  1607.                                                                         98.
  1608. ==============================================================================
  1609. UPPER                                FUNCTION
  1610.  
  1611. FORMAT
  1612. a$ = UPPER( b$ )
  1613.  
  1614. Returns a string representing the upper case of string 'b$'.
  1615.  
  1616.                                                                         99.
  1617. ==============================================================================
  1618. VAL                                FUNCTION
  1619.  
  1620. FORMAT
  1621. a = VAL( b$ )
  1622.  
  1623. Returns the value of string 'b$'.
  1624.  
  1625.                                                                         100.
  1626. ==============================================================================
  1627. WSAVE                                COMMAND
  1628.  
  1629. FORMAT
  1630. WSAVE x , y , w , h , ptr
  1631.  
  1632. Save a section of the screen starting at column 'x', row 'y' with width 'w' ,
  1633. and height 'h' to buffer pointed to by 'ptr'
  1634.  
  1635.                                                                         101.
  1636. ==============================================================================
  1637. WLOAD                                COMMAND
  1638.  
  1639. FORMAT
  1640. WLOAD x , y , ptr
  1641.  
  1642. Restore screen portion stored at buffer 'ptr' starting at position 'x', and 'y'.
  1643.  
  1644.                                                                         102.
  1645. ==============================================================================
  1646. LLIST                                COMMAND
  1647.  
  1648. FORMAT
  1649. LLIST
  1650. LLIST n
  1651.  
  1652. Dump current BASIC file to the printer.
  1653.  
  1654. ==============================================================================
  1655. FGETC                                FUNCTION
  1656.  
  1657. FORMAT
  1658. c = FGETC( fp )
  1659.  
  1660. Get next character from file pointed to by file handle 'fp'.
  1661.  
  1662. ==============================================================================
  1663. FPUTC                                FUNCTION
  1664.  
  1665. FORMAT
  1666. c = FPUTC( fp , c )
  1667.  
  1668. Put a character to the file and update file pointer.
  1669.  
  1670. ==============================================================================
  1671.             8. APPENDICES
  1672.  
  1673. 8.1 APPENDIX-A     BERLINETTA vs. GW-BASIC
  1674.  
  1675. GW-BASIC and QuickBASIC (tm) provide a standard for BASIC programming, however,
  1676. both languages are oriented towards entry level programming not developing high-
  1677. end applications or system utilities. While a number of features in GW-BASIC are
  1678. not provided in Berlinetta, Berlinetta is mainly oriented towards providing a
  1679. convenient interpreted that is available at the press of a button.
  1680.  
  1681. Some of the differences between Berlinetta & GW are outlined below:
  1682.  
  1683.                 Berlinetta        GW-BASIC
  1684. Floating point            No            Yes
  1685. Full expressions        No            Yes
  1686. Memory Resident            Yes            No
  1687. Develop TSRs            Yes            No
  1688. Char Screen Management        Yes            No
  1689. Graphics            No            Yes
  1690. Bitwise operators        Yes            No
  1691. Dynamic memory            Yes            No
  1692. Memory requirements        23K-64K            128K
  1693. Compiler            Soon            QuickBASIC
  1694. C like file handling        Yes            No
  1695.  
  1696. ==============================================================================
  1697.  
  1698.