|
of_FormatData
|
|
Full name
|
pfc_u_lv.of_FormatData
|
Access
|
public
|
Extend of
|
string
|
Return value
|
string
|
Prototype
|
public function string of_FormatData(string,string,string,long)
|
Name
|
Datatype
|
ld_Arg
|
Date
|
ldb_Arg
|
Double
|
ldc_Arg
|
Decimal
|
ldt_Arg
|
DateTime
|
ll_Arg
|
Long
|
ls_Arg
|
String
|
ls_Data
|
String
|
lt_Arg
|
Time
|
public function string of_FormatData (string as_columnname, string as_colformat, string as_coltype, long al_row);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_FormatData
//
// Access: protected
//
// Arguments:
// as_ColumnName The name of the column whose data is desired
// as_ColFormat The format for the column in the DataWindow
// as_ColType The data type of the column
// al_Row The row of the data
//
// Returns: String
// The data in the column, row converted to a string and formatted
// using the format attribute from the DataWindow.
//
// Description: Get the data from a row/column and convert it to a string using
// the column's format attribute from the DataWindow.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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_Data, ls_Arg
Long ll_Arg
Double ldb_Arg
Decimal ldc_Arg
Date ld_Arg
DateTime ldt_Arg
Time lt_Arg
// Format the column as a string
Choose Case Left(as_ColType, 7)
Case "integer", "long"
ll_Arg = ids_Source.GetItemNumber(al_Row, as_ColumnName)
ls_Data = String(ll_Arg, as_ColFormat)
Case "double", "number"
ldb_Arg = ids_Source.GetItemNumber(al_Row, as_ColumnName)
ls_Data = String(ldb_Arg, as_ColFormat)
Case "decimal"
ldc_Arg = ids_Source.GetItemDecimal(al_Row, as_ColumnName)
ls_Data = String(ldc_Arg, as_ColFormat)
Case "date"
ld_Arg = ids_Source.GetItemDate(al_Row, as_ColumnName)
ls_Data = String(ld_Arg, as_ColFormat)
Case "time"
lt_Arg = ids_Source.GetItemTime(al_Row, as_ColumnName)
ls_Data = String(lt_Arg, as_ColFormat)
Case "datetim"
ldt_Arg = ids_Source.GetItemDateTime(al_Row, as_ColumnName)
ls_Data = String(ldt_Arg, as_ColFormat)
Case Else
ls_Arg = ids_Source.GetItemString(al_Row, as_ColumnName)
ls_Data = String(ls_Arg, as_ColFormat)
End Choose
Return ls_Data
end function
Name
|
Owner
|
datastore.getitemdate |
datastore
|
datastore.getitemdatetime |
datastore
|
datastore.getitemdecimal |
datastore
|
datastore.getitemnumber |
datastore
|
datastore.getitemstring |
datastore
|
datastore.getitemtime |
datastore
|
systemfunctions.left |
systemfunctions
|
systemfunctions.string |
systemfunctions
|