Search found 2852 matches

by Tourist Trap
Mar 19, 2020 8:13
Forum: Community Discussion
Topic: [offtopic solved] Problem with my HTML5 JS template ?
Replies: 4
Views: 427

Re: [offtopic]Problem with my HTML5 JS template ?

badidea wrote:I don't know, where (what program) do you press F12?
Maybe "function main() { } " ? (wild guess)

Probably in the browser to show the console.
by Tourist Trap
Mar 01, 2020 20:55
Forum: Beginners
Topic: Type of union field = [union] with some usage of TYPEOF ?
Replies: 3
Views: 211

Re: Type of union field = [union] with some usage of TYPEOF ?

That code gives two errors here as welll: test.bas(2) error 163: Fields with constructors cannot be part of UNION's or nested TYPE's in 'as OBJECT o' test.bas(5) error 7: Expected ')', found '.' in '#print typeOf(UNO.o) ''print...
by Tourist Trap
Mar 01, 2020 19:22
Forum: Beginners
Topic: Type of union field = [union] with some usage of TYPEOF ?
Replies: 3
Views: 211

Type of union field = [union] with some usage of TYPEOF ?

Hi, Maybe a silly question, but I find that: union UNO as OBJECT o end union #print typeOf(UNO.o) ''prints UNO, rather than OBJECT So as said in the commented part, I would be expecting to be returned the object type (of o) rather that the parent type. Is there a reason for this that I obviously miss?
by Tourist Trap
Mar 01, 2020 18:47
Forum: Tips and Tricks
Topic: UDT: Dynamic Type
Replies: 26
Views: 1232

Re: UDT: Dynamic Type

fxm wrote:Using such conversions allows to defined a simplistic dynamic type (DT) for user:

Hello,

Thanks for this nice example of very fruitful stuff that desserves attention. But why is this called "dynamic" ?
by Tourist Trap
Jan 08, 2020 6:10
Forum: Tips and Tricks
Topic: [Linux] Try/Catch
Replies: 7
Views: 454

Re: [Linux] Try/Catch

]What do you mean by "prevent crashes?" Exception handling should not prevent crashes. As I said about segfaults, crashes are often the only sensible thing to do. I agree with all you say here, but my focus was on the TRY. We try, this goes wrong, so we make a step back and and finally do...
by Tourist Trap
Jan 05, 2020 11:26
Forum: Game Dev
Topic: Game Engine Black Book DOOM
Replies: 2
Views: 394

Re: Game Engine Black Book DOOM

A very interesting work Thanks. Looks very good. I found a chapter on the question of subpixel accuracy: Subpixel Accuracy It is worth mentioning that the engine is subpixel-accurate when calculating the screencoordinates of a wall’s top and bottom edges. Subpixel accuracy is a subtle concept, the ...
by Tourist Trap
Jan 05, 2020 10:59
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 415
Views: 26684

Re: FreeBASIC syntax challenge games

fxm wrote:[edit]
Done:
ProPgNewDelete → fxm [added clarification on 'Operator Placement New/New[]']

For me it's clearer. Thanks.
by Tourist Trap
Jan 04, 2020 21:24
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 415
Views: 26684

Re: FreeBASIC syntax challenge games

Placement New [] does not write the number of elements at the beginning of the memory block, because Delete [] does not have to be and must not be called. Fxm, I was reading the page on New/Delete of the wiki. You write: Instance array created with 'Operator New[] Overload/Expression' must be freed...
by Tourist Trap
Jan 04, 2020 21:09
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 415
Views: 26684

Re: FreeBASIC syntax challenge games

Important extract of this documentation page: Memory is not allocated when using the Placement New operator. Instead, the memory at the specified address is used (the provided memory size must be large enough to contain all the placement). It is incorrect to call Delete Statement on the address. Th...
by Tourist Trap
Jan 04, 2020 20:47
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 415
Views: 26684

Re: FreeBASIC syntax challenge games

Variant on the same idea. Maybe what I was thinking of in my first tries I guess (and still may well be very wrong! when will he learn ahah!): destructor DESTR_UDT() this.dii = -111 end destructor type TESTOBJ as string type BOTTLE as TESTOBJ v as integer u = 999998 end type dim as BOTTLE ptr bb = n...
by Tourist Trap
Jan 04, 2020 20:31
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 415
Views: 26684

Re: FreeBASIC syntax challenge games

I wrote about thirty articles in the Programmer's Guide Hi fxm! I downloaded the last chm, I had them all now, and they render very well in this format as well. Thanks for all this good stuff. But about the last challenge, following the insight from dodicat, what if we try a placement new[] pointin...
by Tourist Trap
Jan 04, 2020 19:43
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 415
Views: 26684

Re: FreeBASIC syntax challenge games

A crude method. create an integer pointer (new integer[1]) just before creating the instance pointer (new typesymbol[a random number] Divide the difference in addresses by (sizeof(integer)) If there is an extra address space inserted by the compiler (for the new[] operator), then the resultant divi...
by Tourist Trap
Jan 04, 2020 17:58
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 415
Views: 26684

Re: FreeBASIC syntax challenge games

Added a third clue to the enigma #25 of post https://www.freebasic.net/forum/viewtopic.php?p=267129#p267129. (a fourth is still in reserve) Hi, I'm seriously discovering this feature. Totally missed it, and still probably have to learn. So here is my try with the last clue of the operator delete[]....
by Tourist Trap
Jan 04, 2020 15:55
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 415
Views: 26684

Re: FreeBASIC syntax challenge games

In addition to be always unsafe, your code (that I does not understand) does not even output the right response on my PC: DESTR_UDT 1703480 4598484 true OBJECT 4598468 4598512 true integer 4598496 4598544 true (with Win32 and gas) I'm on 64 and GCC. It's very surprising that it doesn't work for you...
by Tourist Trap
Jan 04, 2020 15:51
Forum: Beginners
Topic: An error message that I cannot handle
Replies: 7
Views: 260

Re: An error message that I cannot handle

" but what is the purpose of this, I don't get it right now." . . . . well, I am studying freeBasic using the manual on the Internet as my study material. In an attempt to understand the (somewhat extensive) code examples, I try them out. And if they bug out I am lost. This is the origin ...

Go to advanced search