Field-Map Scripting

4.1.2.2 LZero

LZero function


Prototype:

function LZero(const Value :variant; const Len :integer) :string

Description:

The LZero function returns string of a Len length with leading zeros.

Syntax:

variable:= LZero(Value,Len);


Part

Description


variable

Variable declared as string


Value

Variable declared as variant that represents the value to be completed


Len

The total length of the final output

Return value:

Returns string of a Len length with leading zeros.



Example:

var
  OrderID:integer;
  Order,Invoice:string;
Begin
  OrderID:=123;
  Order:=LZero(OrderID,6);
  Invoice:=DateToStr(Date)+'/' + Order;
  showMessage(format('Invoice: %s',[Invoice]));
end. 


See also:

Format; LZero; Delete; Trim; TrimLeft; TrimRight; SameText; StringReplace; DeFormat1-10; GetFieldCountFromString;GetFieldFromString; IndexOfField; SortNumericSequence