IT-Consultant: Charles Pegge > OxygenBasic

Learning from the [Errors in the] OxygenBasic demo examples.

(1/2) > >>

Roland Stowasser:
Hi Charles,

Since I have to reorient myself a bit in OxygenBasic, I let the apps run in Demos/Basics. Unfortunately four programs showed an error message:

iteration.o2bas:
ERROR:   not found
WORD:    }
COL:    3
LINE:    43

linenumbers1.o2bas:
ERROR:   not found
WORD:    a
COL:    7
LINE:    9

linenumbers2.o2bas:
ERROR:   not found
WORD:    a
COL:    7
LINE:    9

subroutine.o2bas:
ERROR:   unclosed brackets at end of script (1)
LINE:    29

I assume these reports are side effects of the recent changes at O2?

[TG: Added something to Headline to get more attention for the topic :-).]

Charles Pegge:
Many thanks Roland,

I've updated 050P11.
https://github.com/Charles-Pegge/OxygenBasic/blob/master/OxygenBasic050P11.zip

The most serious problem disabled autodim variable creation in the linenumbers examples

Roland Stowasser:
Hi Charles,

there is \demo\WinDynDialogs\Pgbar3d.o2bas which doesn't work properly anymore. It worked once with version 04/2020. The error occurs in Pgbar3d.inc, line 169 of the CreatePGBar3D function. I'm not sure what has changed in the meantime. Do I need to use stricter argument handling in CreateWindowEx?

Charles Pegge:
Hi Roland,

pgbar3D3 works, but pgBar3D does not. What are the differences which might cause the CreatePGBar3D function to fail?

Roland Stowasser:
Hi Charles,

if I modify Pgbar3d.inc and add in function CreatePGBar3D starting at about line 162 int x,y,w,h then Pgbar3d.o2bas works:


--- Code: ---...
  if DlgUnits then
      RECT rc = {0, 0, 4, 8}
      MapDialogRect (hParent, @rc)
      float PixelX = rc.right/4
      float pixelY = rc.bottom/8
      int x = vLeft*PixelX
      int y = vTop*PixelY)
      int w = vWidth*PixelX
      int h = vHeight*PixelY
      'create control using dialog units
      hBar = CreateWindowEx(wStyleEx, "PGBAR3D",  null, wStyle,
                           'int(vLeft*PixelX), int(vTop*PixelY), int(vWidth*PixelX), int(vHeight*PixelY),
                           x,y,w,h,
                           hParent, id, GetWindowLongPtr(hParent, GWL_HINSTANCE),  null)
      if hBar = 0 then mbox "Error 1: CreateWindowEx PGBAR3D failed" 
   else
      'create control using pixels
      hBar = CreateWindowEx(wStyleEx, "PGBAR3D",  null, wStyle,
                           vLeft, vTop, vWidth, vHeight,
                           hParent, id, GetWindowLongPtr(hParent, GWL_HINSTANCE),  null)
      if hBar = 0 then mbox "Error 2: CreateWindowEx PGBAR3D failed"
   end if
   
   if hBar and len(txt) then SetWindowText(hBar, txt)
   function = hBar
end function
...

--- End code ---

This is what I mean with stricter handling of arguments. Or is there another way with casting? E.g. int(vLeft*PixelX) does not work anymore.

Navigation

[0] Message Index

[#] Next page

Go to full version