Author Topic: stray comma  (Read 2798 times)

0 Members and 2 Guests are viewing this topic.

Peter

  • Guest
stray comma
« on: April 06, 2016, 04:51:20 AM »
Hello Mister Pegge,

before you continue, your latest oxygen.dll has a bug.
take a look below at "stray comma.jpg"
Code: [Select]
include "gdip.inc"
window 640,480,1
hdc = GetBufferDC()

%UnitPixel = 2
%UnitPoint = 3   

Type RectF
   single x
   single y
   single w
   single h
End Type

Extern Lib "gdiplus.dll"
! GdipCreateFontFamilyFromName
! GdipDeleteFontFamily
! GdipCreateSolidFill
! GdipDrawString
! GdipCreateFont
! GdipDeleteFont
! GdipDeleteBrush
End Extern

wstring font

Sub SetFontEx(wstring fontname)
    font = fontname
end sub   

Sub DrawString(single x, y, height, wstring txt)
    RECTF fRect = {x, y, ScrW, ScrH}    '<<   here is the wrongdoer             
    sys pFont, pFontFamily, pBrush
    GdipCreateFontFamilyFromName font, NULL, &pFontFamily
    GdipCreateFont pFontFamily, height, FontStyleRegular, UnitPoint, &pFont
    GdipCreateSolidFill 0xFFFFFFFF, &pBrush
    GdipDrawString hdc, txt, Len(txt), pFont, fRect, NULL, pBrush
    GdipDeleteFont  pFont
    GdipDeleteBrush pBrush
    GdipDeleteFontFamily pFontFamily
End Sub

SetFontEx "david"
DrawString 100,100,24,"Hello GdiPlus World"
SetFontEx "georgia"
DrawString 100,124,24,"Hello GdiPlus World"
SetFontEx "gisha"
DrawString 100,158,24,"Hello GdiPlus World"
SetFontEx "impact"
DrawString 100,186,24,"Hello GdiPlus World"
setfontEx "wingdings"
DrawString 100,300,24,"OOOOOOOOOOOO"
DrawString 100,330,24,"XXXXXXXXXXXXXXX"

for i=0 to 640 step 40
    DrawString i,0x0,24,"a"
    DrawString i,430,24,"b"
next

waitkey
winEnd

.

Arnold

  • Guest
Re: stray comma
« Reply #1 on: April 06, 2016, 06:39:23 AM »
Hallo Peter,

"stray comma:" means: there is an error in your code. I get this message often with my code. I did these changes:

Sub DrawString(single x, y, height, wstring txt) ' what is the purpose of height?
    w=Scrw() : h=ScrH()
    RECTF fRect = {x, y, w, h}    '<<   here is the wrongdoer
...

Did you expect this output?

Roland           




.

Peter

  • Guest
Re: stray comma
« Reply #2 on: April 06, 2016, 10:08:02 AM »
Hi Roland,

use oxygen.dll, april o5.2o16!
older dll's work.


Arnold

  • Guest
Re: stray comma
« Reply #3 on: April 06, 2016, 12:18:16 PM »
Using Oxygen.dll with version A41 24/04/2015 I can confirm that the program will run. Yet some other things will not work correctly with this version. I do not know when the behaviour changed. But using Oxygen.dll with version A41 08/06/2015 will show the error message.

Roland

Charles Pegge

  • Guest
Re: stray comma
« Reply #4 on: April 06, 2016, 01:30:56 PM »
The bug appears to affect calls to declared functions (usually library functions) within a multi-assign.

I will need sleep to discover the source and the remedy !
« Last Edit: April 09, 2016, 12:39:06 AM by Charles Pegge »

Charles Pegge

  • Guest
Re: stray comma
« Reply #5 on: April 09, 2016, 12:51:34 AM »
Hi Peter,

Fixed.

Oxygen DLL Update (200k) 8 April 2016
http://www.oxygenbasic.org/o2zips/Oxygen.zip