Results 1 to 4 of 4

Thread: a very short tour in thinbasic Oxygen module

  1. #1

    a very short tour in thinbasic Oxygen module

    if you have a huge repetitive task such as in the fractals then you need a compiler, fortunately there is an embedded compiler inside thinbasic called Oxygen.
    how to use it?
    by providing a string contains oxygen code to oxygen engine for processing
    there are 3 ways to do this:
    1- using a normal string (the last line should have a new line)
    2- using a RawText ....

    string src = RawText
    ...code here
    End RawText
    
    3- by writing Oxygen code in external file and loading the whole file to a string then provide this string to the oxygen processor
    Uses "oxygen", "File"
    String src=FILE_Load("oxy.bas")
    ...
    
    for a working examples look for thinBasic_Oxygen.zip here https://github.com/Charles-Pegge/OxygenBasic
    also save the new oxygen.dll and thinBasic_Oxygen.dll to thinbasic\Lib
    look at the oxygen_help.chm in the package

    to be able to use the examples in the thinbasic distrubution (which is old)
    1-remove the word "basic" after the very beginning of the string we want to provide to oxygen processor
    2- in the functions inside oxygen replace AT with link , look example O2Functions.tbasic in the package from github above
    3-to make a DLL from oxygen you must include RTL32.inc look folder DLL in the package

    if you keep these small changes in mind then you will keep enjoying using Oxygen compiler in thinbasic

    another small note: we can write strings in oxygen like "this is a string" or `this is a string ` the privilige of using ` ` is that we can use " inside any way we want such as
    ` thinbasic with "oxygen" `
    example:
    Uses "oxygen"
    
    String src = RawText
    Dim st As String
    st = ` Thinbasic With "Oxygen" is a good choice`
    mbox st
    'print st
    End RawText
    
    o2_basic src
    If o2_error Then
      MsgBox 0,o2_error
      Stop
    Else
      o2_exec
    End If
    
    also there is a possibility to use the Console , look example consoleIO.tbasic in C:\thinBasic\SampleScripts\Oxygen\DLLandEXE\CompilingExe

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10
    Sometimes I forget about this great on the fly in memory (and not only this) compiler.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    ThinBasic_Oxygen has just been updated. We are approaching the first beta version of oxygen.dll. 141K and shrinking further! We have lost a few redundant keywords like basic and asm.

    https://github.com/Charles-Pegge/Oxy...sic_Oxygen.zip

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10
    Thanks Charles!
    I will add into next thinBasic distribution
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Similar Threads

  1. Replies: 0
    Last Post: 15-11-2015, 09:54
  2. Oxygen within thinBasic - some Feedback
    By ReneMiner in forum O2 JIT Compiler / Assembler / Oxygen project
    Replies: 16
    Last Post: 21-07-2013, 17:22
  3. Oxygen module source code on thinSVN server
    By ErosOlmi in forum thinSVN
    Replies: 8
    Last Post: 20-04-2009, 07:05
  4. Oxygen module
    By ErosOlmi in forum Legacy
    Replies: 4
    Last Post: 02-12-2008, 20:13
  5. Oxygen Module for Structured Machine Code Programming
    By Charles Pegge in forum Machine Code
    Replies: 55
    Last Post: 19-03-2008, 01:11

Members who have read this thread: 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •