Forum > Databases
[SOLVED] Passing data back and forth between forms
MarkMLl:
--- Quote from: wp on May 09, 2021, 01:04:21 pm ---I know global variables are usually considered to be bad programming style. But here a global variable is a true solution to the circular reference issue which sooner or later may become unresolvable.
--- End quote ---
I think the "considered harmful" designation is unsupportable as long as Lazarus insists on representing each form by a global variable.
MarkMLl
jcmontherock:
Another way:
--- 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";}};} --- unit Unit1; Interface uses Unit2; implementation ... var Font1: TFont; procedure TForm1.FormCreate(Sender: TObject); begin PFont := @Font1; ...... end; =================================================== unit Unit2; implementation var PFont: ^TFont; // address of Font1 in Unit1 procedure TForm2.UpdateFontSize; var fontSize: Single; begin fontSize := PFont^.Size; ....... PFont^.Size := 9; ....... end;
Navigation
[0] Message Index
[*] Previous page