Search found 12022 matches
- Apr 20, 2024 14:28
- Forum: Beginners
- Topic: Constructor Copy
- Replies: 14
- Views: 626
Re: Constructor Copy
If I knew what you wanted to do with the second 'Superman' type in addition to the first 'SuperHero' type, maybe I could help you?
- Apr 20, 2024 12:29
- Forum: Beginners
- Topic: Constructor Copy
- Replies: 14
- Views: 626
Re: Constructor Copy
- Instead of defining a 'cleanup()' method, you can define a 'destructor()' which will be automatically called before the object is destroyed. - The 'calculate()' method does not use any member fields. So you can declare it as static and simply call it on the type name and not necessarily on the nam...
- Apr 20, 2024 5:35
- Forum: General
- Topic: Const error (Expected End-of-Line)
- Replies: 8
- Views: 1027
Re: Const error (Expected End-of-Line)
New update: Operator [] (String index) ..... Usage: result = lhs [ rhs ] ..... Parameters: lhs : The string (a string reference, not a string returned as local copy) lhs : The string variable or a string reference (not for example a constant or a string returned as a local copy). rhs : A zero-based ...
- Apr 20, 2024 4:56
- Forum: Beginners
- Topic: UDT Constructor with Param
- Replies: 7
- Views: 328
Re: UDT Constructor with Param
Look at the CONSTRUCTOR manual page with the examples.
You can also consult the Programmer's Guide, first on the Constructors and Destructors (basics) page.
You can also consult the Programmer's Guide, first on the Constructors and Destructors (basics) page.
- Apr 19, 2024 13:50
- Forum: General
- Topic: Const error (Expected End-of-Line)
- Replies: 8
- Views: 1027
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...
- Apr 19, 2024 9:19
- Forum: General
- Topic: Const error (Expected End-of-Line)
- Replies: 8
- Views: 1027
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...
- Apr 19, 2024 5:38
- Forum: General
- Topic: Const error (Expected End-of-Line)
- Replies: 8
- Views: 1027
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.
Otherwise in your case, instead of:
s[n]
you can use:
asc(s, n+1)
See the Operator [] (String index) documentation page.
- Apr 16, 2024 7:59
- Forum: Community Discussion
- Topic: Freebasic 1.20.0 Development
- Replies: 270
- Views: 25699
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...
- Apr 14, 2024 11:23
- Forum: General
- Topic: Is this a bug in FreeBasic graphics?
- Replies: 5
- Views: 648
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...
- Apr 14, 2024 7:36
- Forum: General
- Topic: Is this a bug in FreeBasic graphics?
- Replies: 5
- Views: 648
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...
- Apr 14, 2024 5:30
- Forum: General
- Topic: Is this a bug in FreeBasic graphics?
- Replies: 5
- Views: 648
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
To erase the ball, use rather:
put(x, y),EraseBall, Pset
- Apr 13, 2024 11:15
- Forum: General
- Topic: Property Definition does not allow STATIC
- Replies: 6
- Views: 500
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 ...
- Apr 12, 2024 11:51
- Forum: General
- Topic: Property Definition does not allow STATIC
- Replies: 6
- Views: 500
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...
- Apr 12, 2024 10:59
- Forum: General
- Topic: Property Definition does not allow STATIC
- Replies: 6
- Views: 500
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...
- Apr 12, 2024 5:29
- Forum: General
- Topic: Property Definition does not allow STATIC
- Replies: 6
- Views: 500
Re: Property Definition does not allow STATIC
A "feature request" is already filled in since 2013:
#279 Add the static properties feature
#279 Add the static properties feature