Posts: 4,692
Threads: 222
Joined: Apr 2022
Reputation:
322
Oh yes, one more thing. UDT's have never been fixed for saving to file variable length strings.
So if you save to file a UDT it must be like the old days with fixed string lengths only!!!
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 4,692
Threads: 222
Joined: Apr 2022
Reputation:
322
04-12-2023, 06:09 PM
(This post was last modified: 04-12-2023, 06:25 PM by bplus.)
(04-12-2023, 04:00 PM)TerryRitchie Wrote: (04-12-2023, 03:50 PM)bplus Wrote: I've run into trouble using UDT's when I assume after a ReDim _Preserve that the new values are 0 or "" for numbers or strings.
Supposedly the numbers and fixed strings were fixed according to Luke if I recall but variable length strings had to initilized to "" otherwise they pick up garbage from the string pointers to uncleared meomory, something like that.
@TerryRichie could it be possible you were assuming new variable length strings were "" after a ReDim _Preserve ?
Perhaps also, whatever was fixed back when Luke checked it became unfixed with all the updates made since, like with assumed 0 of new integers created with ReDim _preserve?
I will write some test code...
I just posted a controller library in the library section. If you change the "Name AS STRING * 20" in "TYPE TYPE__SLOT" to "Name AS STRING" in the CONTROLLER.BI file you'll see the errors start to happen.
I scanned through code to see if you were either trying to do math on an assumed zeroed initialized variable or trying to save to file... couldn't even find the Type declaration, let alone seeing what you were doing with it. Sorry, too complicated for my patience today.
Udate: OK found it in downloaded zip line 710 of BI but @TerryRichie you know better than I what you are doing with the Type items.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever