Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

Assign method

Project: Binary Version Information Manipulation Units.

Unit: DelphiDabbler.Lib.VIBin.Resource.

Class: TVIBinResource

Applies to: ~>1.0

procedure Assign(const Source: TVIBinResource);

Description

Copies the contents of another TVIBinResource object to this object, making the content of the two objects equal.

Parameter:

Note

This method can be used to convert an ANSI resource into a Unicode resource and vice versa if one object is created as ANSI and the other as Unicode.

Example

In this example we convert an ANSI version information resource object to Unicode.

begin
  // Create an ANSI version information resource object
  var AnsiVI := TVIBinResource.Create(vrtAnsi);
  // ...
  // add information to AnsiVI here
  // ...

  // Create a Unicode version information resource object
  var UnicodeVI := TVIBinResource.Create(vrtUnicode);
  // Set Unicode resource to be a copy of AnsiVI, but with
  // content converted from ANSI to Unicode
  UnicodeVI.Assign(AnsiVI);
  // ...
  // do something with UnicodeVI here
  // ...
  
  UnicodeVI.Free;
  AnsiVI.Free;
end;

See Als0