Forum > General

storing string

<< < (4/4)

Wesbat:

--- Quote from: Remy Lebeau on December 02, 2024, 04:41:09 pm ---Here is a slightly cleaner way without resorting to StrNew()/StrDispose():


--- 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";}};} ---var tag: Pointer;tag := nil;string(tag) := 'yourstringhere';TButton.Tag := PtrInt(tag);

--- 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";}};} ---var tag: Pointer;tag := Pointer(TButton.Tag);Somestring := string(tag);...string(tag) := '';
--- End quote ---

As someone who is still learning, I find this example very instructive into how Pointers operate. Thanks for sharing.

Navigation

[0] Message Index

[*] Previous page

Go to full version