of_FormatData


pfcapsrv.pbl   >   pfc_n_cst_lvsrv_datasource   >   of_FormatData   

Full name pfc_n_cst_lvsrv_datasource.of_FormatData
Access public
Extend of string
Return value string
Prototype public function string of_FormatData(string,string,string,n_ds,long)

Name Datatype
No Data

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, n_ds ads_obj, long al_row);//////////////////////////////////////////////////////////////////////////////
//	Public Function:	of_FormatData
//	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
//						ads_obj			The data store for the row of data
//						al_Row			The row of the data in the datastore
//	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.
//////////////////////////////////////////////////////////////////////////////
//	Rev. History:	Version
//						6.0   Initial version - this function may be obsolete
//////////////////////////////////////////////////////////////////////////////
//	Copyright © 1996-1999 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

if IsNull(ads_obj) or not IsValid(ads_obj) then return "!"
if IsNull(as_columnname) or (trim(as_columnname) = "") or IsNull(al_row) or (al_row < 1) then return "!"

// Format the column as a string
choose case Left(as_ColType, 7)
	case "integer", "long"
		ll_Arg = ads_obj.GetItemNumber(al_Row, as_ColumnName)
		ls_Data = String(ll_Arg, as_ColFormat)
	case "double", "number"
		ldb_Arg = ads_obj.GetItemNumber(al_Row, as_ColumnName)
		ls_Data = String(ldb_Arg, as_ColFormat)
	case "decimal"
		ldc_Arg = ads_obj.GetItemDecimal(al_Row, as_ColumnName)
		ls_Data = String(ldc_Arg, as_ColFormat)
	case "date"
		ld_Arg = ads_obj.GetItemDate(al_Row, as_ColumnName)
		ls_Data = String(ld_Arg, as_ColFormat)
	case "time"
		lt_Arg = ads_obj.GetItemTime(al_Row, as_ColumnName)
		ls_Data = String(lt_Arg, as_ColFormat)
	case "datetim"
		ldt_Arg = ads_obj.GetItemDateTime(al_Row, as_ColumnName)
		ls_Data = String(ldt_Arg, as_ColFormat)
	case else
		ls_Arg = ads_obj.GetItemString(al_Row, as_ColumnName)
		ls_Data = String(ls_Arg, as_ColFormat)
end choose

if IsNull(ls_Data) then ls_Data = ""

return ls_Data
end function

     
Name Owner
No Data

     
Name Owner
datastore.getitemdate datastore
datastore.getitemdatetime datastore
datastore.getitemdecimal datastore
datastore.getitemnumber datastore
datastore.getitemstring datastore
datastore.getitemtime datastore
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.left systemfunctions
systemfunctions.string systemfunctions
systemfunctions.trim systemfunctions

     
Full name
No Data

     
Name Scope
No Data