Search found 8675 matches

by fxm
Feb 19, 2019 23:07
Forum: Beginners
Topic: Reassigning an array all at once
Replies: 5
Views: 126

Re: Reassigning an array all at once

Similar to my last workaround, but with macro-generation as proposed by Tourist Trap: #macro assign(array, init...) scope type UDT dim as typeof(array) array(lbound(array) to ubound(array)) end type dim byref as UDT rarray = *cptr(UDT ptr, @array(lbound(array))) rarray = type(##init##) end scope #en...
by fxm
Feb 19, 2019 9:14
Forum: Beginners
Topic: Reassigning an array all at once
Replies: 5
Views: 126

Re: Reassigning an array all at once

Variance of the previous workaround, using such a Type structure containing a similar array, but in addition to the user array, the structure being placed at the same address as the user array itself: dim as integer arr(1 to 10) = {1,2,3,4,5,6,7,8,9,10} Print arr(10) type UDT dim as integer array(1 ...
by fxm
Feb 19, 2019 8:01
Forum: Beginners
Topic: Reassigning an array all at once
Replies: 5
Views: 126

Re: Reassigning an array all at once

Currently in FB, there is no compact syntax for assigning the array elements at once (only for the initializer at the declaration level). You must reassign element per element. Note: Another workaround should be to encapsulate your array in a structure like a Type, and to use the built-in assignment...
by fxm
Feb 19, 2019 7:49
Forum: Beginners
Topic: Reassigning an array all at once
Replies: 5
Views: 126

Re: Reassigning an array all at once

Preliminary remark: - When you size a static array, the general syntax is: Dim name ( [lbound To] ubound [, ...] ) As DataType where lbound (0 by default) refers to the lower bound or the smallest index, and ubound refers to the upper bound or the largest index. - In your shortcuted syntax u...
by fxm
Feb 18, 2019 13:07
Forum: Beginners
Topic: How to convert String (or Double) to SerialNumber
Replies: 11
Views: 239

Re: How to convert String (or Double) to SerialNumber

The keyword-name Val[U]Int / Val[U]Lng can be misleading because the conversion is done to [U]Long / [U]LongInt (and not to [U]Int / [U]Long), whereas the name is consistent for C[U]Int / C[U]Lng (and the others Cx).
by fxm
Feb 17, 2019 14:53
Forum: Beginners
Topic: How to convert String (or Double) to SerialNumber
Replies: 11
Views: 239

Re: How to convert String (or Double) to SerialNumber

There are several possible methods.
See at Date Serials.
by fxm
Feb 17, 2019 9:50
Forum: Community Discussion
Topic: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize
Replies: 360
Views: 14797

Re: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize

About the "Modifier les paramètres PPP élevés (Change high DPI settings)" menu of French version of Windows 10 which is bugged (truncated text at the top and bottom): My "solved" is only for my own problem of "Change high DPI settings" menu on my French version of Windo...
by fxm
Feb 16, 2019 15:22
Forum: Community Discussion
Topic: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize
Replies: 360
Views: 14797

Re: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize

My "solved" is only for my own problem of "Change high DPI settings" menu on my French version of Windows 10.
by fxm
Feb 16, 2019 15:12
Forum: Projects
Topic: Coil Inductance and Q Calculator
Replies: 12
Views: 245

Re: Coil Inductance and Q Calculator

k6sti wrote:The main problem was the inadequacy of the FB documentation.....

It starts strong for your second post on the forum, me who on the contrary tries to share as much as possible my some knowledge on FB, including through its documentation.
by fxm
Feb 16, 2019 14:24
Forum: Documentation
Topic: Windows bug for small screens / fullscreen
Replies: 24
Views: 567

Re: Windows bug for small screens / fullscreen

In my recent version of Win 10 [version 10.0.17763.292], I no longer see the switch "Override high DPI scaling behavior" (or even an equivalent switch) in the compatibility properties of the .exe file. (https://www.freebasic.net/forum/viewtopic.php?p=258159#p258159) Solved. See at https:/...
by fxm
Feb 16, 2019 14:17
Forum: Community Discussion
Topic: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize
Replies: 360
Views: 14797

Re: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize

In my recent version of Win 10 [version 10.0.17763.292], I no longer see the switch "Override high DPI scaling behavior" (or even an equivalent switch) in the compatibility properties of the .exe file. (https://www.freebasic.net/forum/viewtopic.php?p=258159#p258159) Solved. See at https:/...
by fxm
Feb 16, 2019 6:08
Forum: General
Topic: How to decide on virtual or shadow method
Replies: 1
Views: 130

Re: How to decide on virtual or shadow method

Dynamic polymorphism ⋅ The dynamic polymorphism (brought through the inheritance and the virtuality) allows to similarly process heterogeneous objects, without knowing their real types at compile time. Their real types will be only used automatically at run time (dynamic binding). Therefo...
by fxm
Feb 13, 2019 18:54
Forum: Beginners
Topic: How to do sound
Replies: 3
Views: 132

Re: How to do sound

Under Windows (except Win95):

Code: Select all

#include "windows.bi"
    'type WINBOOL as long
    'type DWORD as ulong
    'declare function Beep_ alias "Beep"(byval dwFreq as DWORD, byval dwDuration as DWORD) as WINBOOL

Beep_(1000, 1000)  ' (1000 Hz, 1000 ms)

Sleep
by fxm
Feb 10, 2019 5:54
Forum: Beginners
Topic: How to reset the value when using input
Replies: 22
Views: 410

Re: How to reset the value when using input

The inkey page needs fixing for the coming version 1.06 They are all inkey$ at the moment. Already done, and also for other relevant keywords. See paragraph "Dialect Differences" at pages: Chr[$], Command[$], Hex[$], Inkey[$], Lcase[$], Left[$], Ltrim[$], Mid[$] (statement), Mkd[$], Mki[$...
by fxm
Feb 09, 2019 21:53
Forum: Community Discussion
Topic: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize
Replies: 360
Views: 14797

Re: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize

fxm wrote:For my case, setting the ScreenRes instruction to 1680x1050 is sufficient (in fullscreen mode) to ensure a properly display with a desktop 1920x1080 / 125%.

But I did not check until the last pixel on the bottom right.

Go to advanced search