Search found 8407 matches

by fxm
Nov 12, 2018 14:13
Forum: Community Discussion
Topic: Resignation
Replies: 74
Views: 1924

Re: Resignation

Although I am on the forum every day and for a long time, I am not currently a candidate to be moderator on this forum: - I am more interested in the purely technical side than in the relational and human side. - My level of English does not allow me to perfectly judge the politeness or non-politene...
by fxm
Nov 12, 2018 9:04
Forum: Beginners
Topic: About mod and then
Replies: 5
Views: 152

Re: About mod and then

The result is the remainder of the integer division of x (-10) by 3: result = x - (x \ 3) * 3 The integer division divides x by 3, and the fractional share of the resulting quotient is truncated (Fix operator): (x \ 3) = Fix(x / 3) (x \ 3) = Fix(-3.333...) (x \ 3) = -3 Finally: result = -10 - (-3) *...
by fxm
Nov 11, 2018 19:02
Forum: Community Discussion
Topic: small words forum search
Replies: 1
Views: 61

Re: small words forum search

Already requested more than a month ago.
See from the post at viewtopic.php?p=253024#p253024 and the following posts.
by fxm
Nov 11, 2018 10:22
Forum: Community Discussion
Topic: FreeBasic Unlike QuickBASIC
Replies: 16
Views: 467

Re: FreeBasic Unlike QuickBASIC

The reason is setting up OOP. GTK requires static procedures to call back to. Including such procedures in objects excludes direct access to dynamic members. That's a problem Yes, there is no access possibility (with the implicit 'This') to a non-static member from a static member procedure. But it...
by fxm
Nov 11, 2018 10:20
Forum: Community Discussion
Topic: FreeBasic Unlike QuickBASIC
Replies: 16
Views: 467

Re: FreeBasic Unlike QuickBASIC

Yes, and this additional attention (define a copy-constructor for such a Type, in order to get a valid instance copy) is not induced by the case where the static procedure is put inside the Type as static member.
by fxm
Nov 10, 2018 21:59
Forum: Community Discussion
Topic: FreeBasic Unlike QuickBASIC
Replies: 16
Views: 467

Re: FreeBasic Unlike QuickBASIC

When one refers to a static member procedure ( 'handler(...)' ) in an UDT, the syntax kinds that work for calling such a procedure do not work all for getting the procedure address. One can call a static member procedure on an UDT instance 'u' ( 'u.handler(...)' ) or on the UDT typename ( 'UDT.handl...
by fxm
Nov 10, 2018 17:06
Forum: Community Discussion
Topic: FreeBasic Unlike QuickBASIC
Replies: 16
Views: 467

Re: FreeBasic Unlike QuickBASIC

Furthermore, using static members in an object may require additional attention if you want a (new) copy of the object instance. Why ? Example : ' event handler object type TEvent extends object Handler as sub(byval p as any ptr) Owner as any ptr declare constructor() end type constructor TEvent() ...
by fxm
Nov 10, 2018 14:12
Forum: Community Discussion
Topic: FreeBasic Unlike QuickBASIC
Replies: 16
Views: 467

Re: FreeBasic Unlike QuickBASIC

By hacking the vptr (vtable pointer), one can access the address of a non-static virtual procedure member in the vtable. The only constraint is to know the order of the virtual procedures inside TForm1 declaration (first => offset = 0 in vtable, second => offset = +1 in vtable, ...): ' event handler...
by fxm
Nov 10, 2018 9:18
Forum: General
Topic: [Code question] variables and unwanted results.
Replies: 10
Views: 284

Re: [Code question] variables and unwanted results.

A macro which addresses a constant produces the desired results, while a define would generate some kind of problem. No if you put surrounding parentheses to avoid unwanted precedence change of operators: #Define PI ( 4 * Atn(1.0) ) #Define d2r ( PI / 180.0 ) #Define r2d ( 180.0 / PI ) #Define RAD(...
by fxm
Nov 10, 2018 6:34
Forum: General
Topic: [Code question] variables and unwanted results.
Replies: 10
Views: 284

Re: [Code question] variables and unwanted results.

@Krieger,
Can you explain where is the problem in your last code above?

'TheXC()' procedure only shows that the passed parameter for example 'y' is not modified by the procedure body expressions because it is never reassigned (no expression with 'y = .....' in that case).
by fxm
Nov 07, 2018 6:14
Forum: General
Topic: Free Basic Compilers Version 1.06.0 (08-26-2018) seem broken
Replies: 106
Views: 3649

Re: Free Basic Compilers Version 1.06.0 (08-26-2018) seem broken

@coderJeff, Thanks. And what about the warning on the second line in Sub body (referring to https://www.freebasic.net/forum/viewtopic.php?p=254260#p254260): Sub test (Byref s As Const Shape) Print Ubound(s.points) Print s.points(0).x '' warning 40(-1): CONST qualifier discarded End Sub (compiling wi...
by fxm
Nov 07, 2018 6:01
Forum: General
Topic: runtime error 12; segmentation violation(solved)
Replies: 3
Views: 110

Re: runtime error 12; segmentation violation(solved)

Corrected error above: You forgot to count the memory occupied by the string descriptor of each array element (about 30 million of elements). Each string descriptor uses 3 integers ( 24 12 bytes on 32-bit). (I'm too "sticked" 64-bit) Reminder on string descriptor structure (each item is co...
by fxm
Nov 06, 2018 20:57
Forum: General
Topic: Free Basic Compilers Version 1.06.0 (08-26-2018) seem broken
Replies: 106
Views: 3649

Re: Free Basic Compilers Version 1.06.0 (08-26-2018) seem broken

FreeBASIC Compiler used: Version 1.06.0 (10-24-2018).

Obviously if we suppress 'Const' in all declarations, the code compiles.
by fxm
Nov 06, 2018 20:50
Forum: General
Topic: runtime error 12; segmentation violation(solved)
Replies: 3
Views: 110

Re: runtime error 12; segmentation violation

You forgot to count the memory occupied by the string descriptor of each array element (about 30 million of elements).
Each string descriptor uses 3 integers (24 12 bytes on 32-bit).
by fxm
Nov 06, 2018 16:58
Forum: General
Topic: Free Basic Compilers Version 1.06.0 (08-26-2018) seem broken
Replies: 106
Views: 3649

Re: Free Basic Compilers Version 1.06.0 (08-26-2018) seem broken

Simpler bug:

Code: Select all

Sub simpler_test (array() As Const Integer)
  Print Ubound(array)  '' error 181: Invalid assignment/conversion, at parameter 1 in 'Print Ubound(array)'
End Sub

Go to advanced search