Recent Posts

Pages: [1] 2 3 ... 10
1
Open Forum / Re: PowerBASIC Forum
« Last post by Josť Roca 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.
2
Open Forum / Re: PowerBASIC Forum
« Last post by Charles Pegge 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
3
Open Forum / Re: PowerBASIC Forum
« Last post by Josť Roca 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?
4
Open Forum / Re: PowerBASIC Forum
« Last post by Josť Roca 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?
5
Open Forum / Re: PowerBASIC Forum
« Last post by Charles Pegge 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.
6
Open Forum / Re: PowerBASIC Forum
« Last post by Josť Roca 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.
7
Open Forum / Re: PowerBASIC Forum
« Last post by John 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,
8
Open Forum / Re: PowerBASIC Forum
« Last post by chrisc 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 ?
9
Bugs & Feature Requests / Re: rtl64 example issues
« Last post by jcfuller on February 21, 2018, 02:44:21 PM »

'==============================================================================
Example Issues
'==============================================================================
examples\Diagnostics
'------------------------------------------------------------------------------
  RegSnapshot.o2bas
    rtl32 only
'------------------------------------------------------------------------------
'==============================================================================
examples\Image
'------------------------------------------------------------------------------
  BmpProcess.o2bas
    fails with both rtl32/64 using
      string bmpfile="C:\OxygenBasic\projectsB\SDL\bmp\Angel.bmp"
'==============================================================================
examples\Linkage
'------------------------------------------------------------------------------
  FuncLinkTbls.o2bas
    fails rtl64
    ok rtl32
'------------------------------------------------------------------------------
'==============================================================================
examples\Math
  Ackermann.o2bas
    Ok rtl32
    Fails rtl64
'------------------------------------------------------------------------------
  BCDMul.o2bas
    ok rtl32
    fails rtl64
'------------------------------------------------------------------------------
  BigBinary.o2bas
    output not the same rtl32/64
'------------------------------------------------------------------------------
  FloorCeil.o2bas
    ok rtl32
    fails rtl64
'------------------------------------------------------------------------------
  MandelTextA
    fails rtl32/64
'------------------------------------------------------------------------------
  Matrix2.o2bas
    fails to compile rtl32/64
'------------------------------------------------------------------------------
  MulHuge.o2bas
    ok rtl32
    fails rtl64
'------------------------------------------------------------------------------
  NegNumFracPow2.o2bas
    will not compile rtl32/64
'------------------------------------------------------------------------------
  PiAlgorithm2.o2bas
    ok rtl32
    fails rtl64
'------------------------------------------------------------------------------
  Random.o2bas
    probably should be checked for output with rtl64
'------------------------------------------------------------------------------
  SuccApproxTrig.o2bas
     no compile rtl32/64
'------------------------------------------------------------------------------
10
Open Forum / Re: PowerBASIC Forum
« Last post by John 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.

Pages: [1] 2 3 ... 10