Search found 11988 matches

by fxm
Apr 19, 2024 13:50
Forum: General
Topic: Const error (Expected End-of-Line)
Replies: 5
Views: 169

Re: Const error (Expected End-of-Line)

a string reference, not a string returned as local copy The explanation in the help for this case is not very clear. But after you explained, it is now clear. Small update: Operator [] (String index) ..... Usage: result = lhs [ rhs ] ..... Parameters: lhs : The string (a string reference, not a str...
by fxm
Apr 19, 2024 9:19
Forum: General
Topic: Const error (Expected End-of-Line)
Replies: 5
Views: 169

Re: Const error (Expected End-of-Line)

Operator [] (String index) ..... Usage: result = lhs [ rhs ] ..... Parameters: lhs : The string ( a string reference, not a string returned as local copy ). rhs : A zero-based offset from the first character. ..... Example: Function returnByval(Byref s As String) As String Return s End Function Fun...
by fxm
Apr 19, 2024 5:38
Forum: General
Topic: Const error (Expected End-of-Line)
Replies: 5
Views: 169

Re: Const error (Expected End-of-Line)

The string index operator ('[]') applies only to references.
Otherwise in your case, instead of:
s[n]
you can use:
asc(s, n+1)

See the Operator [] (String index) documentation page.
by fxm
Apr 16, 2024 7:59
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 24767

Re: Freebasic 1.20.0 Development

Should we now disallow 'SIZEOF(array_name)' and even more so 'LEN(array_name)' ? ..... Also remember to take into account at the same time the bug report: #821 LEN() and SIZEOF() should not be allowed when used with bitfields Example grouping together all these cases of inconsistent LEN/SIZEOF valu...
by fxm
Apr 14, 2024 11:23
Forum: General
Topic: Is this a bug in FreeBasic graphics?
Replies: 5
Views: 591

Re: Is this a bug in FreeBasic graphics?

How to optimize the size of image buffers: Screenres 640, 480, 32 Dim As Integer x, y, i x = 37: y = 37 Dim As Any Ptr DrawBall = ImageCreate( 75, 75, RGB(255, 255, 255)) '' 75*75 pixels from index : 0 to 74 CIRCLE DrawBall, (x, y), 37, RGB(0, 255, 0),,,,F ' Green '' circle from index : 37-37=0 to 3...
by fxm
Apr 14, 2024 7:36
Forum: General
Topic: Is this a bug in FreeBasic graphics?
Replies: 5
Views: 591

Re: Is this a bug in FreeBasic graphics?

Minimum code without 'Put' : Dim As Integer x = 40, y = 40 Screenres 640, 480, 32 For i As Integer = 1 To 140 ScreenLock CIRCLE (x, y), 37, RGB(0, 0, 0),,,,F '' erase the previous ball x += 4 '' move the ball 4 pixels at a time CIRCLE (x, y), 37, RGB(0, 255, 0),,,,F '' draw the ball ScreenUnlock Sle...
by fxm
Apr 14, 2024 5:30
Forum: General
Topic: Is this a bug in FreeBasic graphics?
Replies: 5
Views: 591

Re: Is this a bug in FreeBasic graphics?

With 'Put', the default method used to draw the image to the destination buffer is XOR.
To erase the ball, use rather:
put(x, y),EraseBall, Pset
by fxm
Apr 13, 2024 11:15
Forum: General
Topic: Property Definition does not allow STATIC
Replies: 6
Views: 445

Re: Property Definition does not allow STATIC

Alternatively, you can use a non-static member property (which accesses the static integer member) and call it on any instance opportunity, or on a null pointer or null reference to the 'Type' (provided the property body does not use 'This' ). Type Gobject Public: Declare Property Prop1(Byval I As ...
by fxm
Apr 12, 2024 11:51
Forum: General
Topic: Property Definition does not allow STATIC
Replies: 6
Views: 445

Re: Property Definition does not allow STATIC

Alternatively, you can use a non-static member property (which accesses the static integer member) and call it on any instance opportunity, or on a null pointer or null reference to the 'Type' (provided the property body does not use 'This' ). Type Gobject Public: Declare Property Prop1(Byval I As I...
by fxm
Apr 12, 2024 10:59
Forum: General
Topic: Property Definition does not allow STATIC
Replies: 6
Views: 445

Re: Property Definition does not allow STATIC

But this new feature seems to be not very easy, mainly because of a parser problem. Example of the parser syntax problem for STATIC PROPERTIES without index parameter: There is a syntax ambiguity between one of property result assignment syntaxes inside the get-property body and the set-property cal...
by fxm
Apr 12, 2024 5:29
Forum: General
Topic: Property Definition does not allow STATIC
Replies: 6
Views: 445

Re: Property Definition does not allow STATIC

A "feature request" is already filled in since 2013:
#279 Add the static properties feature
by fxm
Apr 11, 2024 5:13
Forum: Sources, Examples, Tips and Tricks
Topic: Simple 2D Ball Collision Demo
Replies: 10
Views: 719

Re: Simple 2D Ball Collision Demo

neil wrote: Apr 10, 2024 22:36 The FB Gfx lib: version won't compile because of this line.

Line 103 .x -= t1Sleep (1)
easy (stuttering):
.x -= t1
by fxm
Apr 08, 2024 14:20
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 24767

Re: Freebasic 1.20.0 Development

No, it alsp works.
(have you refreshed your mff page?)

Check your fbc.exe:

Code: Select all

Print __FB_BUILD_DATE_ISO__
2024-04-07
by fxm
Apr 07, 2024 11:01
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 24767

Re: Freebasic 1.20.0 Development

With the latest fixes, Put# now works with arrays again (thanks).

SARG wrote: Apr 07, 2024 8:37 Doing thing too fast before homework in the garden under a nice sun :-)
In the south perhaps?
by fxm
Apr 07, 2024 9:02
Forum: Community Discussion
Topic: Where can I get a Recent-Git-Build of FreeBASIC?
Replies: 639
Views: 175705

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Yes.
Last night fixes (around 3:30am for us) arrived too late for the daily builds (around 2:00am for us).
We have to wait until next night.