Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/20/19 in all areas

  1. @Volk65 Global variable per session. Here is my kitchen : Create an UniDataModule specially dedicated to these variables. for example name it Tmp (a temporary Unit) : unit Tmp; interface uses SysUtils, Classes; type TDM_tmp = class(TDataModule) //********* private // variables shared by all units example : // Periode fD1:TDate; fD2:TDate; // Printing fPrintLine:boolean; // somme set errors ferror:boolean; etc... //********* published // Periode property D1:TDate read fD1 write fD1; property D2:TDate read fD2 write fD2; // Printing property PrintLine:boolean read fPrintLine write fPrintLine; // somme set errors property error:boolean read ferror write ferror; end; function DM_tmp: TDM_tmp; implementation {$R *.dfm} uses UniGUIVars, uniGUIMainModule, MainModule; function DM_tmp: TDM_tmp; begin Result := TDM_tmp(UniMainModule.GetModuleInstance(TDM_tmp)); end; initialization RegisterModuleClass(TDM_tmp); end. And after, on your others Units, you can get them or set them like : tmp.DM_tmp.D1 :=dtpMyDateN.dateTime; if tmp.DM_tmp.error then .... if tmp.DM_tmp.PrintLine then... It is important to use properties to never have overlap variables on different sessions see : http://www.unigui.com/doc/online_help/general-design-concept.htm Regards.
    1 point
×
×
  • Create New...