Search found 12099 matches

by fxm
Jul 19, 2024 20:51
Forum: Sources, Examples, Tips and Tricks
Topic: Doubly linked list (optimized)
Replies: 7
Views: 301

Re: Doubly linked list (optimized)

Can you find a way to make iteration better? It's already the worst part of linked lists but going from node n to n + 1 shouldn't require potentially iterating half the list, twice. 'DoublyLinkedList' could perhaps memorize the most recently visited node (position and address) each time (in additio...
by fxm
Jul 19, 2024 18:14
Forum: Sources, Examples, Tips and Tricks
Topic: Doubly linked list (optimized)
Replies: 7
Views: 301

Re: Doubly linked list (optimized)

OK. THANKS
First post updated.
by fxm
Jul 19, 2024 15:48
Forum: Sources, Examples, Tips and Tricks
Topic: Doubly linked list (optimized)
Replies: 7
Views: 301

Re: Doubly linked list (optimized)

My goal is to try to put in the Programmer's Guide an example of a linked list that is both efficient and easily usable (the example from the Community Tutorials seems a bit twisted to me and not meeting user expectations).
by fxm
Jul 19, 2024 14:56
Forum: General
Topic: Is '#undef keyword' safe ?
Replies: 10
Views: 559

Re: Is '#undef keyword' safe ?

Yes but 'fb_End' is an internal keyword, not a user keyword.
by fxm
Jul 19, 2024 7:58
Forum: Sources, Examples, Tips and Tricks
Topic: Doubly linked list (optimized)
Replies: 7
Views: 301

Doubly linked list (optimized)

Doubly linked list (optimized) : Doubly linked nodes (pointer to previous node + pointer to user data + pointer to next node) to optimize transverse access times (bidirectional displacement). A begin static node (using only the pointer to next node) and an end static node (using only the pointer to...
by fxm
Jul 15, 2024 14:36
Forum: Beginners
Topic: FreeBasic beginer to Parallel port connected LED toggling-Where do I begin?
Replies: 2
Views: 184

Re: FreeBasic beginer to Parallel port connected LED toggling-Where do I begin?

Just so that the ChatGPT code above compiles under FreeBASIC, but nothing more: #include "windows.bi" DIM AS HANDLE hPort DIM AS DWORD dwBytesWritten ' Open a parallel port (LPT1 in thiis example) on your PC hPort = CreateFile("LPT1:", GENERIC_READ OR GENERIC_WRITE, 0, NULL, OPEN...
by fxm
Jul 14, 2024 7:01
Forum: Beginners
Topic: Elderly User
Replies: 10
Views: 595

Re: Elderly User

I always found DosBox to be slow, much slower than the DOS of old Windows.
by fxm
Jul 13, 2024 19:39
Forum: Beginners
Topic: QBASIC compatibility of FreeBasic.
Replies: 3
Views: 232

Re: QBASIC compatibility of FreeBasic.

This code almost compiles with FreeBASIC, but using the "qb" dialect. Only one small problem, 'HEX' is a FreeBASIC keyword, so variable name changed for example to 'HEXA'. #lang "qb" REM Defining constants and variables REM \CHAP_1\CH1_1.BAS char$ = "string" c10% = 10 L...
by fxm
Jul 11, 2024 11:16
Forum: General
Topic: Is '#undef keyword' safe ?
Replies: 10
Views: 559

Re: Is '#undef keyword' safe ?

Some keywords refuse to be redefined like 'Val', 'Left', 'Right', while 'Len', 'Mid', 'Instr' accept it (I do not see any logic in this).

Otherwise, variable and procedure names defined inside a namespace can not be undefined.
by fxm
Jul 10, 2024 16:26
Forum: General
Topic: Is '#undef keyword' safe ?
Replies: 10
Views: 559

Re: Is '#undef keyword' safe ?

My goal is not to use this hack, but only to clarify its behavior in the #UNDEF documentation page (for potential users). The related note on the documentation page seems a bit understandable to me for variable names but less for function names (maybe understandable for function names due to their r...
by fxm
Jul 10, 2024 11:17
Forum: General
Topic: Is '#undef keyword' safe ?
Replies: 10
Views: 559

Re: Is '#undef keyword' safe ?

But is this type of hacking safe or not ?
Question rather for a FB developer (Jeff, counting_pine, SARG, ...)
by fxm
Jul 10, 2024 6:29
Forum: General
Topic: Is '#undef keyword' safe ?
Replies: 10
Views: 559

Is '#undef keyword' safe ?

I would like to know if '#undef keyword' is always safe.
Are keywords only defined as external names, and under the hood only their internal names are used ?
by fxm
Jul 09, 2024 6:01
Forum: Sources, Examples, Tips and Tricks
Topic: Lunar Phase Visualizer
Replies: 9
Views: 2175

Re: Lunar Phase Visualizer

I prefer not to go to the download site because it is declared as risky by my AV, but you can try this: - 'NULL' is already a constant declared (in windows.bi), so simply delete the '#define NULL 0' line in the program. - 'object' is now an FB keyword, so in all occurrences of the program, replace '...
by fxm
Jul 04, 2024 18:22
Forum: General
Topic: Mysterious problem.
Replies: 6
Views: 363

Re: Mysterious problem.

As 'but' can vary from 0 to 7 (all mouse buttons pressed), the 'mbutts()' array must be defined accordingly (from index 0 to index 7). But maybe this bug is not responsible for your crash, and there are still other problems after this one ! Fix this runtime error and repeat the same test (always wit...
by fxm
Jul 04, 2024 16:24
Forum: General
Topic: Mysterious problem.
Replies: 6
Views: 363

Re: Mysterious problem.

As you are using FBIde, see here to configure FBIde to keep the text console open (and therefore see the runtime error messages).
Specially see the 'Leaving the command line window open when the program finishes' paragraph.