Search found 12010 matches

by fxm
Mar 30, 2024 20:06
Forum: Beginners
Topic: Integer treated as double precision in division
Replies: 3
Views: 337

Re: Integer treated as double precision in division

In '-lang fb', I get:
8.1 8.1 8.1
7.700000000000001 7.700000000000001 7.700000000000001
0.1571428571428572 0.1571428571428572 0.1571428571428572
by fxm
Mar 30, 2024 16:40
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25219

Re: Freebasic 1.20.0 Development

For fbc version 1.20.0 only: - Can you correct the cases '2.1 pass' and '2.2 pass' at least ? (the '0' of the terminal character of zstring does not play its role of end) - Could you correct other 'NON OK' cases ('return' cases) ? - Note: Only the cases '1.1' and '1.2' are compatible with the use o...
by fxm
Mar 29, 2024 20:05
Forum: Beginners
Topic: array initialization
Replies: 8
Views: 406

Re: array initialization

Without going that far, you can more simply encapsulate the declaration+initialization of your var-len array in a Type. This will cause the compiler to add a constructor, and an instance of this type can then be declared shared: type udt dim fruitname(0 to 2) as string => {"apple", "o...
by fxm
Mar 29, 2024 14:54
Forum: Sources, Examples, Tips and Tricks
Topic: Waterfall effect
Replies: 18
Views: 1408

Re: Waterfall effect

Code: Select all

    For i As Integer = 0 To iNum - 1
by fxm
Mar 29, 2024 10:00
Forum: Beginners
Topic: array initialization
Replies: 8
Views: 406

Re: array initialization

Since fbc version 1.20.0, the compiler always pads the STRING*N type with spaces. If you do not want spaces on the right side of your string, use rather the ZSTRING*N type: dim shared fruitname(0 to 2) as zstring * 20 => {"apple", "orange", "banana"} (with this type ZST...
by fxm
Mar 26, 2024 17:25
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25219

Re: Freebasic 1.20.0 Development

Why not just use: #define C chr(0) Because const has higher operational efficiency :D Indeed, "Constants" have similar visibility rules than variables for Namespace blocks, Type blocks, and compound block statements, while "Defines" are only scoped inside compound block statemen...
by fxm
Mar 26, 2024 13:15
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25219

Re: Freebasic 1.20.0 Development

Why not just use:
#define C chr(0)
by fxm
Mar 26, 2024 12:04
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25219

Re: Freebasic 1.20.0 Development

St_W wrote: Dec 17, 2011 21:59 Automated recent git builds at:
https://users.freebasic-portal.de/stw/builds/
by fxm
Mar 25, 2024 17:00
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25219

Re: Freebasic 1.20.0 Development

Jeff, Back to : Pass Byref to a function, Return Byref from a function Assignment of the 3 types of string ( 'String' , 'String * N' , 'Zstring * N+1' ) by calling 2 types of function ( 'Byref As String' , 'Byref As Zstring' ): - either passing by reference to the function, - or returning by refere...
by fxm
Mar 25, 2024 7:23
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25219

Re: Freebasic 1.20.0 Development

The test-suite has some tests for [L|R]TRIM, however does not specifically test behaviours with CHR(0) either for the string argument or the filter argument. I think behaviour should be changed - however, there are several places internally where the rtlib uses common functions to scan a string for...
by fxm
Mar 24, 2024 9:58
Forum: Documentation
Topic: SmartPointer_UDTname_ segmentation violation
Replies: 10
Views: 485

Re: SmartPointer_UDTname_ segmentation violation

Documentation updated: ProPgOperatorOverloading → fxm [added in last example a workaround for a bug in fbc versions 1.10.0/1.10.1] This is due to a bad code generation for an argument passed to a 'Byval UDT Ptr' parameter when a specific conversion environment is encountered. The workaround consist...
by fxm
Mar 23, 2024 16:39
Forum: Documentation
Topic: SmartPointer_UDTname_ segmentation violation
Replies: 10
Views: 485

Re: SmartPointer_UDTname_ segmentation violation

Well done Jeff. Otherwise I had already seen another configuration which presents the same behavior: const SHOW_CHANGE = true type ROOT extends object Declare Constructor (Byref _name As String = "") #if SHOW_CHANGE Declare Operator Let (Byref rhs As root) '' same behavior with: Declare Co...
by fxm
Mar 23, 2024 10:02
Forum: Documentation
Topic: SmartPointer_UDTname_ segmentation violation
Replies: 10
Views: 485

Re: SmartPointer_UDTname_ segmentation violation

THANK YOU This "segmentation violation" signal only appears since version 1.10.0 of fbc. The simple change: Sub PrintInfo ( ByVal ByRef p As root Ptr) is enough to correct it (otherwise, the value of the pointer passed is polluted!!!). I will try to isolate/simplify this abnormal behavior,...
by fxm
Mar 22, 2024 16:54
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25219

Re: Freebasic 1.20.0 Development

Indeed, for very simple UDT with for example only numeric member fields without initializers: - the compiler does not add an implicit constructor but only allocates memory set to 0, - the compiler does not add an implicit copy-constructor but only performs a shallow (bitwise) copy, - the compiler do...
by fxm
Mar 22, 2024 6:12
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25219

Re: Freebasic 1.20.0 Development

There are cases where there are no constructors or copy-constructors or destructors (neither explicit nor implicit).