of_parseargs


pfcapsrv.pbl   >   pfc_n_cst_tvsrv_levelsource   >   of_parseargs   

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

Name Datatype
No Data

Name Datatype
li_Args Integer
li_Cnt Integer
li_Level Integer
li_P1 Integer
li_P2 Integer
lnv_String n_cst_string
ls_ColName String
ls_Level String
ls_Parm String[]
ls_Type String

protected function integer of_parseargs (string as_args, integer ai_level, ref integer ai_arglevel[], ref string as_argcolumn[]);//////////////////////////////////////////////////////////////////////////////
//
//	Function:	of_ParseArgs
//
//	Access:		protected
//
//	Arguments:
//	as_Args				The retrieval argument string
//	ai_Level				The TreeView level these arguments are for
//	ai_ArgLevel[]		An integer array that will contain the levels that
//								the retrieval arguments come from, passed by reference
//	as_ArgColumn[]		A string array that will contain the columns containing
//								the retrieval arguments, passed by reference
//
//	Returns:		Integer
//					 1 if successful
//					-1 if error occurs
//
//	Description:	Parse the string of retrieval arugments into separate
//						arguments 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_Type, ls_ColName, ls_Level
Integer			li_Args, li_Cnt, li_P1, li_P2, li_Level
n_cst_string	lnv_String

// check arguments
If IsNull(as_args) or (as_args = "") Then Return -1
If isNull(ai_level) or (ai_level < 1) Then Return -1

// Parse the comma-delimeted string
li_Args = 1
ls_Parm[li_Args] = Trim(lnv_String.of_gettoken(as_Args, ","))
Do While Len(as_Args) > 0
	li_Args ++
	ls_Parm[li_Args] = Trim(lnv_String.of_gettoken(as_Args, ","))
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)
		li_P2 = Pos(ls_Parm[li_Cnt], ".", (li_P1 + 1))
		ls_Type = Left(ls_Parm[li_Cnt], (li_P1 - 1))
		ls_Level = Mid(ls_Parm[li_Cnt], (li_P1 + 1), (li_P2 - (li_P1 + 1)))
		ls_ColName = Right(ls_Parm[li_Cnt], (Len(ls_Parm[li_Cnt]) - li_P2))
		
		// Determine the level to pull from
		If Lower(ls_Type) = ":level" Then
			// Absolute level
			li_Level = Integer(ls_Level)
		Else
			// Relative level
			li_Level = ai_Level - Integer(ls_Level)
		End if
		
		ai_ArgLevel[li_Cnt] = li_Level
		as_ArgColumn[li_Cnt] = ls_ColName
	End if
Next

Return 1
end function

     
Name Owner
pfc_n_cst_tvsrv_levelsource.of_getargs pfc_n_cst_tvsrv_levelsource

     
Name Owner
systemfunctions.integer systemfunctions
systemfunctions.isnull systemfunctions
systemfunctions.left systemfunctions
systemfunctions.len systemfunctions
systemfunctions.lower systemfunctions
systemfunctions.mid systemfunctions
systemfunctions.pos systemfunctions
systemfunctions.right systemfunctions
systemfunctions.trim systemfunctions
pfc_n_cst_string.of_gettoken pfc_n_cst_string

     
Full name
No Data

     
Name Scope
No Data