|
of_string
|
|
Full name
|
pfc_n_cst_conversion.of_string
|
Access
|
public
|
Extend of
|
string
|
Return value
|
string
|
Prototype
|
public function string of_string(boolean,string)
|
Name
|
Datatype
|
ls_false
|
String
|
ls_null
|
String
|
ls_true
|
String
|
public function string of_string (boolean ab_parm, string as_type);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_String
//
// Access: public
//
// Arguments:
// ab_parm The boolean value to be converted to a string.
// as_type The string containing the desired return value
// i.e., TrueFalse, TF, YesNo, YN, ZEROONE
//
// Returns: string
// The string value of the passed boolean argument.
// If any argument's value is NULL, function returns NULL.
// If any argument's value is Invalid, function returns '!'.
//
// Description: Returns the passed boolean value as a string.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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_true, ls_false
//Check parameters
If IsNull(ab_parm) or IsNull(as_type) Then
String ls_null
SetNull(ls_null)
Return ls_null
End If
//Convert to uppercase
as_type = Upper(as_type)
//Check valid type and define true and false return values
Choose Case as_type
Case 'TRUEFALSE'
ls_true = 'TRUE'
ls_false = 'FALSE'
Case 'TF'
ls_true = 'T'
ls_false = 'F'
Case 'YESNO'
ls_true = 'YES'
ls_false = 'NO'
Case 'YN'
ls_true = 'Y'
ls_false = 'N'
Case 'ZEROONE'
ls_true = '1'
ls_false = '0'
Case Else
Return '!'
End Choose
If ab_parm Then
Return ls_true
End If
Return ls_false
end function
Name
|
Owner
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.setnull |
systemfunctions
|
systemfunctions.upper |
systemfunctions
|