of_parsecols


pfcapsrv.pbl   >   pfc_n_cst_tvsrv_levelsource   >   of_parsecols   

Full name pfc_n_cst_tvsrv_levelsource.of_parsecols
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_parsecols(string,ref string[],ref string[])

Name Datatype
No Data

Name Datatype
li_Args Integer
li_Cnt Integer
li_P1 Integer
lnv_String n_cst_string
ls_ColName String
ls_Oper String
ls_Parm String[]

protected function integer of_parsecols (string as_cols, ref string as_operators[], ref string as_column[]);//////////////////////////////////////////////////////////////////////////////
//
//	Function:	of_ParseCols
//
//	Access:		protected
//
//	Arguments:
//	as_Cols				The column definition string string
//								ex:  N.colname, AN.Col2name, O.col3name
//								means Not (Colname) and Not (col2name) or col3name
//	as_Operators[]		A string array that will contain the relational operators
//								passed by reference
//	as_Column[]			A string array that will contain the columns to filter
//								passed by reference
//
//	Returns:		Integer
//					 1 if successful
//					-1 if error occurs
//
//	Description:	Parse the string of columns into separate
//						columns and fill the array reference arguments.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.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_Parm[], ls_ColName, ls_Oper
Integer			li_Args, li_Cnt, li_P1 
n_cst_string	lnv_String

// check arguments
If IsNull(as_cols) or (as_cols = "") Then Return -1

// Parse the comma-delimeted string
li_Args = 1
ls_Parm[li_Args] = Trim(lnv_String.of_gettoken(as_cols, ","))
Do While Len(as_cols) > 0
	li_Args ++
	ls_Parm[li_Args] = Trim(lnv_String.of_gettoken(as_cols, ","))
Loop


// Determine the column name
For li_Cnt = 1 To li_Args
	If ls_Parm[li_Cnt] <> "" Then
		li_P1 = Pos(ls_Parm[li_Cnt], ".", 1)
		ls_Oper = Left(ls_Parm[li_Cnt], (li_P1 - 1))
		ls_Colname = Mid(ls_Parm[li_Cnt], (li_P1 + 1) )
		
		as_operators[li_Cnt] = upper(ls_oper)
		as_Column[li_Cnt] = ls_ColName
	End if
Next

Return 1
end function

     
Name Owner
pfc_n_cst_tvsrv_levelsource.of_retrieve pfc_n_cst_tvsrv_levelsource

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.left systemfunctions
systemfunctions.len systemfunctions
systemfunctions.mid systemfunctions
systemfunctions.pos systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.upper systemfunctions
pfc_n_cst_string.of_gettoken pfc_n_cst_string

     
Full name
No Data

     
Name Scope
No Data