String manipulation 
Author Message
 String manipulation

I don't know if this  an appropriate question for this group so please, if
its misplaced, forgive me.

I need to figure out how to grab the value to the right of the "=" sign in a
form element string.

The scenario is that I have dynamically assigned form name so I can't call
it by name.  I do know that its always the third element and I have been
able to split the form collection array and get the third element so now I
have things like

PRODUCT_ID2323=F440605
or,
PRODUCT_ID90685=B405506

Both name and the value will have varying lengths but if I can figure out
how to grab everything right of the"=" then I'll be home free.  Here's what
I've got so far:
FrmArray = Request.form
 FrmElmt = Split(FrmArray,"&",-1,1)
 PrdID = (ubound(FrmElmt)-3)      *** This successfully getting the correct
element***
 If InStr((FrmElmt(PrdID)), "=")>0 Then

 PRD_ID = Right((FrmElmt(PrdID)), InStr((FrmElmt(PrdID)), "=") - 3)
 'PRD_ID = Right((FrmElmt(PrdID, "=") + 1)
 response.write PRD_ID

This last part is obviously not right.  I just don't understand string
manipulation well enough to figure out the correct syntax.
--
Bob LaGarde
LaGarde, Incorporated
Business Applications for the Internet

www.lagarde.com
__________________________________________
Custom Internet Oriented Software Development
Commercial Web Hosting Services
__________________________________________



Tue, 08 Aug 2000 03:00:00 GMT  
 String manipulation

the following should work for you

n = InStr(string, "=")
ID = Mid(string, n + 1, Len(string))

hope it helps
--
Paul Smullen

http://www.smullen.com/



Quote:
> I don't know if this  an appropriate question for this group so please,
if
> its misplaced, forgive me.

> I need to figure out how to grab the value to the right of the "=" sign
in a
> form element string.

> The scenario is that I have dynamically assigned form name so I can't
call
> it by name.  I do know that its always the third element and I have been
> able to split the form collection array and get the third element so now
I
> have things like

> PRODUCT_ID2323=F440605
> or,
> PRODUCT_ID90685=B405506

> Both name and the value will have varying lengths but if I can figure out
> how to grab everything right of the"=" then I'll be home free.  Here's
what
> I've got so far:
> FrmArray = Request.form
>  FrmElmt = Split(FrmArray,"&",-1,1)
>  PrdID = (ubound(FrmElmt)-3)      *** This successfully getting the
correct
> element***
>  If InStr((FrmElmt(PrdID)), "=")>0 Then

>  PRD_ID = Right((FrmElmt(PrdID)), InStr((FrmElmt(PrdID)), "=") - 3)
>  'PRD_ID = Right((FrmElmt(PrdID, "=") + 1)
>  response.write PRD_ID

> This last part is obviously not right.  I just don't understand string
> manipulation well enough to figure out the correct syntax.
> --
> Bob LaGarde
> LaGarde, Incorporated
> Business Applications for the Internet

> www.lagarde.com
> __________________________________________
> Custom Internet Oriented Software Development
> Commercial Web Hosting Services
> __________________________________________



Thu, 10 Aug 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. string manipulation, string routines, etc.

2. String manipulation

3. String Manipulation

4. VBA String Manipulation DLL Missing

5. String manipulation in VBA

6. String Manipulation

7. String manipulation

8. Some newbie string manipulation in basic/VB...

9. string manipulation

10. String manipulation for a time field

11. Help with String manipulations

12. String manipulation

 

 
Powered by phpBB® Forum Software