FreeBASIC 1.09.0 Release

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by MrSwiss »

dodicat,
dodicat wrote:32 bit seems to be the same either optimised or not (32 fps)
Note that optimising with the official 32 bit compiler gives (32 fps and 38 fps)
There is a difference between 'official' and 'nightly' builds.
The latest 'official' builds in 32/64 bits, come complete with GCC in the package (since 1.07.n I think).
'Nightly' builds default to -gen gas in 32 bits, there isn't any GCC 'on board'.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by dodicat »

By the official build I mean the most up to date build in the news thread of the forum. 1.08.1
I must use the nightly builds of course to try out these new features (#compile).
I don't usually test the nightly builds, but the #compile feature is so radical that I feel I should test it, and I am an fbide user, and this feature affects fbide.
coderJeff
Site Admin
Posts: 4326
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by coderJeff »

dodicat wrote:I use a more complex code (+ graphics) to test the #cmdline
This time if I use use -gen gcc, I get a pile of errors.
Thanks. I can reproduce an error.
I missed some global state in fbc: some static variables buried in subroutines.

This may work for you until I can get fbc patched.

Code: Select all

#cmdline "-gen gcc -Wc -O2"
#cmdline "-end"
coderJeff
Site Admin
Posts: 4326
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by coderJeff »

dodicat wrote:I don't usually test the nightly builds, but the #compile feature is so radical that I feel I should test it, and I am an fbide user, and this feature affects fbide.
Thanks again for the test program. It helped me to unearth a number of issues. I've made improvements and pushed the changes to fbc/master so should be in the next daily build. If you have errors again, I'd like to see them.

Here's what got updated:
- fix: libraries missing from the libraries list after a restart
- fix: error messages hidden after a restart
- fix: bad initialization of IR when switching between backends on a restart (issues with -gen ...)
- change: more options now trigger a full restart due to dependencies at the top end of initialization
- added: print a "Restarting fbc ..." if fbc is restarted and '-v' (verbose) option was given

Under the hood, fbc design has some OOP constructions but uses no OOP features of the compiler to help track or enforce them. Plus lots of global state flying around tucked away in static / shared variables. I very much appreciate the testing.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by dodicat »

Small point.
The new rgb for >= 1.08 is now ulong, which is good.
However the new macro is not one entity anymore, I had to bracket it off to run some old code.
example;

Code: Select all


  'help file for fbc version >= 1.08:
 '#define RGB(r,g,b) CULng((CUByte(r) Shl 16) Or (CUByte(g) Shl 8) Or CUByte(b) Or (&hFF000000ul))
 
 
 #define RGBcol(r,g,b) (CULng((CUByte(r) Shl 16) Or (CUByte(g) Shl 8) Or CUByte(b) Or (&hFF000000ul)))
 '    put brackets     ^                                                                             ^
Function mono(c As Ulong) As Ulong
Var v=.299*((c Shr 16)And 255)+.587*((c Shr 8)And 255)+.114*(c And 255)
Return Rgb(v,v,v)
End Function

screen 19,32

circle(400,300),100,mono rgbcol(200,100,200) ,,,,f
#print typeof(rgbcol(0,0,0))
sleep 
Should this macro behave as one entity or is it OK to have it segmented?
That is the question.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by fxm »

Extract of the FUNCTION documentation page:
When calling a function, parentheses surrounding the argument list (if any) are required only for function calls in expressions.
The 'mono' function used as a parameter of the 'circle' keyword must verify this rule.

This is why:
circle(400,300),100,mono rgb(200,100,200) ,,,,f
does not compile because the right syntax must be:
circle(400,300),100,mono(rgb(200,100,200)) ,,,,f

Adding final parentheses in the 'rgbcol' macro definition only corrects the initial syntax error.

It is true that the old macro had final parentheses, but it was mandatory to respect the operator precedence (due to the 'or' operator at the end of the macro definition):
#define RGB(r,g,b) ((CULng(r) Shl 16) Or (CULng(g) Shl 8) Or CULng(b) Or &hFF000000)
In the new macro, the operator precedence is protected by the final conversion ('culng()'):
#define RGB(r,g,b) CULng((CUByte(r) Shl 16) Or (CUByte(g) Shl 8) Or CUByte(b) Or (&hFF000000ul))

Same behavior for 'rgba'.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by dodicat »

I know fxm, I had to change things.
If you have some graphics code and want to show it in mono then your ide can change rgb to o rgb where rgb was bracketed before.
Now I must also change rgb.
Example

Code: Select all


#define mono

#define RGBcol(r,g,b) (CULng((CUByte(r) Shl 16) Or (CUByte(g) Shl 8) Or CUByte(b) Or (&hFF000000ul)))

#ifdef mono
Function o(c As Ulong) As Ulong
Var v=.299*((c Shr 16)And 255)+.587*((c Shr 8)And 255)+.114*(c And 255)
Return Rgb(v,v,v)
End Function
#else
#define o 
#endif

Screen 20,32
Dim Shared As Integer xres,yres
Screeninfo xres,yres
Type Point
    As Single x,y,z
    #define vct Type<Point>
End Type
Type Line
    As Single x1,y1,x2,y2
End Type
Type particle
    As Point position,velocity
End Type
Type screendata
    As Integer w,h,depth,bpp,pitch
    As Any Pointer row
    As Ulong Pointer pixel
    As Ubyte Pointer pixel8
End Type
Dim Shared As screendata s

With s
    Screeninfo .w,.h,.depth,.bpp,.pitch
    .row=Screenptr
End With

Operator + (v1 As Point,v2 As Point) As Point
Return vct(v1.x+v2.x,v1.y+v2.y,v1.z+v2.z)
End Operator
Operator -(v1 As Point,v2 As Point) As Point
Return vct(v1.x-v2.x,v1.y-v2.y,v1.z-v2.z)
End Operator
Operator * (f As Single,v1 As Point) As Point 'scalar*point
Return vct(f*v1.x,f*v1.y,f*v1.z)
End Operator
Operator * (v1 As Point,f As Single) As Point 'point*scalar
Return f*v1
End Operator

Function length(v As Point) As Single
    Return Sqr(v.x*v.x+v.y*v.y+v.z*v.z)
End Function

Function normalize(v As Point) As Point
    Dim n As Single=length(v)
    If n=0 Then n=1e-20
    Return vct(v.x/n,v.y/n,v.z/n)
End Function

Sub bline(sd As screendata,x1 As Long,y1 As Long,x2 As Long,y2 As Long,col As Ulong)
    #macro ppset(_x,_y,colour)
    sd.pixel=sd.row+sd.pitch*(_y)+(_x) Shl 2
    *sd.pixel=(colour)
    #endmacro
    #macro ppset8(_x,_y,colour)
    sd.pixel8=sd.row+sd.pitch*(_y)+(_x)
    *sd.pixel8=(colour)
    #endmacro
    
    #define onscreen ((x1+x)>=0) And ((x1+x)<(sd.w-1)) And ((y1+y)>=0) And ((y1+y)<(sd.h-1))
    
    Var dx=Abs(x2-x1),dy=Abs(y2-y1),sx=Sgn(x2-x1),sy=Sgn(y2-y1)
    Dim As Long e
    If dx<dy Then e=dx\2 Else e=dy\2
    Do
        For x As Long=0 To 1
            For y As Long=0 To 1
                If onscreen Then
                    If sd.depth=8 Then: ppset8((x1+x),(y1+y),col):End If
                    If sd.depth=32 Then: ppset((x1+x),(y1+y),col):End If
                End If
            Next y
        Next x
        If x1 = x2 Then If y1 = y2 Then Exit Do
        If dx > dy Then
            x1 += sx : e -= dy : If e < 0 Then e += dx : y1 += sy
        Else
            y1 += sy : e -= dx : If e < 0 Then e += dy : x1 += sx
        End If
    Loop
End Sub

Sub thickline(sd As screendata,_
    x1 As Long,_
    y1 As Long,_
    x2 As Long,_
    y2 As Long,_
    thickness As Long,_
    colour As Ulong)
    Dim As Single yp,s,h,c
    h=Sqr((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
    s=(y1-y2)/h
    c=(x2-x1)/h
    For yp=-thickness/2 To thickness/2 
        bline(sd,x1+(s*yp),y1+(c*yp),x2+(s*yp),y2+(c*yp),colour)
    Next yp
End Sub

'=================================
Sub LINETO(L As Line,lngth As Single,Byref x As Single=0,Byref y As Single=0,col As Ulong=1,th As Single=1)
    Dim As Single diffx=L.x2-L.x1,diffy=L.y2-L.y1,ln=Sqr(diffx*diffx+diffy*diffy)
    Dim As Single nx=diffx/ln,ny=diffy/ln 'normalize
    thickline(s,L.x1,L.y1,L.x1+lngth*nx,L.y1+lngth*ny,th,col)
    x=L.x1+lngth*nx
    y=L.y1+lngth*ny
End Sub

Function swing(px As Single,inc As Single) As Single
    Return px+200*Cos(inc)+15
End Function

Sub Tree(i As Any Ptr=0,x1 As Single,y1 As Single,size As Single,angle As Single,depth As Single,colb As Ulong=0,colL As Ulong=0)
    Dim  As Single spread,scale,x2,y2
    spread=25
    scale=.76
    #define incircle(cx,cy,radius,x,y) (cx-x)*(cx-x) +(cy-y)*(cy-y)<= radius*radius
    x2=x1-.25*size*Cos(angle*.01745329)
    y2=y1-.25*size*Sin(angle*.01745329)
    Static As Long count,fx,fy,sz,z
    If count=0 Then  fx=x1:fy=y1:sz=size:z=2^(depth+1)-1
    Line i,(x1,y1)-(x2,y2),colb
    If count=0 Then  fx=x2:fy=y2:sz=size
    count=count+1
    If count>z Then count=0
    If incircle(fx,fy,(.45*sz),x2,y2)=0 Then Circle i,(x2,y2),.01*sz,colL
    If depth>0 Then
        Tree(i,x2, y2, size * Scale, angle - Spread, depth - 1,colB,colL)
        Tree(i,x2, y2, size * Scale, angle + Spread, depth - 1,colB,colL)
    End If
End Sub


Function legs2(xpos As Single,ypos As Single,inc As Single,thick As Single=9,lngth As Single=60) As Long
    Dim As Single endx,endy
    ypos+=5
    Static As Single dx,dy,ynow
    dx-=1*.5
    xpos+=dx
    ypos-=(dy)
    If dy<>0 Then ynow=ypos
    If xpos>279 Then dy-=.7*.5 Else ypos=ynow:dy=0
    If xpos<130 Then ynow+=5
    Var _ypos=ypos+.1*lngth*Sin(2*inc)
    Dim As Line start=Type(xpos,_ypos,swing(xpos,inc),600)
    Dim As Line body=Type<Line>(xpos,_ypos,-.5*xres,-2*yres)
    lineto(body,1.2*lngth,endx,endy,o rgbcol(0,200,0),thick)
    Circle(endx,endy),.015*yres,o rgbcol(200,200,0),,,,f
    lineto(start,lngth,endx,endy,o rgbcol(200,50,50),thick)
    start=Type(endx,endy,swing(xpos+200,inc-1),600)
    lineto(start,1.1*lngth,endx,endy,o rgbcol(200,50,50),thick)
    Var diff=4*Atn(1)
    start=Type(xpos,_ypos,swing(xpos,diff+inc),600)
    lineto(start,lngth,endx,endy,o rgbcol(200,50,50),thick)
    start=Type(endx,endy,swing(xpos+200,diff+inc-1),600)
    lineto(start,1.1*lngth,endx,endy,o rgbcol(200,50,50),thick)
    Return ypos
End Function
'==================================================
Sub drawline(x As Long,y As Long,angle As Single,lngth As Double,col As Ulong,Byref x2 As Single=0,Byref y2 As Single=0,flag As Long=1)
    angle=angle*Atn(1)/45
    x2=x+lngth*Cos(angle)
    y2=y-lngth*Sin(angle)
    If flag Then ThickLine(s,x,y,x2,y2,0,col)
End Sub

Sub drawstep(x As Long,y As Long,angle As Single,lngth As Double,col As Ulong,Byref x2 As Single=0,Byref y2 As Single=0,flag As Long=1)
    drawline(x,y,angle+180,.8*lngth,col,x2,y2,flag)
    drawline(x2,y2,angle-90,.6*lngth,col,x2,y2,flag)
    ThickLine(s,x,y,x2,y2,0,col)
End Sub

Sub star(starX As Single,starY As Single,size As Single,col As Ulong,num As Long=5,rot As Single=0,cut As Single=.4)
    Var count=0,rad=0.0,_px=0.0,_py=0.0,pi=4*Atn(1),prime=o rgbcol(255,254,253)
    For x As Long=1 To 2
        For z As Single=0+.28 +rot To 2*pi+.1+.28 +rot Step 2*pi/(2*num)
            count=count+1
            If count Mod 2=0 Then rad=size Else rad=cut*size
            _px=starx+rad*Cos(z)
            _py=stary+rad*Sin(z)
            If count=1 Then Pset (_px,_py)Else Line -(_px,_py),prime
        Next z
        Paint (starx,stary),prime,prime
        count=0:prime=col
    Next x
End Sub

Sub trace(In() As Point,Outarray() As Point,roundedness As Single=60)
    Dim As particle p:roundedness=roundedness/10
    If roundedness<1 Then roundedness=1
    If roundedness>100 Then roundedness=10
    p.position=In(Lbound(In))
    p.velocity=normalize(Type<Point>(In(Lbound(In)+1)-In(Lbound(In))))
    Redim Preserve Outarray(1 To Ubound(Outarray)+1)
    Outarray(Ubound(Outarray))=Type<Point>(In(Lbound(In)).x,In(Lbound(In)).y,In(Lbound(In)).z)
    Dim As Point f
    For n As Long=Lbound(In) To Ubound(In)-1
        Do
            Var dist=length(p.position-In(n+1))
            f=(1/(Ubound(In)))*f+normalize(In(n+1)-p.position)
            p.velocity= roundedness*normalize(p.velocity+f)
            p.position=p.position+p.velocity
            Redim Preserve Outarray(1 To Ubound(Outarray)+1)
            Outarray(Ubound(Outarray))=Type<Point>(p.position.x,p.position.y,p.position.z)
            If dist<5*roundedness Then Exit Do
        Loop Until Len(Inkey)
    Next n
    Redim Preserve Outarray(1 To Ubound(Outarray)+1)
    Outarray(Ubound(Outarray))=Type<Point>(In(Ubound(In)).x,In(Ubound(In)).y,In(Ubound(In)).z)
End Sub

Sub setpoints(In() As Point)
    Dim As Long x1,y1,x2,y2
    Dim As Single pi=4*Atn(1)
    Dim As Long X',Y
    #define Y (y2-y1)*(X-x1)/(x2-x1) + y1
    #define ub Ubound(in)
    #macro arcs(xc,yc,R,b,e,s)
    For z As Single=b To e Step s
        Var xx=xc+R*Cos(z),yy=yc+R*Sin(z)
        Redim Preserve in(1 To ub+1)
        in(ub)=vct(xx,yy,0)
    Next z
    #endmacro
    x1=.3*xres
    y1=.56*yres
    x2=.8*xres
    y2=.1*yres
    
    Redim in(1 To 5)
    in(1)=vct(x1,y1,0)
    X=.4*xres
    in(2)=vct(X,Y,0)
    X=.6*yres
    in(3)=vct(X,Y,0)
    X=.7*xres
    in(4)=vct(X,Y,0)
    in(5)=vct(.8*xres,Y,0)
    Var rad=.15*yres
    Var cx=x2,cy=Y+rad
    arcs(cx,cy,(rad),((3/4)*2*pi+.2),((3/4)*2*pi+1*pi),.3)
    Redim Preserve in(1 To ub+1)
    in(ub)=vct(in(4).x,.488*yres,0)
    Redim Preserve in(1 To ub+1)
    in(ub)=vct(x1,.85*yres,0)
    Redim Preserve in(1 To ub+1)
    in(ub)=vct(x1-.12*xres,.85*yres,0)
    cx=.18*xres:cy=.7*yres
    arcs(cx,cy,rad,pi/2,((3/4)*2*pi),.3)
    Redim Preserve in(1 To ub+1)
    in(ub)=vct(x1,y1,0)
    X=.31*xres
    'in(2)=vct(X,Y,0)
    Redim Preserve in(1 To ub+1)
    'in(ub)=vct(in(2).x,in(2).y,0)
    in(ub)=vct(X,Y,0)
End Sub

Function _mod(n As Long) As Long
    If n Mod 41=0 Then Return 1
    Return n Mod 41
End Function


Function Regulate(Byval MyFps As Long,Byref fps As Long=0) As Long
    Static As Double timervalue,lastsleeptime,t3,frames
    Var t=Timer
    frames+=1
    If (t-t3)>=1 Then t3=t:fps=frames:frames=0
    Var sleeptime=lastsleeptime+((1/myfps)-T+timervalue)*1000
    If sleeptime<1 Then sleeptime=1
    lastsleeptime=sleeptime
    timervalue=T
    Return sleeptime
End Function


Sub createscene(Byref i As Any Ptr)
    #define map(a,b,x,c,d) ((d)-(c))*((x)-(a))/((b)-(a))+(c)
    #define range(f,l) Int(Rnd*((l+1)-(f))+(f))
    Line i,(0,0)-(1024,768),0,bf
    For n As Long=0 To 600
        Var red=map(0,600,n,0,255)
        Var green=map(0,600,n,0,255)
        Var blue=map(0,600,n,100,255)
        Line i,(0,n)-(1024,n),o rgbcol(red,green,blue)
    Next
    
    Circle i,(512,10000),10000-410,o rgbcol(200,100,0),,,,f
    For n As Long=1 To 300 
        Var xpos=Rnd*1024,ypos=range(420,868)
        Var rd=range(0,200)
        Var sz=map(420,768,ypos,5,150)
        If ypos<550 Then Circle i,(xpos,ypos),sz/3,o rgbcol(100,50,0),,,.2,f
        Tree(i,xpos,ypos,sz,range(80,100),12,o rgbcol(20,10,0),o rgbcol(rd,range(rd,250),20))
    Next n
End Sub

Redim As Point in(0)
setpoints(in())
Redim As Point PTS(0)

trace(in(),PTS(),20)

'840 gap 40 ish
Dim As Long gap=Ubound(PTS)/40
Dim As Long k,n,fps,flag
Dim As Single angle,pi2=8*Atn(1)
Dim As Single inc
Dim As Any Ptr i=Imagecreate(1024,768)
createscene(i)
Do
    k=k+1
    angle=angle+.019
    k=_mod(k)
    inc=inc+.06
    If inc>=pi2 Then inc=0
    If angle>=pi2 Then angle=0
    
    Screenlock
    Cls
    Put(0,0),i,Pset
    
    'stanchions
    thickline(s,.26*xres,.49*yres,.26*xres,yres,10,o rgbcol(0,100,200))
    thickline(s,.68*xres,.25*yres,.68*xres,yres,10,o rgbcol(0,100,200))
    
    thickline(s,.7*xres,.54*yres,.7*xres,yres,10,o rgbcol(50,0,200))
    thickline(s,.275*xres,.81*yres,.275*xres,yres,10,o rgbcol(50,0,200))
    
    thickline(s,.79*xres,.35*yres,.79*xres,yres,20,o rgbcol(50,0,20))
    thickline(s,.16*xres,.71*yres,.16*xres,yres,20,o rgbcol(50,0,20))
    
    Var snooze=regulate(55,fps)
    Draw String(20,20),"FPS  " & fps
    For n =k-2*gap To Ubound(PTS) Step gap\2
        If n>0 Then
            drawstep(PTS(n).x,PTS(n).y,0,1.1*gap,o rgbcol(200,0,0))
        End If
    Next n
    
    'main gears
    
    star(.79*xres,.35*yres,yres/7.5,o rgbcol(100,40,0),18,angle,.8)
    star(.16*xres,.71*yres,yres/7.5,o rgbcol(0,40,100),18,angle,.8)
    'rollers
    star(.26*xres,.49*yres,yres/15,o rgbcol(100,40,0),18,-angle,.8)
    star(.68*xres,.255*yres,yres/30,o rgbcol(100,100,100),20,2*angle,.9)
    
    star(.275*xres,.81*yres,yres/30,o rgbcol(100,100,100),20,2*angle,.9)
    star(.7*xres,.54*yres,yres/30,o rgbcol(100,100,100),20,-2*angle,.9)
    If legs2(.6*xres,.14*yres,inc,.012*yres,.05*yres)>750 Then flag=1
    Screenunlock
    Sleep snooze,1
    If flag Then Exit Do
Loop Until Len(Inkey)
Sleep
Imagedestroy i 
It is no big deal really, the ide can search and replace rgb with o rgbcol, after I have defined rgbcol.
The idea is you have the option of black and white or technicolour in line 1
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by fxm »

As 'o' is either a function or a define, used in expressions, for me the better syntax should be to use:
o(rgb(...))
instead of
o rgbcol(...)
all over.

I just did it on your fine example.
It is not very long !
speedfixer
Posts: 606
Joined: Nov 28, 2012 1:27
Location: CA, USA moving to WA, USA
Contact:

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by speedfixer »

I don't understand. You (fxm) edited dodicat's post? The original post is now not available?
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by fxm »

I didn't do anything at all.
The first post from dodicat on this topic is still here (and not modified): viewtopic.php?p=285612#p285612
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by dodicat »

Thank you fxm, probably best to just add the brackets round rgb.
Speedfixer, the code hasn't vanished here.
coderJeff
Site Admin
Posts: 4326
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by coderJeff »

Update: I've fixed a number of bugs related to symbol lookups which should give more consistent behaviour with symbol names. Specifically, symbol names that shadow other symbol names, and accessing symbols through explicit namespace names, 'this' keyword, and global scope resolution operator.

- sf.net #645: respect global namespace '.' and '..' prefixes in REDIM
- sf.net #645: don't access locals if explicit namespace is given on identifier
- sf.net #645: don't access locals if explicit global namespace '.' and '..' prefixes are given on identifier
- sf.net #645: throw compile time error if scoped REDIM variable shadows a variable of the same name
- sf.net #581: Locals break/override THIS access to inherited members
- sf.net #871: Inherited methods without this shadowed by global functions
- sf.net #730: Using quirk keywords as identifier leads to parsing problems later

For example, just one of the fixes:

Code: Select all

redim shared array(1 to 2) as byte
#print typeof( array )  '' BYTE

scope
	redim array(1 to 3)    '' access the global scoped array()
	#print typeof( array ) '' BYTE

	dim array() as integer '' a new array() array in the local scope
	#print typeof( array ) '' INTEGER

	redim array(1 to 4)    '' the local scoped array()
	#print typeof( array ) '' INTEGER

	redim ..array(1 to 4)    '' access the global scoped array() - now fixed
	#print typeof( ..array ) '' BYTE
end scope
Please report any issues if your existing code breaks. It's possible there's a new bug still to be resolved, or it could be that your code depended on old existing buggy behaviour.
Xusinboy Bekchanov
Posts: 789
Joined: Jul 26, 2018 18:28

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by Xusinboy Bekchanov »

The error appears here:
robert wrote:Hi Xusinboy:

Trying to compile VisualFBEditor on Linux

fbc "VisualFBEditor.bas" -x "../VisualFBEditor64_gtk3" -i ../MyFbFramework -d __USE_GTK3
__
VisualFBEditor/MyFbFramework/mff/Menus.bas(586) error 58: Type mismatch, at parameter 1 (Expression) of REPLACE()
VisualFBEditor/MyFbFramework/mff/Application.bas(101) error 181: Invalid assignment/conversion, before '('
VisualFBEditor/MyFbFramework/mff/Application.bas(125) error 58: Type mismatch, at parameter 2 (txt) of WLET()
VisualFBEditor/MyFbFramework/mff/TextBox.bas(1220) error 255: Ambiguous symbol access, explicit scope resolution required, found 'Left'
VisualFBEditor/src/EditControl.bas(308) error 255: Ambiguous symbol access, explicit scope resolution required, found 'Left'
VisualFBEditor/src/EditControl.bas(316) error 255: Ambiguous symbol access, explicit scope resolution required, found 'Left'
VisualFBEditor/src/EditControl.bas(393) error 255: Ambiguous symbol access, explicit scope resolution required, found 'Left'
VisualFBEditor/src/EditControl.bas(595) error 255: Ambiguous symbol access, explicit scope resolution required, found 'Left'
VisualFBEditor/src/EditControl.bas(711) error 255: Ambiguous symbol access, explicit scope resolution required, found 'Left'
VisualFBEditor/src/EditControl.bas(849) error 255: Ambiguous symbol access, explicit scope resolution required, found 'Left'
VisualFBEditor/src/EditControl.bas(849) error 133: Too many errors, exiting
Any use of the Left operator shows as erroneous.
I have a Left property for components and controls.
But they have a different number of parameters though.
coderJeff
Site Admin
Posts: 4326
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by coderJeff »

@Xusinboy, thanks.
Recent commit fbc: fixed / changed symbol lookups to search the entire symbol hash list from 2021-10-03 is causing the issue. The changes I made pass simple test cases. Obviously not for deeply nested hierarchies. Your framework is a monster. Hopefully I can narrow it down to something I can debug.

To fix the old bad bugs with namespaces, my choices are either rewrite the symbol database or work with what we have. I will first try to fix this new problem rather than revert the change and start over.
Xusinboy Bekchanov
Posts: 789
Joined: Jul 26, 2018 18:28

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by Xusinboy Bekchanov »

coderJeff wrote:@Xusinboy, thanks.
Recent commit fbc: fixed / changed symbol lookups to search the entire symbol hash list from 2021-10-03 is causing the issue. The changes I made pass simple test cases. Obviously not for deeply nested hierarchies. Your framework is a monster. Hopefully I can narrow it down to something I can debug.

To fix the old bad bugs with namespaces, my choices are either rewrite the symbol database or work with what we have. I will first try to fix this new problem rather than revert the change and start over.
In Windows it gives the following errors:
07:21:23: Compilation: "D:\FreeBasic\fbc_win32_mingw_0737_2021-10-03\fbc_win32_mingw\fbc.exe" -b "VisualFBEditor.bas" -exx -v -x "../VisualFBEditor32.exe" "VisualFBEditor.rc" -s console -i "D:\GitHub\VisualFBEditor/./MyFbFramework" -i "D:\FreeBasic\fbc_win32_mingw_0737_2021-10-03\fbc_win32_mingw\inc"

FreeBASIC Compiler - Version 1.09.0 (2021-10-03), built for win32 (32bit)
Copyright (C) 2004-2021 The FreeBASIC development team.
standalone
target: win32, 486, 32bit
backend: gas
compiling: VisualFBEditor.bas -o VisualFBEditor.asm (main module)
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Bitmap.bas(382) error 18: Element not defined, Left
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Bitmap.bas(383) error 18: Element not defined, Top
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Bitmap.bas(384) error 18: Element not defined, Right
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Bitmap.bas(385) error 18: Element not defined, Bottom
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Bitmap.bas(388) warning 3(2): Passing different pointer types, at parameter 2 of FILLRECT()
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Bitmap.bas(396) error 3: Expected End-of-Line, found '='
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Bitmap.bas(397) error 3: Expected End-of-Line, found '='
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Bitmap.bas(398) error 3: Expected End-of-Line, found '='
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Bitmap.bas(399) error 3: Expected End-of-Line, found '='
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Bitmap.bas(400) warning 3(2): Passing different pointer types, at parameter 2 of FILLRECT()
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Canvas.bas(192) error 1: Argument count mismatch, found ')'
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Canvas.bas(216) error 1: Argument count mismatch, found ')'
D:\GitHub\VisualFBEditor\MyFbFramework\mff\Canvas.bas(216) error 133: Too many errors, exiting

07:21:25: Do not build file.
This is due to the fact that there is a Rect type definition in the GdiPlusTypes.bi and windef.bi file. I don’t understand how to fix it.
Post Reply