DBWAddZerosLeft

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Library Reference > PDMSystem >

DBWAddZerosLeft

Description

Add 'zero' characters to the left of a string for output formatting.

Syntax

Function DBWAddZerosLeft(strmaxfieldsize)

Parameters

str

the string to add zero chars to

maxfieldsize

max size of the field to fill

Return Values

The input string str added of 'zeros' before it (up to maxfieldsize).

In case of str is longer than maxfieldsize it returns str as it is.

Example

mystring="12"
maxfieldsize=5
mystring=DBWAddZerosLeft(str, maxfieldsize)
msgbox mystring 'mystring contains now "00012"