Oxygen Basic

Information => Open Forum => Topic started by: chrisc on December 06, 2016, 10:10:30 AM

Title: Conversion from PowerBasic to OxygenBasic
Post by: chrisc on December 06, 2016, 10:10:30 AM
Hi all
I'm looking for guidance to convert from PowerBasic to OxygenBasic ,  anyone can help me?

please give me some guidelines how to start the conversion, as i need 64 bits as PB could offer 32bits.
appreciate your help
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: JRS on December 06, 2016, 01:35:29 PM
Welcome chrisc!

It would be helpful if you would post snippets of PB code your are having a problem converting.

I hope your efforts spawn more PowerBASIC users to evaluate OxygenBasic as a future.
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: Charles Pegge on December 09, 2016, 01:10:14 AM

Hi Chris, Welcome to our forum!

A 64 bit program and a  64bit DLL to go with it:

Code: [Select]
  %filename "TestHello164.exe"
  include "..\..\inc\RTL64.inc"

  declare function Hello lib "t164.dll" (s as string) as string

  print Hello "World!"

Code: [Select]
  %dll
  %filename "t164.dll"
  #include "$\inc\RTL64.inc"

  'print "t164.dll Loaded"

  function Hello(s as string) as string, export
  function = "Hello "+s
  end function

Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: chrisc on December 09, 2016, 05:34:55 PM
Many Thanks John and Charles

Are there any third party programs that can build the OxygenBasic codes for forms and dialogs (like in VB6) ?

Which help us to visually build buttons, textbox for data entry forms ?

and build data entry grids ? 
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: JRS on December 09, 2016, 06:16:12 PM
IUP is the easiest way to build native cross platform GUI applications.

It really doesn't matter what language you use. (interpreters or compilers)
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: Charles Pegge on December 11, 2016, 03:27:05 AM

Hi Chris,

We don't have any form building tools yet. I would like to create o2 code-generating examples when time permits.
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: jcfuller on December 11, 2016, 06:18:30 AM
chris,

Still one of the best Dialog / Resource editors available:
https://svn.code.sf.net/p/fbedit/code/ResEd22/ResEd.zip

Here's the help file:
https://svn.code.sf.net/p/fbedit/code/ResEd22/Help/ResEd.chm

There should be o2 code around somewhere toshow how to use resource dilaogs.

James
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: Charles Pegge on December 12, 2016, 01:45:28 AM
How about Firefly Visual Designer:

http://www.planetsquires.com/firefly_freebasic.html

It should be possible to compile the firefly generated code with o2, with some interfacing.
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: JRS on December 12, 2016, 10:55:08 AM
Wow!

I would love to see an example of that.
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: Aurel on December 12, 2016, 01:39:52 PM
Quote
IUP is the easiest way to build native cross platform GUI applications.
no is not...
best way with o2 is to use native win api to create controls
or if you wish to try never finished awinh.inc
good luck !  ;)

to be honest ..i am the best o2 programmer  ;D

anyway here is example ..you may find it ..let say easy enough

Code: [Select]
$ Filename "skeleton.exe" ' Oxygen Basic
include "RTL32.inc"
include "awinh.inc"
INT win,x=0,y=0,w=400,h=300,wstyle = WS_MINMAXSIZE
INT button0,b0ID=100
win=SetWindow("Skeleton GUI App...",x,y,w,h,0,wstyle)
'add control...
button0 = SetButton(win,180,4,80,26,"Close (X)",0x50001000,0x200,b0ID)
Wait()  'message loop
Function WndProc (sys hwnd,wmsg,wparam,lparam) as sys callback
SELECT hwnd
CASE win
Select wmsg
CASE WM_CLOSE
CloseWindow(win)
EndProgram
End Select
END SELECT
RETURN Default
END FUNCTION
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: Arnold on December 13, 2016, 02:37:15 AM
Hello,

I also use ResEd.exe for creating resources visually (dialogs, menues etc) as the .rc files can be compiled very well with GoRc.exe and the resulting .res files can be linked with LinkRes2Exe to a dll or to an executable created with O2.

There is another resource editor available (ResEdit.exe) but I am not sure about it.

Using Firefly Visual Designer would be an interesting alternative but I think at this stage it is only suitable for FreeBasic. However if it would be possible to adapt the CodeStore / FireFly_Functions and use them for generating the resulting code then this could be an excellent tool for creating o2 projects.

Roland
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: Charles Pegge on December 13, 2016, 01:33:31 PM
Quote
Using Firefly Visual Designer would be an interesting alternative but I think at this stage it is only suitable for FreeBasic.

This looks like a good solution for PowerBasic users with GUI-intensive applications who also require 64 bit binaries.

However,  I picked up 2 syntax incompatibilities which I can easily solve in the next release of o2:

dim shared ...

while ... loop
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: JRS on December 14, 2016, 11:04:56 AM
It would be great if a sample FireFly project could be posted and expose the requirements to get it running in O2.

The more exposure to this project, the more interest that will be generated. Many PowerBASIC programmers are actively looking for a new tool. A 64 bit BASIC compiler option should also be attractive.

My personal opinion is that FreeBASIC is too fragmented and is using its C generation option to give it a few more miles.
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: Charles Pegge on December 14, 2016, 11:15:58 PM
FireFly produces plain, though voluminous Basic source code.

A window with 1 checkbox, weighs in at around 110k of source and produces a 59k binary.  :)


.
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: JRS on December 15, 2016, 01:04:35 AM
Quote
FireFly produces plain, though voluminous Basic source code.


That's sad.

Sounds like FireFly is a bloat generator.


Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: jcfuller on December 15, 2016, 01:41:08 AM
FireFly produces plain, though voluminous Basic source code.

A window with 1 checkbox, weighs in at around 110k of source and produces a 59k binary.  :)

Charles,
  My understanding(?) is the next version will be based on José's CWindow/Afx Framework. This should reduce the size considerably.
It may never happen as Paul has lost most of his fire for the project and is concentrating on his WinFB editor.

James
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: Aurel on December 15, 2016, 10:31:43 AM
Quote
Sounds like FireFly is a bloat generator.
hehe..i know that
Firefly is ok but is little bit complex to work with him
and really exiting code is huge,by the way last version for FB dont have preview
so you cannot see your code  ..or i cannot found this  :o
there are few others...i will look
yeah resEd is really good
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: JRS on December 16, 2016, 09:28:12 AM
If the interest is truly there for a PowerBASIC alternative using OxygenBasic then a syntax translation and missing item list needs to be generated. I think this needs to come from the community as Charles's plate is full just maintaining the compiler.

Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: Aurel on December 16, 2016, 10:36:34 AM
Quote
If the interest is truly there
yes John ...that is the real question
because it looks to me that some pb programmers (from Jose forum) tend to use purebasic or c++
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: chrisc on December 18, 2016, 02:56:30 AM
I truly appreciate your feedback folks.

Hopefully someone can come up with a converter from PowerBasic to OxygenBasic. We PB programmers will buy it
as the situation now is trending towards 64 bits.  Probably Windows 10 would be the last windows OS to allow 32bits.
It took less than 12 years for Microsoft to kill off the 16bits. when Windows 11 arrives, the 32 bits would be killed.

Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: chrisc on December 18, 2016, 03:08:18 AM
James,

I downloaded the chm file from your link below but when I open it -- all the pages are blank?

https://svn.code.sf.net/p/fbedit/code/ResEd22/Help/ResEd.chm

See the image in the attachment below


.
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: jcfuller on December 18, 2016, 04:06:22 AM
chris,

From File Explorer right click on the file.
Select properties and  unblock it.

James
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: chrisc on December 18, 2016, 11:22:39 PM
ThanXX James
Title: Re: Conversion from PowerBasic to OxygenBasic
Post by: chrisc on January 24, 2018, 06:12:05 AM
Hope that someone from here can build a form generation software for Oxygen basic similar to Firefly or Phoenix
We are willing to buy.  Thanxx

The demise of PB is looming with the Windows Redstone 4 blocking the 32bits apps and that Apple has already dropped
32 bits.