Recent posts

#71
General Discussion / Why Bill Gates’ New Natrium Re...
Last post by Charles Pegge - July 03, 2024, 03:57:00 AM
Sabine Hossenfelder

#72
General Discussion / Meet The ‘Alien’ That Believes...
Last post by Charles Pegge - July 02, 2024, 06:51:24 PM
A straight interview on mainstream media. Not a hint of mockery.

This Morning
17 jun 2024
Kelly Tyler
from Arcturus


-->

I'm married to a woman from another planet: Never mind the quips about Mars and Venus, some wives genuinely believe they are 'starseeds' - spirits from the depths of space. We boldly go to ask what on Earth their husbands think

Daily Mail
11 oct2021

https://www.dailymail.co.uk/femail/article-10081711/Are-women-planet-wives-believe-starseeds-spirits-space.html
#73
General Discussion / Re: "Godfather of AI" Geoffrey...
Last post by Theo Gottwald - July 02, 2024, 03:23:30 PM
ℌ𝔢 𝔪𝔞𝔶 𝔟𝔢 𝔞 𝔤𝔬𝔬𝔡 𝔪𝔞𝔱𝔥𝔢𝔪𝔞𝔱𝔦𝔠𝔦𝔞𝔫, 𝔟𝔲𝔱 ℑ 𝔡𝔬 𝔫𝔬𝔱 𝔞𝔤𝔯𝔢𝔢 𝔴𝔦𝔱𝔥 𝔥𝔦𝔰 𝔭𝔥𝔦𝔩𝔬𝔰𝔬𝔭𝔥𝔦𝔠𝔞𝔩 𝔰𝔱𝔞𝔫𝔡𝔭𝔬𝔦𝔫𝔱𝔰 𝔞𝔟𝔬𝔲𝔱 𝔄ℑ. 
#𝔐𝔞𝔱𝔥𝔢𝔪𝔞𝔱𝔦𝔠𝔰 #𝔓𝔥𝔦𝔩𝔬𝔰𝔬𝔭𝔥𝔶 #𝔄ℑ #𝔒𝔭𝔦𝔫𝔦𝔬𝔫𝔰 #𝔇𝔢𝔟𝔞𝔱𝔢
#74
General Discussion / Re: Why Thorium will be a Game...
Last post by Theo Gottwald - July 02, 2024, 03:22:43 PM
Imagine generating all the electricity you need for 10 years with just $100 - thanks to Thorium! ⚡🌱🔋

Picture your electricity bill for 10 years being only $200... 🌍💡✨

💡 #Sustainability #Energy #Thorium #Future #Technology #RenewableEnergy #Innovation #EnergyRevolution #ClimateChange #GreenEnergy #EcoFriendly #SmartLiving #FutureEnergy #CleanEnergy #EnergyEfficiency 🌟


Mit $100 könnten Sie den Strom erzeugen, den Sie in 10 Jahren benötigen - mit Thorium! ⚡️🔋

Stellen Sie sich vor, Ihre Stromrechnung für 10 Jahre würde nur $200 betragen... 😲💡

🌿 #Nachhaltigkeit #Energie #Thorium #Zukunft #Technologie #ErneuerbareEnergien #Innovation #EnergieRevolution #Klimawandel #GreenEnergy #Umweltfreundlich #SmartLiving #ZukunftsEnergie #SaubereEnergie #EnergieEffizienz 🌎✨
#75
OxygenBasic / Re: General questions
Last post by Frank Brübach - July 02, 2024, 03:07:25 PM
Many thanks Charles for your detailed explanations.. some Things I know already by studying source Code but to be truly thats new for me that the IDE (oxide.o2bas)  wear the Main Part of CO2.exe and then extern loading oxygen.dll..

So If I am using another IDE for oxygen it must going a similar way with changed path filenames for source Code Files and DLL? And does it  make Sense to use another Editor with another Basic language? ;)

Thanks, Frank
#76
OxygenBasic / Re: General questions
Last post by Charles Pegge - July 02, 2024, 01:42:36 PM
The IDE generally needs to run compiler co2.exe with the source code filename, as a separate process. It does not need to know anything about oxygen.dll. IDEs all have their own ways of configuring this but you can see how this is done in tools\Oxide.o2bas

          'SELECT COMPILER
          if mo=1 'SHIFT ONLY
            s="\co2m64.exe" 'CO2M64 64BIT COMPILING
          else '
            s="\co2.exe" 'CO2 COMPILING
            's="\gxo2.exe" 'GXO2 COMPILING
          endif
          'RUN COMPILER AS A SEPARATE PROCESS
          'Exec qu+o2dir+s+qu+" "+qu+OxyPath(f)+qu
          's=qu+o2dir+s+qu+" "+cmo+qu+OxyPath(f)+qu
          'Exec(s)
          QuExec( o2dir+s, cmo, OxyPath(f) )
        end if
      end if

QuExec comes from inc\sysutil.inc

  'process flags:
  %CREATE_NEW_CONSOLE 0x00000010
  %CREATE_NO_WINDOW 0x08000000
  'etc
  '
  function Exec(string c, int wait=0, flags=0) as int
  ===================================================
  STARTUPINFO infs
  PROCESS_INFORMATION infp
  CreateProcess null,c,0,0,0,flags,0,0,@infs,@infp
  if wait
    WaitForMultipleObjects 1,@infp.hthread,1,-1
  end if
  GetExitCodeProcess(infp.hProcess,@function)
  CloseHandle infp.hProcess
  CloseHandle infp.hThread
  return 0
  end function


  function QuExec(string c,d,f, int wait=0,flags=0) as int
  ========================================================
    return Exec(qu+c+qu+" "+d+" "+qu+f+qu, wait,flags)
  end function
 

  function DOS(string s, int wait=0,flags=0)
  ==========================================
  string c
  if s then
    c="cmd.exe /c "+s
  else
    c="cmd.exe"
  end if
  Exec c, wait,flags
  end function

To understand how the co2 compiler uses Oxygen.dll

from tools\co2.bas
  extern lib "oxygen.dll"
  uses oxygenAPI
  end extern

inc\oxygenAPI.inc
  '12:43 18/03/2017
  '23:23 29/07/2022


  'ABST
  '====
  'compile source code string and return intermediate code string
  ! o2_abst( string s ) as string


  'BASIC
  '=====
  'compile source code string to binary code, and return pointer
  ! o2_basic( string s ) as sys


  'BUF
  '===
  'select current binary code buffer and return pointer
  ! o2_buf( int n ) as sys


  'ERRNO
  '=====
  'return error number, if any
  ! o2_errno() as int


  'ERROR
  '=====
  'return compiling error string, if any
  ! o2_error() as string


  'EXEC
  '====
  'execute inary code in current buffer (or from location specified by pointer
  ! o2_exec( sys p=0 )  as sys


  'LEN
  '===
  'return length of code in current binary code buffer
  ! o2_len() as int


  'LIB
  '===
  'return base location of o2 runtime function table
  ! o2_lib() as sys


  'LINK
  '====
  'compile o2 machine script to binary and return pointer
  ! o2_link( string src ) as sys


  'STATS
  '=====
  'return set of compilation metrics
  ! o2_stats() as string


  'MODE
  '====
  'specify string mode for various o2 API functions
  '0 ascii char*
  '1 ascii char*
  '2 unicode wchar*
  '8 ole bstring ascii
  '9 ole bstring ascii
  '10 ole bstring unicode
  ! o2_mode( int m )


  'PATHCALL
  'set callback to obtain hosted oxygenBasic path string
  ! o2_pathcall( sys m )


  'PREP
  '====
  'compile source code string and return assembly code string
  ! o2_prep( string s ) as string


  'VARCALL
  '=======
  'set callback to obtain host variable location, by name
  ! o2_varcall( sys m )


  'VERSION
  '=======
  'return version string, include time/datestamp
  ! o2_version() as string


  'VIEW
  '====
  'compile source code string and return o2 machine script string
  ! o2_view( string s ) as string



  o2_mode 9 'for oxygenBasic ascii strings
#77
OxygenBasic / Re: General questions
Last post by Frank Brübach - July 01, 2024, 06:45:39 PM
Made this example for loading oxygen.dll but CO2.exe loading in a Powerbasic CSED Editor causes Error

#COMPILE EXE
#DIM ALL
#INCLUDE "Win32api.inc"

' if I am loading 'co2.exe' I have got an error "You must set the path ofa the headers"

    DECLARE FUNCTION o2_basic(BYREF s AS ASCIIZ) AS LONG
    DECLARE FUNCTION o2_exec (BYVAL p AS LONG) AS LONG
    DECLARE FUNCTION o2_errno() AS LONG
    'DECLARE FUNCTION o2_error() AS ASCIIZ*260 PTR '' error
    DECLARE FUNCTION ThisFunction() AS LONG

FUNCTION PBMAIN () AS LONG
    DIM lHandle AS LONG
    DIM lResult AS LONG
    DIM lAddress AS LONG

    lHandle = LoadLibrary("oxygen.dll")
    IF lHandle <> 0 THEN
        lAddress = GetProcAddress(lHandle, "thisFunction")
        IF lAddress <> 0 THEN
            CALL DWORD lAddress USING ThisFunction() TO lResult
        END IF
        FreeLibrary lHandle
    END IF
  '
  DIM qu AS STRING
  DIM cr AS STRING
  DIM src AS ASCIIZ*260 'STRING
  qu=CHR$(34)
  cr=CHR$(13)+CHR$(10)
  src="print " + qu+"Hello Batman"+qu+cr
  MSGBOX "src: " + src
  '
  o2_basic(src) ' error undefined sub/function reference
  '
  IF o2_errno()<>0 THEN
    'PRINT o2_error()
  'ELSE
    o2_exec(0)
  END IF
  END

END FUNCTION

Its only for understanding  how does this Work. I have already my IDE Editor  but would Like to know whats possible to load an extern DLL and exe File. Thx
#78
General Discussion / The Two Ronnies- Garlic Comedy...
Last post by Charles Pegge - July 01, 2024, 03:47:32 PM
britcomlaughs

#79
OxygenBasic / Re: General questions
Last post by Frank Brübach - July 01, 2024, 03:45:08 PM
Thanks for feedback. Do you have an example how to do that?

I must declare functions Like o2_basic and all other First ?

I can load CO2.exe with my IDE but thats all Here thanks, Frank
#80
OxygenBasic / Re: Problems with high DPI on ...
Last post by Zlatko Vid - July 01, 2024, 02:21:52 PM
It looks that is only me who post about it
well i don't think about it before