Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Revisiting GetParm()
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01117193
Message ID:
01117202
Vues:
12
Have you looked at split()?

HTH
Jeff
>In VFP, I have a function GetParm() which returns a parameter from a list of specific items delimited by a character, which defaults to the comma. So, the function is like this:
>
>
>* Return a parameter value from a list
>* expC1 Parameter list
>* expN1 Parameter number
>* expC2 Delimiter (default is the comma)
>FUNCTION GetParm
>PARAMETERS tcParms,tnNo,tcDelimiter
>LOCAL lcDelimiter,lnBPos,lnEPos
>IF TYPE('tcDelimiter')<>'C'
>   lcDelimiter=','
>   ELSE
>   lcDelimiter=tcDelimiter
>ENDIF
>lnBPos=AT(lcDelimiter,lcDelimiter+tcParms+lcDelimiter,tnNo)
>lnEPos=AT(lcDelimiter,lcDelimiter+tcParms+lcDelimiter,tnNo+1)
>RETURN SUBSTR(tcParms,lnBPos,lnEPos-lnBPos-1)
>
>
>I was able to benefit of the AT() capability of locating the parameter after a specific number of occurences of the delimiter.
>
>For example, the list of parameters could be like this:
>
>lcParms=",,Test,,,,Test2"
>
>In VB.NET, the INSTR() doesn't have the capability of locating the parameter after a specific number of occurences of the delimiter. So far, I haven't been able to convert that function successfully in .NET to obtain the same thing.
>
>Note that in that particular example, GetParm(lcParms,1) should return "". GetParm(lcParms,2) should return "". GetParm(lcParms,3) should return "Test". So, when there is no parameter, a blank should be returned.
>
>Anyone could provide an equivalent in .NET that would accomplish the same?

It's Time to get a gun.

That's what I've been thinkin.

I think I can afford one, If I do a little less Drinkin.

www.TrueGeeks.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform