473,698 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Jul 19 '05 #1
6 22925
Gram wrote:
Hello,

Can anyone tell me if ASP can pass an Array intp a Function?
<nitpick>Presum ably, you mean: "can vbscript pass an array into a
function?". ASP is not a language: it is a platform which supports several
scripting languages, including vbscript, jscript, javascript ...</nitpick>
If so,
can anyone point me to an example?

Sure.
<%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.
Jul 19 '05 #2
Bob,

Thanks for the help and the quick reply.
What does ASP MVP stand for?

Gram.
Jul 19 '05 #3
Sure.

a = Array("a","b"," c")
AA = MakeItBig(a)
Response.Write Join(AA, " - ")

Function MakeItBig(TheAr ray)
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" <gr******@hotma il.com> wrote in message
news:ti******** ********@news.i ndigo.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.

Jul 19 '05 #4
Gram wrote:
Bob,

Thanks for the help and the quick reply.
What does ASP MVP stand for?


http://mvp.support.microsoft.com/

--
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.
Jul 19 '05 #5
"Gram" <gr******@hotma il.com> wrote in message
news:ti******** ********@news.i ndigo.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
Jul 19 '05 #6
Hello,

Thanks for all your quick responses, Got it sorted.

Gram.
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3140
by: Seeker | last post by:
Newbie question here... I have a form with some radio buttons. To verify that at least one of the buttons was chosen I use the following code ("f" is my form object) : var btnChosen; for (count = 0; count <= 1; count++) { if (eval(f.RadioButtons.checked)) { btnChosen = true; }
6
1798
by: Kenny | last post by:
Hello, can anyone tell me how to pass an array to a function ? I have this function , part of my class. It works if I do not put in int a everywhere , but obviously , I need to add an array so I can keep everything neat and tidy, And to call the array whenever I want thanks kenny
2
2356
by: Te-Jung Lo | last post by:
the following is the original code i wrote #include <stdio.h> #include <stdlib.h> //--- Prototype ---// void bfs(int ); void main()
1
7673
by: Mark Dicken | last post by:
Hi All I have found the following Microsoft Technet 'Q' Article :- Q210368 -ACC2000: How to Pass an Array as an Argument to a Procedure (I've also copied and pasted the whole contents into the bottom of this email)
7
25169
by: ritchie | last post by:
Hi all, I am new to this group and I have question that you may be able to help me with. I am trying to learn C but am currently stuck on this. First of all, I have a function for each sort (Bubble, insertion, selection..). I have an array of int's and am passing them to each sort function.
5
3416
by: wilson | last post by:
Dear all, In this time, I want to pass array to function. What should I declare the parameter in the function?i int array or int array? Which one is correct? /******************************************************** Below is my code: ********************************************************/
10
9141
by: nospam | last post by:
Hello! I can pass a "pointer to a double" to a function that accepts double*, like this: int func(double* var) { *var=1.0; ... }
14
20399
by: Abhi | last post by:
I wrote a function foo(int arr) and its prototype is declared as foo(int arr); I modify the values of the array in the function and the values are getting modified in the main array which is passed also. I understand that this way of passing the array is by value and if the prototype is declared as foo(int *), it is by reference in which case the value if modified in the function will get reflected in the main function as well. I dont...
3
2503
by: QQ | last post by:
I have one integer array int A; I need to pass this array into a function and evaluate this array in this function how should I pass? Is it fine? void test(int *a)
11
3351
by: venkatagmail | last post by:
I have problem understanding pass by value and pass by reference and want to how how they are or appear in the memory: I had to get my basics right again. I create an array and try all possible ways of passing an array. In the following code, fun1(int a1) - same as fun1(int* a1) - where both are of the type passed by reference. Inside this function, another pointer a1 is created whose address &a1 is different from that of the passed...
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9164
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8898
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7734
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3051
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.