Forum > LCL

[SOLVED] VST Integer

(1/3) > >>

Pe3s:
Hello, I have such a problem with reading the number to VST. I saved to the file with the command

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---len := Length(IntToStr(Data^.Wiek));  Stream.Write(len, SizeOf(len));  Stream.Write(PChar(IntToStr(Data^.Wiek)^, len));  I have a problem with reading how to correct the code to make it work
reading

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Stream.Read(len, SizeOf(len));  SetLength(Data^.Wiek, len);  Stream.Read(PChar(IntToStr(Data^.Wiek))^, len);   

GetMem:
Can you please be more specific? What result do you expect and what result do you get instead?

Pe3s:
When it reads the data
SetLength + IntToStr is a compiler error how to fix it

Handoko:
That sure will cause an error.

This is SetLength documentation:
https://www.freepascal.org/docs-html/rtl/system/setlength.html

It needs a variable. The thing you provided: IntToStr(xxx) is a string, not variable.

Pe3s:
I corrected it to a variable but it still doesn't read the value

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Stream.Read(len, SizeOf(len));  FWiek := IntToStr(Data^.Wiek);  SetLength(FWiek, len);  Stream.Read(PChar(IntToStr(Data^.Wiek))^, len);  

Navigation

[0] Message Index

[#] Next page

Go to full version