* * *

Author Topic: [Solved] Record for all Forms  (Read 339 times)

nana232

  • New member
  • *
  • Posts: 9
[Solved] Record for all Forms
« on: March 20, 2017, 08:04:07 am »
How to declare Record that can be used in all forms?

For example... The Record I would like to create is ...

Code: Pascal  [Select]
  1. Type
  2.     TMyrec = record
  3.       Name:string;
  4.       Value:integer;
  5.     end;
  6.  

For Form1 ... I will have the variable
Code: Pascal  [Select]
  1.  Var
  2. MyVar1: TMyRec;

and For Form2 ... I will have ...
Code: Pascal  [Select]
  1. Var
  2.  MyVar2: TMyRec;


Where I should put the declaration code "Type ..." in?
« Last Edit: March 20, 2017, 08:34:38 am by nana232 »

Girlbrush

  • Jr. Member
  • **
  • Posts: 65
Re: Record for all Forms
« Reply #1 on: March 20, 2017, 08:23:06 am »
In a separate unit which both Forms then include in their uses clauses.
Getting back into programming after 8+ years.

nana232

  • New member
  • *
  • Posts: 9
Re: Record for all Forms
« Reply #2 on: March 20, 2017, 08:34:18 am »
In a separate unit which both Forms then include in their uses clauses.

Thank you so much.

 :)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus