Main Menu

Recent posts

#1
General Discussion / New Generation Transport
Last post by Charles Pegge - Today at 06:34:37 AM
China Has Launched New Generation Transport SHOCKING The US

Dr Discovery
10 dec 2024


#2
General Discussion / The Thesis that Killed Academi...
Last post by Charles Pegge - Yesterday at 06:57:45 PM
Sabine Hossenfelder
13 dec 2024



#3
General Discussion / The System Is Rigged Against R...
Last post by Charles Pegge - Yesterday at 10:57:13 AM
The System Is Rigged Against Repairable Products (It's Not Just Greed)

Design Theory
11 dec 2024


#4
General Discussion / Incredible Ingenious Hidden Ro...
Last post by Charles Pegge - December 12, 2024, 06:49:02 PM
WOW Tech
31 oct 2024



#5
General Discussion / Ingenious Construction Workers...
Last post by Charles Pegge - December 11, 2024, 10:09:50 PM
TechZone
30 nov 2024


#6
OxygenBasic Examples / Re: Oxygen (old) and freebasic...
Last post by Frank Brübach - December 11, 2024, 06:58:05 PM
OK thanks No Problem. :-)
#7
OxygenBasic Examples / Re: Oxygen (old) and freebasic...
Last post by Charles Pegge - December 11, 2024, 05:01:46 PM
FreeBasic has faded from my memory :)
#8
OxygenBasic Examples / Oxygen (old) and freebasic
Last post by Frank Brübach - December 10, 2024, 02:53:57 PM
hello charles,

I have a general programming question about your formerly creation
of oxygen with freebasic until 2017/2018.

It's possible to load read or produce with your old inc. files freebasic *.bas files or *.exe files with oxygen.dll (2017)?
you have started during old time then with oxygen.o2bas files and made the Oxide.o2bas.

Would it be possible to create another IDE (or even with this old oxide.o2bas) that can read also freebasic *.bas
file for execution?

I was just curious, why that's perhaps not possible or it's worth to open my mind for going on with this topic?
Made this test for running the FBHost.bas file and that's working fine

' version oxygen.dll from ca 2014 until 2017
' liboxygen.dll.a, compiled with freebasic


' version oxygen.dll from ca 2014 until 2017
' liboxygen.dll.a, compiled with freebasic

'FB compiling:
'fbc FBHost.bas
'fbc -s gui FBHost.bas

' o2_basic(t) I have changed only here below for execution

' result output (ok)
5
7.071067811865476
'


'FreeBasic App Hosting Embedded OxygenBasic
'==========================================

' Charles Pegge
' 22:06 18/06/2014
'
' 10-12-2024, test frank bruebach, freebasic version 1.10.1
' o2_basic(t) I have changed here below for execution

'FB compiling:
'fbc FBHost.bas
'fbc -s gui FBHost.bas

  '------------
  'SELECTED API
  '============
  '
    '#include once "windows.bi"
    '#include once "win/ole2.bi"
    '
    #define DLL_PROCESS_ATTACH   1
    #define DLL_THREAD_ATTACH    2
    #define DLL_THREAD_DETACH    3
    #define DLL_PROCESS_DETACH   0
    #define DLL_PROCESS_VERIFIER 4
    #define sys Long
    Type HWND As sys
    Type HMODULE As sys
    Type HINSTANCE As sys
    Type BOOL As sys
    Type UINT As sys
    Type DWORD As sys
    Type BSTR As Any Ptr
    Type FARPROC As Any Ptr
    Type PVOID As Any Ptr
    Type PCVOID As Any Ptr
    Type PLONG As Long Ptr
    Type PDWORD As dword Ptr
    Type LPCSTR As Zstring Ptr
    Type LPSECURITY_ATTRIBUTES As Any Ptr
    Type LPOVERLAPPED As Any Ptr
    Type HANDLE As sys
    #define iostring bstr
    '
  Extern "windows" lib "kernel32"
    Declare Function ReadFile ( _
      As HANDLE, _
      As PVOID,  _
      As DWORD,  _
      As PDWORD,  _
      As LPOVERLAPPED) As BOOL
    Declare Function WriteFile ( _
      Byval As HANDLE, _
      As PCVOID,  _
      As DWORD,  _
      As PDWORD, _
      As LPOVERLAPPED) As BOOL
    Declare Function LoadLibrary Alias "LoadLibraryA" ( _
      As LPCSTR) As HINSTANCE
    Declare Function CreateFile Alias "CreateFileA" ( _
      As LPCSTR, _
      As DWORD, _
      As DWORD, _
      As LPSECURITY_ATTRIBUTES, _
      As DWORD, _
      As DWORD, _
      As HANDLE) As HANDLE
    Declare Function FreeLibrary(Byval As HMODULE) As BOOL
    Declare Function GetProcAddress( _
      As HINSTANCE, _
      As LPCSTR) As FARPROC
    Declare Function GetFileSize ( _
      As HANDLE, _
      As PDWORD) As DWORD
    Declare Function SetFilePointer( _
      As HANDLE, _
      As Long, _
      As PLONG, _
      As DWORD) As DWORD
    Declare Function CloseHandle( _
      As HANDLE) As BOOL
  End Extern

  Extern "windows" lib "oleaut32"
    Declare Function SysAllocStringByteLen ( _
      As Zstring Ptr, _
      As Uinteger) As BSTR
    Declare Sub SysFreeString (Byval As BSTR)
  End Extern

  Extern "windows" lib "user32"
    Declare Function MessageBox Alias "MessageBoxA" ( _
      As HWND, _
      As LPCSTR, _
      As LPCSTR, _
      As UINT) As Integer
  End Extern
    #define AllocString(p,le) SysAllocStringByteLen(p,le)
    #define FreeString(p) SysFreeString(p)
    #define Library(s) LoadLibrary(s)
    #define FreeLibr(a) FreeLibrary(a)
    #define ProcAddr(a,b) GetProcAddress(a,b)

  extern "windows-MS" lib "oxygen"

  declare sub      o2_mode  (byval m as long)
  declare function o2_abst  (byval p as zstring ptr) as zstring ptr
  'declare sub      o2_asmo  (byval p as zstring ptr)
  declare sub      o2_basic (byval p as zstring ptr)
  declare function o2_exec  (byval addr as long) as any ptr
  declare function o2_buf   (byval n as long) as long
  declare function o2_errno () as long
  declare function o2_error () as zstring ptr
  declare function o2_get   () as zstring ptr
  declare function o2_len   () as long
  declare function o2_prep  (byval p as zstring ptr) as zstring ptr
  declare sub      o2_put   (byval c as bstr)
  declare function o2_view  (byval p as zstring ptr) as zstring ptr



  'DECLARE PROCEDURES IN OXYGEN PROGRAM
  '====================================

  dim shared hypot2d as function(byval x as double, byval y as double) as double
  dim shared hypot3d as function(byval x as double, byval y as double, byval z as double) as double
  dim shared finish as  function() as long
  dim shared as string      cr

  end extern


  type FunctionTable
  f(100) as any ptr
  end type
  '
  '------------------------------
  function SetupProgram() as long
  '==============================
  dim as string      s
  dim as string      t
  dim as any ptr     pt
  dim as long        le

  cr=chr(13)+chr(10)
  '
  'LOAD SOURCE FILE
  '================
  '
  s="OxJitLib.o2bas"
  open s for binary access read as 2
  le=lof(2)
  t=string(le,chr(0))
  get #2,,t
  close 2
  '
  '
  if t="" then
    print "error 3: file empty or not found: "+s
    return 0
  end if
  '
  '
  'OXYGEN COMPILE
  '==============

  o2_mode(0)  'read/return null terminated ascii strings
'  o2_asmo(t)  'compile string ' -> doesnt work with newer oxygen.dll version
  o2_basic(t) ' that's needed for execution
  '
  if o2_errno then
    print * o2_error()
    return 0
  else
    pt = o2_exec(0) 'EXECUTE OXYGEN PROGRAM - RETURNS FUNCTION TABLE POINTER
  end if

  'MAP FUNCTIONS
  '=============

  static as FunctionTable ptr ft
  ft=pt
  hypot2d = ft->f(0)
  hypot3d = ft->f(1)
  finish  = ft->f(2)
  return 1
  end function
  '
  '
  if SetupProgram() then

    print hypot2d(3.0, 4.0) '5.0
    print hypot3d(3.0, 4.0,5.0) '5.0
    '...
    finish() 'RELEASE OXYGEN PROGRAM

  end if
  '======
sleep
' end

next file to load...

'
' oxygen file to load
' oxjitlib.o2bas

  extern

  function hypot2d(double a,double b) as double
  return sqr( a*a+b*b)
  end function

  function hypot3d(double a,double b, double c) as double
  return sqr( a*a+b*b+c*c)
  end function

  function finish() as sys
  terminate
  end function

  end extern

  sys table={@hypot2d, @hypot3d, @finish}

  = @table
' end
#9
General Discussion / Bigfoot. The evidence
Last post by Charles Pegge - December 10, 2024, 12:05:28 PM
Bigfoot Proof...Undeniable DNA Mainstream Science Ignored

Cabin in the Woods
5 dec 2024





Bigfoot Proof...Undeniable Evidence (and What's Being Hidden)

Cabin in the Woods
29 nov 2024


#10
General Discussion / How Tech Is Breaking the Rules...
Last post by Charles Pegge - December 09, 2024, 02:52:06 PM
How Tech Is Breaking the Rules of Biology | Posthuman with Emily Chang

Bloomberg Originals
3 dec 2024