• Welcome to Jose's Read Only Forum 2023.
 

Recent posts

#61
OxygenBasic / Re: 64-bit oxygen.dll
Last post by Joe Caverly - February 26, 2023, 03:45:32 AM
Rex Conn has been, and is, the owner of JP Software.

I've been using his software since the 1980s, when it was called 4Dos.

More about Rex Conn at https://www.linkedin.com/in/rexconn

Or, if you want, you can converse with him on the forums
Ref: https://jpsoft.com/forums/

or via email support@jpsoft.com

Joe
#62
OxygenBasic / Re: Kick - o2 precompiler
Last post by Theo Gottwald - February 25, 2023, 02:12:43 PM
Hahaa
Anybody has a unique idea of Commands and improvements he would like to add to any Compiler out there.

Me for example have a long liust of stuff i would like to aadd to Powerbasic, for example an optional
"INIT and Destroy" option for Variables, Procedures and this is just one thing.

This can be added in the compiler, but a lot of stuff can also be done by an intelligent pre-processor, which can first "Pre-Process" the code and then write the final to to be compiled.

If you have an own Editor you can even give this new language a new name and Filetype.
That would be the next step ... if you are so far :-)

Then you can start and make your own enhancements.
Then the question is, which enhancements you would like.

If you have your own Editor "On Top of (whatever)" you can make your own enhancements using a Pre-Processor.
Take the "Initialisation" and "Destruction" of Variables just as a Sample.
Other Stuff would be to be able to call a (Debug?)-Subprogramm whenever a variable is touched by the System.
#63
OxygenBasic / Re: 64-bit oxygen.dll
Last post by Joe Caverly - February 21, 2023, 02:06:03 PM
Indeed, a 64-bit oxygen.dll would be the best solution.

No big hurry, no big rush.

Thankyou for your assistance.

Regards,

Joe
#64
OxygenBasic / Re: 64-bit oxygen.dll
Last post by Charles Pegge - February 21, 2023, 01:17:22 PM
I think it is possible with the current o2/co2 using shared-memory for data passing between processes, but ideally a 64bit o2 would be the best solution. Time is the problem. Are you in a hurry, Joe?
#65
OxygenBasic / Re: 64-bit oxygen.dll
Last post by Zlatko Vid - February 21, 2023, 07:37:33 AM
Charles .

I think that he means on o2 compile function
hmm but i am not sure , i have PureBasic (old version)
maybe i can try PB code ...
#66
OxygenBasic / Re: Kick - o2 precompiler
Last post by Pierre Bellisle - February 21, 2023, 07:01:29 AM
Hi Theo,

Can you elaborate on "enhance it to a Preprocessor that will also make changes in the code."
What do you mean precisely?
#67
OxygenBasic / Re: 64-bit oxygen.dll
Last post by Joe Caverly - February 21, 2023, 02:34:54 AM
Quote from: Charles Pegge on February 21, 2023, 12:45:11 AM
But  there is hidden code: the thinBasic_Oxygen.dll module to mediate between thinBasic and o2. It is rather similar to co2, though it can also share variables and support function calls directly. Is this what you intend to do?

Indeed.

Although, I do not need the ability to create .EXE or .DLL files.

All I want to do is to be able to execute an .o2bas file from 64-bit PureBasic, and get the results back from the execution.

Something along this theoretical example 64-bit PureBasic code;If OpenLibrary(0, "Oxygen.dll")
  thestring = "result=10+20"
  oAddr = CallFunction(0, "o2_basic", @"thestring")
  'and/or instead of thestring, an .o2bas file
  'Use o2_exec to execute thestring, and return the result
  oExec = CallFunction(0, "o2_exec", oAddr)
  'Get the result, which should be 30, and store it in oString
  'Not sure how this would be accomplished.
  If OpenConsole()
    PrintN(oString) 
  EndIf
Else
  PrintN("Error opening oxygen.dll")
EndIf


Regards,

Joe

#68
OxygenBasic / Re: 64-bit oxygen.dll
Last post by Charles Pegge - February 21, 2023, 12:45:11 AM
But  there is hidden code: the thinBasic_Oxygen.dll module to mediate between thinBasic and o2. It is rather similar to co2, though it can also share variables and support function calls directly. Is this what you intend to do?


#69
OxygenBasic / Re: 64-bit oxygen.dll
Last post by Joe Caverly - February 20, 2023, 11:53:22 PM
That requires co2.exe to be installed on the users system, correct?

That defeats the purpose of creating an Oxygen Plugin for TCC,
as it would require co2.exe,
an external,
to compile and execute the .o2bas file.

Take for example, this ThinBasic code, HelloWorld.tbasic;uses "oxygen"

dim as string src

src="
print "Hello World!"
"

o2_basic src
if o2_errno then
  msgbox 0,o2_error
  stop
else
  o2_exec
end if
No external co2.exe is required to compile and execute that code.

I would like to do the same thing, except do this under 64-bit PureBasic.

Once I am able to do this with 64-bit PureBasic,
I can then use 64-bit PureBasic to develop a 64-bit plugin for TCC,
that would have Oxygen embedded into the sub-system of TCC at run-time.

Regards,

Joe
#70
OxygenBasic / Re: 64-bit oxygen.dll
Last post by Charles Pegge - February 20, 2023, 11:36:22 PM
o2 is normally invoked using co2.exe in a new separate process. So the 32/64 bitness does not matter. You can see how it is done in tools/ Oxide.o2bas and Peroxide.o2bas which both use inc\sysutil.inc exec

Exec(sd+"\co2.exe "+f,0) 'assume co2 path

from sysutil.inc

  function Exec(string c, int wait=0) as int
  ==========================================
  STARTUPINFO infs
  PROCESS_INFORMATION infp
  CreateProcess null,c,0,0,0,0,0,0,@infs,@infp
  if wait
    WaitForMultipleObjects 1,@infp.hthread,1,-1
  end if
  GetExitCodeProcess(infp.hProcess,@function)
  CloseHandle infp.hProcess
  CloseHandle infp.hThread
  end function