|
of_padleft
|
|
Full name
|
pfc_n_cst_string.of_padleft
|
Access
|
public
|
Extend of
|
string
|
Return value
|
string
|
Prototype
|
public function string of_padleft(string,long)
|
Name
|
Datatype
|
ls_null
|
string
|
ls_return
|
string
|
public function string of_padleft (string as_source, long al_length);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_PadLeft
//
// Access: public
//
// Arguments:
// as_Source The string being searched.
// al_length The desired length of the string.
//
// Returns: String
// A string of length al_length wich contains as_source with
// spaces added to its left.
// If any argument's value is NULL, function returns NULL.
// If al_length is less or equal to length of as_source, the
// function returns the original as_source.
//
// Description: Pad the original string with spaces on its left to make it of
// the desired length.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
string ls_return
//Check for Null Parameters.
IF IsNull(as_source) or IsNull(al_length) Then
string ls_null
SetNull(ls_null)
Return ls_null
End If
//Check for the lengths
If al_length <= Len(as_Source) Then
//Return the original string
Return as_source
End If
//Create the left padded string
ls_return = space(al_length - Len(as_Source)) + as_source
//Return the left padded string
Return ls_return
end function
Name
|
Owner
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.len |
systemfunctions
|
systemfunctions.setnull |
systemfunctions
|
systemfunctions.space |
systemfunctions
|