473,396 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ASP Function Return Values

384 256MB
I'm getting to grips with ASP Classic using VBScript. I'm having a problem with returning values from a function.

No matter what I do I can't return values from another function to store in a variable. Any help much appreciated!

Say I have:
Expand|Select|Wrap|Line Numbers
  1. Public Sub MainFunc()
  2.   result = test "param1","param2"
  3. End Sub
  4.  
  5. Private Sub test(param1In,param2In)
  6.   {return value}
  7. End Sub
Jul 13 '10 #1
1 31387
jhardman
3,406 Expert 2GB
You say, "No matter what I do...", but I suspect you didn't try looking up vbscript syntax :) .
Expand|Select|Wrap|Line Numbers
  1. <%
  2. function helloWorld()
  3.    helloWorld= "Hello dave"
  4. end function
  5.  
  6. function helloYourName(name)
  7.    helloYourName= "Hello " & name
  8. end function
  9.  
  10. dim str
  11.  
  12. str = helloWorld
  13.  
  14. response.write "<p>" & str & vbNewLine
  15.  
  16. str = helloYourName("Bob")
  17.  
  18. response.write "<p>" & str & vbNewLine
  19.  
  20.  %>
Output:
Expand|Select|Wrap|Line Numbers
  1. <p>Hello dave
  2. <p>Hello Bob
Let me know if this helps.

Jared
Jul 15 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: sinister | last post by:
If I assign a variable to a function, say, $x = f($y); and then f happens not to return anything, does $x just remain unset? Or is this illegal?
4
by: guy | last post by:
It would be really nice if there was an option that warned the developer that calls to functions did not handle the returned value, or alternatively threw a compilation error. I have been caught so...
19
by: Christian Engström | last post by:
If you have a function that returns something by value, the gcc compiler (version 3.2.3 on Windows XP with MinGW) converts the returned value from the type you specify in the code, to the const...
6
by: guy | last post by:
We got it... :-) from my post to VS.NET 2005 VB.NET ng... Subject: function return values From: "John@data.vb" <anonymous@discussions.microsoft.com> Sent: 7/2/2004 12:56:27 PM
4
by: barcaroller | last post by:
I am trying to adopt a model for calling functions and checking their return values. I'm following Scott Meyer's recommendation of not over-using exceptions because of their potential overhead. ...
9
by: Oliver Graeser | last post by:
Hi All, I do some ensemble averaging calculation that requires me to accumulate very many distributions which I store in arrays. Basically something like class AdaptiveNW{ public: int**...
3
by: StrugglingStudent | last post by:
I'm having problems finishing my program, it keeps giving me the error '=':function as left operand. And im not sure what that means. It is supposed to be a function to calculate basic car rental...
0
by: bndprasad | last post by:
how to retrive javascript function return values into code behind
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.