Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

How to add another unit?

 Post Reply Post Reply
Author
Peck Sally View Drop Down
New Member
New Member
Avatar

Joined: 14 Dec 2018
Posts: 30
Post Options Post Options   Quote Peck Sally Quote  Post ReplyReply Direct Link To This Post Topic: How to add another unit?
    Posted: 09 Feb 2019 at 2:21am

Please see below.

How to add a new unit generated?

Example:

uses
  SysUtils,
  Generics.Collections,
  Aurelius.Mapping.Attributes,
  Aurelius.Types.Blob,
  Aurelius.Types.DynamicProperties,
  Aurelius.Types.Nullable,
  Aurelius.Types.Proxy,
  Aurelius.Criteria.Dictionary,
  MyUnit; // custom attributes


How to add?

procedure OnUnitGenerated(Args: TUnitGeneratedArgs);
var
  s: TCodeUsedUnit;
begin              
  s :=
  Args.CodeUnit.InterfaceUnits.Add // ??
  Args.Field.AddAttribute(Args.DBField.Description);
end;

1. Intellisense not working for TCodeUsedUnit. How would I use this?

2. Intellisense for Args.Create how to use ?

3. How to add uses (something) to the generated uses list?


Back to Top
Peck Sally View Drop Down
New Member
New Member
Avatar

Joined: 14 Dec 2018
Posts: 30
Post Options Post Options   Quote Peck Sally Quote  Post ReplyReply Direct Link To This Post Posted: 09 Feb 2019 at 2:31am

Guessing what parameter 1 is...

procedure OnUnitGenerated(Args: TUnitGeneratedArgs);
var
  s, t: TCodeUsedUnit;            
begin                                                
  s := TCodeUsedUnit.Create('Unit2');        
  Args.CodeUnit.InterfaceUnits.Add(s);

  t := TCodeUsedUnit.Create('Unit1');        
  Args.CodeUnit.InterfaceUnits.Add(t);         
end;



Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2427
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 09 Feb 2019 at 9:07pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down