home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ob140os2.zip / V140.TXT < prev    next >
Text File  |  1997-10-29  |  9KB  |  255 lines

  1.  
  2.  
  3. Version 1.30 Notes:
  4.  
  5. 1) Fix optional "THEN" feature
  6.  
  7. 2) Fix #FCN etc. for ANSI (-A) option
  8.  
  9. 3) Add "PROGRAM" statement. This is used to tell the compiler where the
  10.    code section of the program is to begin. It its almost never required
  11.    because the compiler "knows" when the code is to begin EXCEPT if the
  12.    first line of code is C or assembler. If the first line of code is C
  13.    or assembler, use the PROGRAM staement immediately preceeding the first
  14.    line of code.
  15.  
  16. 4) Hexadecimal constants may now be expressed in Motorola, Intel, or C
  17.    style. The formats (using ffff as an example) are:
  18.    Motorola:   $ffff
  19.    Intel:      0ffffh
  20.    C:          0xffff
  21.  
  22.    In the Intel case, the first character MUST be a digit.
  23.  
  24. 5) Add "HEXOUT" statement. This statement allows control over the output
  25.    of the HEX$() function. In the examples only the first letter is checked
  26.    by the compiler. The default is Motorola ($ffff).
  27.  
  28.    HEXOUT motorola  (preceeds hex value with "$")
  29.    HEXOUT intel     (preceeds hex value with "0" and adds "h" at end)
  30.    HEXOUT c         (preceeds haex value with "0x")
  31.    Hexout none      (adds nothing)
  32.  
  33. 6) Add ANSI stream file I/O. This causes the C functions fopen(), fread(), etc.
  34.    to be used instead of open(), read(), etc. This was implemented to speed up
  35.    file I/O on certain systems. For most it is of no concern. Stream I/O is
  36.    supported in the following statements and functions:
  37.  
  38.    1) create
  39.    2) open
  40.    3) close
  41.    4) get
  42.    5) put
  43.    6) read
  44.    7) write
  45.    8) seek
  46.    9) eof()
  47.    10) filsiz()
  48.    11) filpos()
  49.  
  50.    Stream I/O is NOT supported for the following:
  51.    1) print
  52.    2) input
  53.    3) fprint
  54.    4) finput
  55.  
  56.    For purposes of explanation, we will refer to the "old" way of doing files
  57.    as "path" and the ANSI way as "stream". The two styles CANNOT be mixed.
  58.    These examples illustrate the usage:
  59.  
  60.              PATH                            STREAM
  61.  
  62.    DIM FileNum:BYTE               DIM FilePtr:FILE
  63.    DIM X:LONG                     DIM X:LONG
  64.    X=1234                         X=1234
  65.    CREATE #FileNum,"test":WRITE   CREATE FilePtr,"test":WRITE
  66.    WRITE #FileNum,X               WRITE FilePtr,X
  67.    CLOSE #FileNum                 CLOSE FilePtr
  68.    OPEN #FileNum,"test":UPDATE    OPEN FilePtr,"test":UPDATE
  69.    READ #FileNum,X                READ FilePtr,X
  70.    SEEK #FileNum,0                SEEK FilePtr,0
  71.    PRINT FILPOS(#FileNum)         PRINT FILEPOS(FileNum)
  72.    CLOSE #FileNum                 CLOSE FilePtr
  73.  
  74.    As you can see, the main difference in the usage is the "#" prefix to the
  75.    path number variable. Not apparent from this example is the fact that you
  76.    cannot assign a value to a FILE variable in an assignment statement. For
  77.    example:
  78.  
  79.    FilePtr=3
  80.  
  81.    will cause an error to be reported. While these two methods are radically
  82.    different internally, OmniBasic has made the use of either to appear very
  83.    similar.
  84.  
  85.    Also note that with stream I/O, CREATEing a file that already exists will
  86.    not cause an error as in path I/O, but rather will delete the old file and
  87.    start a new one with the same name.
  88.  
  89. 7) The "+" character in column 1 now "tells" the compiler that this is an
  90.    assembler statement. In the gcc case (Linux, MSDOS, OS/2, etc.) this is
  91.    quite useful because it eliminates a lot typing for those who like to
  92.    intermix assembler. Using the "nop" instruction as an example, the code
  93.    produced for the C compiler is:
  94.  
  95.    gcc case:
  96.  
  97.    +nop        produces __asm__ __volatile__("nop");
  98.  
  99.    OS-9/OS-9000 case:
  100.  
  101.    +nop        produces @nop
  102.  
  103.    In either case no syntax checking is performed. When using inline assembler
  104.    in OmniBasic, it is best to delare any variables using the DIM statement
  105.    rather than by explicit assembler directive. This way, OmniBasic is "aware"
  106.    of the data and the data will automatically appear in the correct segment
  107.    of the resultant .c file.
  108.  
  109. Version 1.31 Notes:
  110.  
  111. 1) SUBSTR() has been rewritten. An optional third argument specifies the
  112.    postion in arg 2 to start the search. If the third arg is missing, the
  113.    position is 1 by default.
  114.  
  115. 2) Two new functions, UCASE$(StrVar) and LCASE$(StrVar) have been added.
  116.    UCASE$() returns a string converted to uppercase. Correspondingly LCASE$()
  117.    returns a string converted to lower case. The current implementation sets
  118.    a limit of 300 bytes string size for the conversion.
  119.  
  120. 3) Two new statements have been added. MAKEUPPER and MAKELOWER correspond to
  121.    the two new functions (UCASE$(), LCASE$()). The sytax is:
  122.  
  123.    MAKEUPPER StrVar
  124.  
  125.    There is no limit on the string size here. The string is converted in place
  126.    which makes thes statements faster than the corresponding functions.
  127.  
  128. Version 1.32 notes:
  129.  
  130. 1) TAIL$() has been added. The syntax is:
  131.  
  132.    TAIL$(StrVar,Position)
  133.  
  134.    TAIL$() returns the string StrVar starting at Position through the end of the
  135.    string.
  136.  
  137. 2) The FILL statement has been added. The syntax is:
  138.  
  139.    FILL Addr,Quan[,Pattern]
  140.  
  141.    FILL places the pattern 'Pattern' in memory starting at Addr for Quan
  142.    byte locations. If the 'Pattern' argument is missing, 0's are the pattern.
  143.    Use this statement with caution as FILLing carelessly can result in
  144.    destruction of data and/or system crashes.
  145.  
  146. 3) The INIT statement is similar to the FILL statement except that the
  147.    parameters are obtained from the Var parameters rather than explicit
  148.    arguments. INIT is much safer to use than FILL for this reason. The syntax
  149.    is:
  150.  
  151.    INIT VAR[,Pattern]
  152.  
  153.    If Var is a Buffer thaat has been opened, the pattern will be written into
  154.    the buffer from BUFADR(BufName) for BUFSIZ(BufName) byte locations. If the
  155.    buffer BufName has been close (BUFFER BufName=0), INIT BufName will cause
  156.    unpredictable (probably disasterous) results.
  157.  
  158. 4) FINDADDR() and FINDOFFS() have been added. The syntax is:
  159.  
  160.    FINDADDR(Addr,Quan,Pattern)
  161.    FINDOFFS(Addr,Quan,Pattern)
  162.  
  163.    Both functions work the same except that FINDADDR returns the address
  164.    of the first byte location which matches 'Pattern' while FINDOFFS
  165.    returns the offset from 'Addr'. Both functions search for a byte match
  166.    of 'Pattern' starting at 'Addr' for 'Quan' bytes.
  167.  
  168. 5) A bug in PEEK() has been fixed.
  169.  
  170. Version 1.36 Notes:
  171.  
  172. This version eliminates all of the restrictions on the placement of labels,
  173. statements, functions, and directives into certain column postions. In other
  174. words, for exeample, labels no longer have to start in column 1 and
  175. statements no longer have to be indented at all. Also, directives may
  176. begin in any position. Labels, subroutines, and functions may have a ":"
  177. appended for clarity, but this is optional. See "fcndemo.b" for an
  178. example of the declaring, calling, and defining og functions.
  179.  
  180. Previous to this release, function definitions were required to begin
  181. in column 1 with "()" appended. Now they may begin in any postion but the "()"
  182. MUST be removed.
  183.  
  184. This version also allows the substitution of "$" for "#" in directives making
  185. them resemble metastatements from other Basics. For example $INCLUDE is the
  186. same as #INCLUDE.
  187.  
  188. In DIM statements you may specify "INT" for a 16 bit integer. Keep in mind
  189. "INTEGER" specifies a 32 bit integer. This was added for QB/PB compatibility.
  190.  
  191. The following shows three distinct styles of programming with OmniBasic. You
  192. can mix and match as you desire, but it is recommended that you develop a
  193. particular style and stick with it for consistancy and readability.
  194.  
  195. DIM X AS LONG
  196.  
  197. X=2
  198. GOSUB Test1
  199. PRINT X
  200.  
  201. Test1:
  202. X=X+1
  203. RETURN
  204.  
  205.  
  206. DIM X AS LONG
  207.  
  208. X=2
  209. GOSUB Test1
  210. PRINT X
  211.  
  212. Test1
  213. X=X+1
  214. RETURN
  215.  
  216.  
  217.  DIM X AS LONG
  218.  
  219.  X=2
  220.  GOSUB Test1
  221.  PRINT X
  222.  
  223. Test1
  224.  X=X+1
  225.  RETURN
  226.  
  227. Version 1.40 Notes:
  228.  
  229. This version fixes several bugs including READ/WRITE/GET/PUT of portions of
  230. user-defined variables and calculations of SEEK position in stream I/O.
  231.  
  232. News features include the ability to "know" the program's file name:
  233.  
  234. PRINT ProgramName
  235.  
  236. or 
  237.  
  238. A$=ProgramName
  239. IF A$="test" THEN...
  240.  
  241. The SETBUFADR statement has been added. This allows just one BUFFER structure
  242. to control any number of buffers by maintaining a table of open buffers and
  243. then closing any buffer by:
  244.  
  245. BUFFER BufName=2000
  246. x=BUFADR(BufName)
  247.  
  248. ...
  249.  
  250. SETBUFADR BufName=x
  251. BUFFER BufName=0
  252.  
  253. This is for advanced programmers and be advised that an invalid SETBUFADR can
  254. cause a system crash or data loss.
  255.