of_ParseArgs


pfcmain.pbl   >   pfc_u_tv   >   of_ParseArgs   

Full name pfc_u_tv.of_ParseArgs
Access protected
Extend of
Return value
Prototype protected subroutine 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 subroutine 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:		None
//
//	Description:	Parse the string of retrieval arugments into separate
//						arguments and fill the array reference arguments.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_Parm[], ls_Type, ls_ColName, ls_Level
Integer			li_Args, li_Cnt, li_P1, li_P2, li_Level
n_cst_string	lnv_String

// 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

end subroutine

     
Name Owner
pfc_u_tv.of_getargs pfc_u_tv

     
Name Owner
systemfunctions.integer 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