Search found 11945 matches
- Mar 18, 2024 19:32
- Forum: General
- Topic: wth -- Thread time .vs Subroutine time
- Replies: 209
- Views: 37099
Re: wth -- Thread time .vs Subroutine time
Is 'Condwait' (and 'Condsignal' / 'Condbroadcast' + mutexes) still useful when there is already a 'Do While/Until ...Loop' loop for checking a Boolean predicate managed by the other thread(s) ? If 'CondWait' is not used, it is mandatory to put instead a 'Sleep x, 1' instruction in the 'Do While/Unt...
- Mar 16, 2024 8:46
- Forum: Beginners
- Topic: Read text File and a word
- Replies: 5
- Views: 235
Re: Read text File and a word
I only fixed syntax and functionality errors without optimizing the code. Changed lines are followed by '' *****. ' '-- only a test for a dictionary '-- load a poem and translate it to another language ' '#INCLUDE ONCE "windows.bi" '' ***** TYPE Translation sourceWord AS STRING targetWord ...
- Mar 15, 2024 12:46
- Forum: General
- Topic: typeof works with functions
- Replies: 3
- Views: 141
Re: typeof works with functions
The only interest of:
Typeof(Procptr(udt.procedurename.....))
is to highlight that a first additional parameter (Byref This As udt)) is passed internally for non-static member procedures, allowing the usage of 'This' in the body of such procedures.
Typeof(Procptr(udt.procedurename.....))
is to highlight that a first additional parameter (Byref This As udt)) is passed internally for non-static member procedures, allowing the usage of 'This' in the body of such procedures.
- Mar 14, 2024 20:05
- Forum: General
- Topic: typeof works with functions
- Replies: 3
- Views: 141
Re: typeof works with functions
'Typeof' works exclusively with variables In your example, 'Typeof' does not strictly speaking work with functions, but more precisely with function returns which are also types of variables. 'Typeof' can also indirectly work with functions (procedures in general), but more precisely with pointer f...
- Mar 13, 2024 12:23
- Forum: Community Discussion
- Topic: Freebasic 1.20.0 Development
- Replies: 207
- Views: 18529
Re: Freebasic 1.20.0 Development
Change : STRING*N occupies N bytes and has no terminating null character At first glance, list of pages that will need to be updated: KeyPgType LangQB KeyPgString KeyPgOpStrptr ProPgStringsTypes KeyPgSizeof KeyPgSwap KeyPgDim TblVarTypes + ProPgInitialization KeyPgUnion KeyPgByref I think I will st...
- Mar 13, 2024 6:51
- Forum: Community Discussion
- Topic: Freebasic 1.20.0 Development
- Replies: 207
- Views: 18529
Re: Freebasic 1.20.0 Development
Regardless of the fbc version, the built-in functions that return subsets of strings (Dim, Left, Right, Ltrim, Rtrim, Trim, ...) take into account all characters in a fix-len string 's' (declared STRING*N), including the padding characters (null characters for fbc version 1.10.0, and spaces for fbc ...
- Mar 12, 2024 12:26
- Forum: Beginners
- Topic: Minesweeper example
- Replies: 4
- Views: 259
Re: Minesweeper example
- The 2 arrays 'board()' and 'revealed()' must be declared global (do not re declare them locally at the level of each procedure). - Added a 'sleep' before 'end', to maintain persistence of the message "Game over! You hit a mine.". ' kind of MineSweeper screenres 640, 480, 32 const rows = ...
- Mar 12, 2024 9:28
- Forum: Community Discussion
- Topic: Freebasic 1.20.0 Development
- Replies: 207
- Views: 18529
Re: Freebasic 1.20.0 Development
String trimming is not symmetric for left versus right side When trimming a var-len string by Ltrim/Rtrim/Trim, null characters are treated the same as spaces but only on the right side: ..... ..... Does anyone know the reason for this ? Same behavior for the new fix-len string (fbc version 1.20.0)...
- Mar 11, 2024 19:15
- Forum: Community Discussion
- Topic: Freebasic 1.20.0 Development
- Replies: 207
- Views: 18529
Re: Freebasic 1.20.0 Development
String trimming is not symmetric for left versus right side When trimming a var-len string by Ltrim/Rtrim/Trim, null characters are treated the same as spaces but only on the right side: Sub stringViewer(Byref text As String, Byref s As String) Print text; For I As Integer = 0 To Len(s) - 1 Print s...
- Mar 11, 2024 9:03
- Forum: Community Discussion
- Topic: Freebasic 1.20.0 Development
- Replies: 207
- Views: 18529
Re: Freebasic 1.20.0 Development
So we would have, type T1: f as string*10 = any: end type '' uninitialized type T2: f as string*10 : end type '' initialize to string(10,0) type T3: f as string*10 = "" : end type '' initialize to space(10) After that assignments always pad with spaces. I would like that. This way, only t...
- Mar 10, 2024 12:35
- Forum: Community Discussion
- Topic: Freebasic 1.20.0 Development
- Replies: 207
- Views: 18529
Re: Freebasic 1.20.0 Development
On this occasion, I just noticed that the following code did not trigger the following error message from the compiler: "error 4: Duplicated definition, ..." (same behavior with ZSTRING and WSTRING) Dim As String * 20 array() Redim As String * 10 array(0) '' no error ! Print Len(array(0)) ...
- Mar 10, 2024 12:19
- Forum: Community Discussion
- Topic: Freebasic 1.20.0 Development
- Replies: 207
- Views: 18529
Re: Freebasic 1.20.0 Development
... which maybe makes a case for the "new" STRING*n being given a different name, as I suggested when I first commented on this issue. I will be able to give my opinion when I have been able to update my code of 5000 lines which uses a lot of STRING*N (simple variables and arrays) with fi...
- Mar 09, 2024 19:56
- Forum: Community Discussion
- Topic: Freebasic 1.20.0 Development
- Replies: 207
- Views: 18529
Re: Freebasic 1.20.0 Development
But if we ensure that our starting buffer is large enough to handle the assignment, here's the expected changes for VARIABLES if string*n and zstring*n and wstring*n passed to byref as string is allowed to be modified: When the starting buffer is not large enough to handle such a assignment (passin...
- Mar 09, 2024 19:25
- Forum: General
- Topic: wth -- Thread time .vs Subroutine time
- Replies: 209
- Views: 37099
Re: wth -- Thread time .vs Subroutine time
Tell me how to parallelize the Procedure into 4-6 threads. For example, let there be 100,000 particles 4 threads running 0-24999 25000-49999 50000 -74999 75000-100000 at synchronization points need to wait for lagging threads for temporal coherence How can all threads wait for each other before con...
- Mar 08, 2024 19:06
- Forum: Community Discussion
- Topic: Freebasic 1.20.0 Development
- Replies: 207
- Views: 18529
Re: Freebasic 1.20.0 Development
... which maybe makes a case for the "new" STRING*n being given a different name, as I suggested when I first commented on this issue. I will be able to give my opinion when I have been able to update my code of 5000 lines which uses a lot of STRING*N (simple variables and arrays) with fi...