Author Topic: PowerBASIC  (Read 6901 times)

0 Members and 1 Guest are viewing this topic.

Josť Roca

  • Jr. Member
  • **
  • Posts: 78
Re: PowerBASIC
« Reply #15 on: February 21, 2018, 08:09:15 AM »
One thing is to provide alternatives to PB functionality missing in another language and another to do a translation. The alternatives will have a different usage and syntax, and in many cases will use a different tehnology (for example, I don't use TCP and UDP, but WinHTTP and CDO). Therefore, a translation is not possible. You will have to rewrite the application.

For FreeBasic I have written a framework that allows to do almost all you can do with PowerBasic and much more, but don't ask me about converters. The DDTers have become captive of an obsolete proprietay system.

WinFBX: http://www.jose.it-berater.org/WinFBX/WinFBX.html

About 4200 entries...

John

  • Hero Member
  • *****
  • Posts: 3249
Re: PowerBASIC
« Reply #16 on: February 21, 2018, 09:19:34 AM »
Outstanding documentation effort for WinFBX!

The only addition I would like to see is the Windows DLL file name that is being used for the calls to the Windows API.


chrisc

  • Guest
Re: PowerBASIC
« Reply #17 on: February 21, 2018, 09:19:05 PM »
Thanxx Jose
but when i approached FB forum on how to convert PB to FB,  i got no help at all
that's why i came to O2 forum, as directed by my boss.

maybe I will try FB and  where do you think I should start out the conversion, Jose ?

John

  • Hero Member
  • *****
  • Posts: 3249
Re: PowerBASIC
« Reply #18 on: February 21, 2018, 09:30:34 PM »
Keep in mind there is no one steering the FreeBASIC project. I wouldn't invest in doing anything business wise with it. O2 is your best choice and the support is unmatched,

Josť Roca

  • Jr. Member
  • **
  • Posts: 78
Re: PowerBASIC
« Reply #19 on: February 22, 2018, 04:31:33 AM »
I'm not here to promote the use of another compiler. I have retired and I no longer care of what others use. I'm waiting to see if Charles finally decides to write documentation for O2.

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 3745
    • Oxygen Basic
Re: PowerBASIC
« Reply #20 on: February 22, 2018, 09:15:57 AM »
There is a manual, very terse I must admit, more like a dictionary, and about 1200 examples which delineate the language. This is all that I can manage at present while completing the alpha phase, so don't hold your breath waiting for a literary masterpiece, yet :)

PB has many black boxes and overlays which don't really benefit programmers when they should be dealing with the Windows API more directly. But I am still interested in seeing how far we can go in providing a compatibility layer for the PB core language.

Josť Roca

  • Jr. Member
  • **
  • Posts: 78
Re: PowerBASIC
« Reply #21 on: February 22, 2018, 11:29:29 AM »
Neither in the help file nor in the examples can I find many of the things if which I'm mostly interested. For example, what about overloading operators and the cast operator?

Josť Roca

  • Jr. Member
  • **
  • Posts: 78
Re: PowerBASIC
« Reply #22 on: February 22, 2018, 12:00:13 PM »
For example, in one of my FreeBsic classes, I have:

Code: [Select]
' ========================================================================================
' Cast operators.
' ========================================================================================
PRIVATE OPERATOR CCur.CAST () AS CURRENCY
   OPERATOR = m_cur
END OPERATOR
' ========================================================================================
' ========================================================================================
PRIVATE OPERATOR CCur.CAST () AS DOUBLE
   OPERATOR = m_cur.int64 / CY_SCALE
END OPERATOR
' ========================================================================================
' ========================================================================================
PRIVATE OPERATOR CCur.CAST () AS STRING
   DIM s AS STRING = STR(m_cur.int64 / CY_SCALE)
   DIM p AS LONG = INSTR(s, ".")
   DIM dec AS STRING
   IF p THEN
      dec = MID(s + "0000", p + 1, 4)
      s = LEFT(s, p) & dec
   END IF
   IF s = "0" THEN s = "0.0000"
   OPERATOR = s
END OPERATOR
' ========================================================================================

' ========================================================================================
' Returns the currency value as a VT_CY variant.
' DIM c AS CCUR = 12345.1234
' DIM v AS VARIANT = c
' cv = v
' ========================================================================================
PRIVATE OPERATOR CCur.CAST () AS VARIANT
   DIM v AS VARIANT, cy AS CURRENCY
   VarCyFromR8(m_cur.int64 / CY_SCALE, @cy)
   v.vt = VT_CY
   v.cyVal = cy
   RETURN v
END OPERATOR
' ========================================================================================

Can I do the same with O2?

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 3745
    • Oxygen Basic
Re: PowerBASIC
« Reply #23 on: February 22, 2018, 01:15:01 PM »
There have been several schemes I've tried in the past but this one is capable of driving raw assembler without any overhead. It is an extension of the macro system and supports both operators and function sets for any type or class requiring operations.

http://www.oxygenbasic.org/forum/index.php?topic=1529.0

It can also be found in Basics/MacroOperations.o2bas, quite a recent addition

Josť Roca

  • Jr. Member
  • **
  • Posts: 78
Re: PowerBASIC
« Reply #24 on: February 22, 2018, 01:44:13 PM »
It says nothing about the CAST operator, which is essential to get data types implemented in classes to work as if they were native data types.

I also don't find anything about overloaded global operators.

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 3745
    • Oxygen Basic
Re: PowerBASIC
« Reply #25 on: February 23, 2018, 05:46:59 AM »
CAST seems to be a misnomer when the true meaning is CONVERT.

Anyway, I like the idea of global operators, which could include all the converter operators for the application. So we will do it. Something like macro generic_op which would be accessible to any user-defined types and classes.

In o2, all primitive types will automatically convert, including strings-to-numbers, and vice-versa.

John

  • Hero Member
  • *****
  • Posts: 3249
Re: PowerBASIC
« Reply #26 on: February 23, 2018, 10:32:51 AM »
Quote
In o2, all primitive types will automatically convert, including strings-to-numbers, and vice-versa.

DLLC is a good example of O2 defining API functions with it's variable types.

Mike Lobanovsky

  • Admin Support Member
  • *****
  • Posts: 1856
Re: PowerBASIC
« Reply #27 on: February 24, 2018, 09:32:57 AM »
Guys,

I'm getting older and wiser and tired of and bored to death with BASICs and the accompanying ado.

But there is still one challenge that could stir me back to life, BASIC-wise. If we could gather at least three active and skilled language developers, Charles and myself included, and could persuade them to swear to stay with the project for at least two years no matter what, I am ready to try and replicate/rewrite/translate/younameit the defunct PowerBASIC in all its diversity in 64 bits, free to use by anybody for any purpose including commercial applications, based on Charles' OxygenBasic engine.

The PB documentation is freely accessible and so complete, clear and concise that it should be practically obvious for a skillful language developer to guess the inner workings of BZ's assembly code.

In this way, we could probably save a few businesses from going broke, and a few lives, from sudden demise. ;)

I did not like what Mrs Zale was doing to PBers in the past, and I do not like what the Drakes are doing to PB now.

This is for the second time over the recent few years that I'm vocalizing this call on this forum. I was full serious then, and I really mean what I'm saying now.
« Last Edit: February 24, 2018, 09:46:01 AM by Mike Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

jcfuller

  • Full Member
  • ***
  • Posts: 143
Re: PowerBASIC
« Reply #28 on: February 24, 2018, 09:58:02 AM »
Mike,
  The Drake's have deep pockets. How to handle a copyright infringement ?

James

John

  • Hero Member
  • *****
  • Posts: 3249
Re: PowerBASIC
« Reply #29 on: February 24, 2018, 10:23:59 AM »
Drake bought PowerBASIC in a fire sale as there was no one else willing to try to unravel Zale's creation. It's too late for PB to go 64 bits.

Quote
How to handle a copyright infringement ?

What in PB is copyrighted? O2 or FreeBASIC were created from scratch using traditional BASIC syntax. Microsoft should have sued Bob Zale for Quick BASIC infringements in the day.

I'm in as O2 is an extension module (DLLC) for Script BASIC.