Forum > Packages and Libraries

dmath fft, got empty OutArray

<< < (4/4)

marcov:

--- Quote from: glorfin on October 31, 2022, 12:49:45 pm ---
--- Quote ---I can't explain it deep into FPC level. I just follow the suggestion from here: http://synapse.ararat.cz/doku.php/public:howto:binarystring
--- End quote ---

Well, this recommendation was written in 2007, before managed dynamic arrays were introduced.

--- End quote ---

(Both Delphi and FPC supported dynamic arrays in 2007.  Delphi since nineties Delphi 4, and FPC since may 2005, but at that time many packages still kept compatibility with older Delphi versions)

Thaddy:
Even in 2007 that was BAD advice.  >:D
It should have been solved by memory allocation and length.
But in 2007 we had already dynamic arrays.

glorfin:
Yes, I know that dynamic arrays did already exist. But were they managed as reference-counted? As far as I rememer, at the time one should have dispose them manually, with Finalize or SetLength(0).
(Though, I have to agree with Thaddy, even by the time using String for buffer was... strange advice).

senglit:
I see. So I do not neet to SetLength(myArray,0) now? That's a good news :).


--- Quote from: glorfin on October 31, 2022, 04:02:48 pm ---Yes, I know that dynamic arrays did already exist. But were they managed as reference-counted? As far as I rememer, at the time one should have dispose them manually, with Finalize or SetLength(0).
(Though, I have to agree with Thaddy, even by the time using String for buffer was... strange advice).

--- End quote ---

Thaddy:
To elaborate a bit:
If you use a string type to hold wave data, you usually start the wave data at zero, which means that the string is considered empty.... Since zero is a terminator for strings depending on its use: if the proper use of length is used that problem may disappear, but be careful: it is simply bad programming. Use a buffer and length.

Navigation

[0] Message Index

[*] Previous page

Go to full version