Request ( arg & Cstr(i)) Explanation

# Thread: Request ( arg & Cstr(i)) Explanation

1. Junior Member
Join Date
Dec 1969
Posts
20

## Request ( arg & Cstr(i)) Explanation

I have seen the expression Request("quantity" & Cstr(i)) in a lot of places. What does it do? I know about the Request(xxx) command, but what about the one above?<BR><BR>Thanks,<BR>Roberto<BR>rob@ccsn.com

2. Senior Member
Join Date
Dec 1969
Posts
2,092

## RE: Request ( arg & Cstr(i)) Explanation

Cstr : use CStr to force the result to be expressed as a String.<BR><BR>Now you know what Request is right ?<BR><BR>When you look at this code:<BR>Request("quantity" & Cstr(i)) <BR>Step by Step let&#039;s cut it <BR>--&#062;Cstr(i) Now find out what " i " is, then look at the definition of Cstr at the top of my post.<BR><BR>So it converts " i " into a string<BR><BR>Now next step<BR>"quantity" & Cstr(i)<BR>Let&#039;s assume that " i " is equal to the number 5<BR>What will this become --&#062; "quantity" & Cstr(i) &#060;-- ?<BR><BR><BR>Answer: "quantity5"<BR><BR>Now Final step<BR>Request("quantity5")<BR>You should know what this means right ?<BR>

3. Junior Member
Join Date
Dec 1969
Posts
20

## RE: Request ( arg & Cstr(i)) Explanation

I guess maybe I don&#039;t understand things as well as I thought. Here is more of a snippet:<BR><BR>For i = 1 to iCount <BR> Quantity = Request("Quantity" & CStr(i))<BR> If IsNumeric(Quantity) Then<BR> ARYshoppingcart(cartItemQuantity,i) = abs(CLng(Quantity))<BR> Else<BR> ARYshoppingcart(cartItemQuantity,i) = 1<BR> End If<BR>Next<BR><BR>First of all, when I test for IsNumeric, it says it&#039;s true. How could that be? The word "Quantity" is there! Second, is the request asking itself to latest value when you hit recalculate (does that make any sense)?<BR><BR>Thanks,<BR><BR>Roberto<BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•