Ask a Question related to ASP, Design and Development.
-
Gram #1
Can ASP pass an Array into a Function?
Hello,
Can anyone tell me if ASP can pass an Array intp a Function? If so, can
anyone point me to an example?
Thanks in advance.
Gram.
Gram Guest
-
How to pass array of sting to non-CF web service?
My co-worker develops a Java web service which takes an array of user IDs and return the email addresses for those IDs. However, I just can't... -
How do you pass an array of structures to webservice?
Hello, Does anyone have an example of how to pass an array of strings (ie purchase Id's) from CF to a web service (like weblogic), and then... -
CFC array pass a URL?
Can you pass a hyperlink as a varaible in an array using CFC and Flash? In other words, I am trying to pass a hyperlink from a CFC to Flash using... -
how to pass multi array as args
Can someone show me how to pass multiple arrays argument? ie - .... mysub(@a, @b, @c); .... sub mysub { my @a = ? #arg1 an array $_ is... -
How to pass array values to ASP part
Any values that exist in the client have to be sent back to the server by submitting a form, refreshing a page with a querystring, or some other... -
Bob Barrows #2
Re: Can ASP pass an Array into a Function?
Gram wrote:
<nitpick>Presumably, you mean: "can vbscript pass an array into a> Hello,
>
> Can anyone tell me if ASP can pass an Array intp a Function?
function?". ASP is not a language: it is a platform which supports several
scripting languages, including vbscript, jscript, javascript ...</nitpick>
Sure.> If so,
> can anyone point me to an example?
>
<%option explicit
'create the function:
function UseArray(pAr)
dim i
response.write "The array contains the following elements:<BR>"
for i = 0 to ubound(pAr)
response.write pAr(i) & "<BR>"
next
UseArray = join(pAr,"; ")
end function
'create the array
dim ar, s
ar=array(1,2,3)
'pass it to the function:
s = UseArray(ar)
response.write "<BR>The function returned this string:<BR>"
response.write s
%>
--
HTH,
Bob Barrows - ASP MVP
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows Guest
-
Ray at #3
Re: Can ASP pass an Array into a Function?
Sure.
a = Array("a","b","c")
AA = MakeItBig(a)
Response.Write Join(AA, " - ")
Function MakeItBig(TheArray)
Dim aResult()
Redim aResult(UBound(TheArray))
For i = 0 To UBound(TheArray)
aResult(i) = UCase(TheArray(i))
Next
MakeItBig = aResult
End Function
That function will take the contents of an array and capitalize the values
and return it.
Ray at work
"Gram" <gram3000@hotmail.com> wrote in message
news:tixjb.1264$bD.4444@news.indigo.ie...> Hello,
>
> Can anyone tell me if ASP can pass an Array intp a Function? If so, can
> anyone point me to an example?
>
> Thanks in advance.
>
> Gram.
>
>
Ray at Guest
-
Bob Barrows #4
Re: Can ASP pass an Array into a Function?
Gram wrote:
[url]http://mvp.support.microsoft.com/[/url]> Bob,
>
> Thanks for the help and the quick reply.
> What does ASP MVP stand for?
>
--
HTH,
Bob Barrows - ASP MVP
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows Guest
-
Gram #5
Re: Can ASP pass an Array into a Function?
Bob,
Thanks for the help and the quick reply.
What does ASP MVP stand for?
Gram.
Gram Guest
-
Peter Foti #6
Re: Can ASP pass an Array into a Function?
"Gram" <gram3000@hotmail.com> wrote in message
news:tixjb.1264$bD.4444@news.indigo.ie...<%> Hello,
>
> Can anyone tell me if ASP can pass an Array intp a Function? If so, can
> anyone point me to an example?
Function arrToStr( myarray )
Dim i, result
For i = LBound(myarray) To UBound(myarray)
result = result & myarray(i)
Next
arrToStr = result
End Function
x = array("A","B","C")
Response.Write( arrToStr(x) )
%>
Hope this helps. :)
Regards,
Peter Foti
Peter Foti Guest
-
Gram #7
Re: Can ASP pass an Array into a Function?
Hello,
Thanks for all your quick responses, Got it sorted.
Gram.
Gram Guest



Reply With Quote

