Author Topic: Conversion from PowerBasic to OxygenBasic  (Read 1246 times)

0 Members and 1 Guest are viewing this topic.

chrisc

  • Newbie
  • *
  • Posts: 17
Conversion from PowerBasic to OxygenBasic
« 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

John

  • Hero Member
  • *****
  • Posts: 2813
Re: Conversion from PowerBasic to OxygenBasic
« Reply #1 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.

Charles Pegge

  • Author
  • *****
  • Posts: 3290
    • Oxygen Basic
Re: Conversion from PowerBasic to OxygenBasic
« Reply #2 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


chrisc

  • Newbie
  • *
  • Posts: 17
Re: Conversion from PowerBasic to OxygenBasic
« Reply #3 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 ? 

John

  • Hero Member
  • *****
  • Posts: 2813
Re: Conversion from PowerBasic to OxygenBasic
« Reply #4 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)

Charles Pegge

  • Author
  • *****
  • Posts: 3290
    • Oxygen Basic
Re: Conversion from PowerBasic to OxygenBasic
« Reply #5 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.

jcfuller

  • Jr. Member
  • **
  • Posts: 64
Re: Conversion from PowerBasic to OxygenBasic
« Reply #6 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

Charles Pegge

  • Author
  • *****
  • Posts: 3290
    • Oxygen Basic
Re: Conversion from PowerBasic to OxygenBasic
« Reply #7 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.

John

  • Hero Member
  • *****
  • Posts: 2813
Re: Conversion from PowerBasic to OxygenBasic
« Reply #8 on: December 12, 2016, 10:55:08 AM »
Wow!

I would love to see an example of that.

Aurel

  • Full Member
  • ***
  • Posts: 121
Re: Conversion from PowerBasic to OxygenBasic
« Reply #9 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

Arnold

  • Sr. Member
  • ****
  • Posts: 469
Re: Conversion from PowerBasic to OxygenBasic
« Reply #10 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

Charles Pegge

  • Author
  • *****
  • Posts: 3290
    • Oxygen Basic
Re: Conversion from PowerBasic to OxygenBasic
« Reply #11 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

John

  • Hero Member
  • *****
  • Posts: 2813
Re: Conversion from PowerBasic to OxygenBasic
« Reply #12 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.

Charles Pegge

  • Author
  • *****
  • Posts: 3290
    • Oxygen Basic
Re: Conversion from PowerBasic to OxygenBasic
« Reply #13 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.  :)

John

  • Hero Member
  • *****
  • Posts: 2813
Re: Conversion from PowerBasic to OxygenBasic
« Reply #14 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.