Search found 11985 matches

by fxm
Mar 07, 2024 19:36
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

BUG #1 with new STRING*N (which I had difficulty identifying in a large code which no longer works) Assigning a STRING * N variable, by an expression which is a concatenation including at least one string variable (whatever its type), does not work. Example: Dim As String * 10 s Dim As String s0 = ...
by fxm
Mar 07, 2024 15:45
Forum: Beginners
Topic: Btrieve - declarion help
Replies: 5
Views: 293

Re: Btrieve - declarion help

Lothar Schirm wrote: Mar 07, 2024 15:20 And I get a compiler error at line 5 (Type RecordBuffer ’ test file). Is there any hidden character that I cannot see?
No, simply replace with ' !
by fxm
Mar 06, 2024 20:34
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

@ Jeff , - internal: types containing only STRING*N fields or child types containing only STRING*N fields will initialize to spaces using a memory fill operation, and where other data types are present will induce the creation of an implicit constructor Maybe simpler to always create at least one im...
by fxm
Mar 06, 2024 17:04
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

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...
by fxm
Mar 06, 2024 11:51
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

@Jeff,
limit WSTRING*N, ZSTRING*N, STRING*N types to 2^31-1 and show an 'invalid size' error if the size given is less than 1 or greater than the limit
Could you confirm the theoretical limits for a var-len string:
between 0, and 2^31-1 (for 32-bit) or 2^63-1 (for 64-bit) ?
by fxm
Mar 05, 2024 15:46
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

Initialization/Assignment of an old/new fix-len string through a string literal expression The behavior seems to have improved: Dim As String * 20 s1 = "Alpha" + Chr(0) + "Beta" Print "'" & s1 & "'" Dim As String * 20 s2 s2 = "Alpha" + Chr(0...
by fxm
Mar 05, 2024 6:30
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

Assignment of an old/new fix-len string through a function by a 'Byref' parameter or a 'Byref return The behavior of this type of assignment seems even more (last test) degraded for the 'Byref' return case: Function test1(Byref s As String) Byref As String s = "1" Return s End Function Pr...
by fxm
Mar 04, 2024 20:28
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

Pointer to a new fix-len string Warning: dereferencing a pointer to a fix-len string (with the new definition) can lead to an extension of the string by some pollution, or even an outright crash. Type UDT Field = 1 Dim As String * 5 s = "123" Dim As Ulong I = &h44434241 Dim As Ubyte N...
by fxm
Mar 04, 2024 15:57
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

'Concatenate and Assign' versus old/new fix-len strings Due to the definition change on fix-len strings, the 'concatenate and assign' no longer works as before (as they do on previous defined fix-len strings). Workaround for compatibility with both fix-len string definitions: Dim As String * 9 s1 =...
by fxm
Mar 04, 2024 10:22
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

fbc: STRING*N occupies N bytes and has no terminating null character ..... SWAP will pad values with spaces where one of the arguments is of the STRING*N data type ..... OK: Dim As String * 4 s1 = "123" Dim As String * 6 s2 = "ABCDE" Print "'" & s1 & "'&qu...
by fxm
Mar 04, 2024 9:35
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

Fixes and improvements soon; just waiting for the test-suite to finish....again. I was debugging fbc only to find I had made a badly written test. OK, now Plus a test to avoid overflow on the fix-len string when it is passed to a procedure by 'Byref As Zstring' ? Yes, compared with fbc 1.10.0, ther...
by fxm
Mar 03, 2024 20:20
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

Works only with 'gas' and 'gas64' that accept modifications in a section of constant data ('.data section').

I have already seen it :
viewtopic.php?p=228206#p228206
by fxm
Mar 03, 2024 11:47
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

Your terminology is correct:

Code: Select all

type T1
	f as string * 10 = any   '' no initialization	
end type

type T2
	f as string * 10         '' default initialization (spaces)
end type

type T3
	f as string * 10 = ""    '' implicit constructor (assignment in procedure)
end type
by fxm
Mar 03, 2024 6:29
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 268
Views: 24024

Re: Freebasic 1.20.0 Development

Changes for string*n are now merged to fbc/master 1) A fix-len string member field is not initialized with spaces. Implicit constructor to add ? 2) A fix-len string passed to a procedure by 'Byref As Zstring' is not modified (this works with 'Byref As String' ). Plus a test to avoid overflow on the...
by fxm
Mar 02, 2024 18:50
Forum: General
Topic: [solved]UDT and procptr
Replies: 3
Views: 258

Re: UDT and procptr

See the 5 corrected lines ( '' ***** ): type test_func_ptr declare function nex() as ulongint declare function pre() as ulongint declare function set_next() as ulongint declare function set_prev() as ulongint dim get_data as function(Byref As test_func_ptr) as ulongint '' ***** end type function tes...