Turning Code In To Function

I have some existing ASP code and a client would like it turned in to a function so they can call it in a way like this:

Response.Write(functionname(blah, foo, y, n, n, n, n))

Can anyone point me at a tutorial for turning some existing code in to a function so I can do something like this?

View Replies


ADVERTISEMENT

Function Code In ASP

I have a code In asp, but i don't know this function.below is code:

1.if instr(strq,"http://localhost/ab") > 0 then
...........
else
...........
end if

2.fid=replace(fid,"pdafid_","")

1.What function the code "instr"?
2.What function the code "replace"?

View Replies View Related

Calling A Javascript Function In Asp Code

I have create a function in javascript and the function will return an integer type of value and i want to call that function in Asp code and use that integer value so please tell me how can i call that function.

View Replies View Related

Turning Off Autofill

Is there a way to turn off the auto fill.. I have page that a user has to enter their logon and password. I do not want the auto fill to save userid/pswd. Can this be turned off or not displayed while typing?

View Replies View Related

Changing This Code To A Function? (how Do You Make Functions?)

I have a menu system that has nodes that can be opened or closed. In an
effort to make my code more manageable, I programmed a little widget tonight
that keeps track of the open/active item and automatically builds
querystrings for my redirect URLS. The code for this follows. It defines an
ASP Dictionary object, and key/value pairs for each, and builds appropriate
querystrings based on comparison with a status variable.

The way it works for now is I manually declare and re-declare a variable
("CurrentContentClass") in places throughout the code where there is a new
menu item. I embed this same block of code repeatedly through my
application, one for each menu node. This is a really stupid approach, and
I'm sure there's a better way.

Better would be to create a single function into which you could feed
parameters and get output. I've used lots of functions in my auspicious
career in ASP, but I've never created one myself.

Can anyone suggest tutorials or approaches such that I can learn how to
create my own functions? Any guidance based on what's below? Code:

View Replies View Related

ASP: Code Search Function For Chinese Site

Got a chinese website (has both chinese character and english), got to code search function for it, search for keywords in the webpages (htm/asp)

search in english it works, no problem
search in chinese it doesn't - it always return "nothing found"

you guys any idea?

View Replies View Related

Turning Coldfusion To ASP Using VBScript

I am trying to turn a page I have in coldfusion into ASP using VBscript. There are some functions in coldfusion that I can't find comparable functions in vbscript. Code:

View Replies View Related

Turning Auto Commit Off

I am runnig a Oracle procedure(this inserts records in table)with asp.command object.I dont want to commit the inserts, I want to turn auto-commit off when I execute this procedure.Can this be done in ASP,if so,can some one give me a example.

View Replies View Related

Turning Date Into An Integer

I am looking at doing a rotating image using the date to count it up. I have found a small bit of script to do it but have to admit Code:

View Replies View Related

How Do I Write The Code For A Button That Will Call A Function/procedure In ASP?

How do I write the code for a button that will call a function/procedure in ASP and delete all records in an array? Should I use a function or procedure? Anyone who would like to finish this code? Code:

View Replies View Related

ASP App Built On IIS 5.1 Not Working On IIS 6 - Turning Debugging On?

I've been given an ASP site built, tested and working on IIS 5.1 to be hosted on IIS 6. I've gone through the process of enabling ASP, parent paths, and debugging in the IIS Management console. My first ASP works as expected, however, a link to a second gives me the error:

HTTP 500 - Internal server error

This is not a lot to go on, so my question is can i turn on debugging/error messages to give me more of a starter?

View Replies View Related

Turning Strings Into Variable Names

if there is a quick way of converting a string into an actual variable.The reason I ask this is to save me having to type each variable name out when trying to request the values from a form.

View Replies View Related

Turning A Comma Delineated String Into An Array

I've never been able to get my head round arrays, and despite expensive googling I can't work out how to sort this problem:

I have a simple shopping cart that attaches a stock ID number and a quantity to a session variable. Each item selected is added to the session("cart") as "ID.Quantity" and divided by a comma. Thus the string is "12.7,3.45,8.9" etc.

Can anyone show me how to turn this into a two dimensional array, so I can get the relevant records for each ID from my database and match it to the number requested? Splitting the string by comma and then by full-stop has beaten me.

View Replies View Related

Difference Between Private Function And Public Function?

What's the difference between private and public functions in ASP? When should I use either?

View Replies View Related

ASP Code - Anti Spam Verification Code

I'm looking for sample code that will require a use to enter a code from a scued image format.

I'm sure you've seen them before where the image is barely readable by a human and the user has to enter the code correctly to submit the form.

I'm looking for ASP code and NOT ASP.NET code as I am supporting a legacy site.

View Replies View Related

How Can I Add Mail Function To That Post Function

I am using a simple guestbook /portal and i want script to send mail to the thread owner when someone reply his message.

this is the send message code ....

View Replies View Related

Function Inside A Function

Can I define a function inside a function. e.g;

function abc()
function xyz()
....some code.....
End Function
End Function

I googled this but can't find any related topic.

View Replies View Related

Function In The InStr Function

I want to use the instr function, but return results from it depending on surtain functions, I can't realy explain so I'll show my example:

I have a string in wich some word I want to find might be in diffrent Capital Letters order, I want the Instr function to return all the values of the place of that word (avcourse I'll run a for and increase the starting point of the Instr func until it returns 0). The instinct thought is to use the Lcase or the Ucase functions, but in this case I don't know how to use them. In the same Idea I wanted to use the Instr Func with the trim Func, But Its realy the same principle if I just understood how to do so.

View Replies View Related

Asp Function

I am trying to call a function in asp to check to see if a varibale has a value stored in it if there is nothing wite the value NA into it. My code is

<%
Function NullValues(userField)
if userField = "" then userField = "NA"
end function

AccountNo = ""
Name = "sam clowes"
email = ""

AccountNo = (NullValues(AccountNo))
Name = (NullValues(Name))
email = (NullValues(email))

response.Write AccountNo & "<br>"
response.Write Name & "<br>"
response.Write email & "<br>"
%>

When I run this code ALL the variables are blank and nothing is output

View Replies View Related

XML/XSL & ASP Function

the function
<%
Dim objXML, objXSL

Function ShowXML(strXML,strStyleSheet)
Set objXML = CreateObject("MSXML.DOMDocument")
Set objXSL = CreateObject("MSXML.DOMDocument")
objXML.load(Server.MapPath(strXML))
objXSL.load(Server.MapPath(strStyleSheet))
Response.Write objXML.transformNode(objXSL)
Set objXML = Nothing
Set objXSL = Nothing
End Function
%>


calling the function in an asp file
<%Call ShowXML("http://msn.foxsports.com/feedout/syndicatedContent?categoryId=142","nhl/xsl/news/teamNews.xsl")%>


the errors
1. the http:// part
2. and the ? mark

the error message says that the path has been typed wrong.

View Replies View Related

Function

the user can key in variable A and B
then C is auto generated by C = A / B

so how and where should i write the C function??

View Replies View Related

XML Value Into ASP Function

Possibly a very simple question but how do I get a value out of an XML document so I can play with it in ASP

E.G: <Name>Tom</Name

How do I pull the work tom into asp

View Replies View Related

Now() Function

I am using the now() function to be displayed on an email after a form submission has been sent. The problem is that the server is not in the same timezone as I am for the result. How do I adjust the hours on the now() to allow for this please ?

View Replies View Related

Sub Or Function

I know the basic difference between a subroutine and a function is a
subroutine performs a task and a function performs a task and returns a
value. The Call keyword is required when using parens with subs with more
than 1 parameters. Parens around values passed are ByVal vs ByRef and is a
waste of processing if passed ByRef for no reason.
I am told there is no reason to ever use a subroutine as a function can be
used even if it doesn't return a value. While this appears to be true, is
there any reason why it's ever a bad idea to use a function, instead of a
subroutine, that doesn't return a value? Are there memory, performance,
etc. issues?

View Replies View Related

ASP Function

I am trying to locate information on how to call a sub within VBScript on an
ASP page but I can't locate generic information. What I want to do is
generate a page that will stay up but the information on it will change
based on a series of drop down boxes. I need the first drop down box to call
a second dropped down box based on the state that is chosen then city and so
on.

View Replies View Related

Asp Function

I have a column in the table which contains 2 full names seperated by "&" (e.g: Joe Smith & Jeff Scott) I want to display only the first names of the whole record in an asp page. Is there an asp function using which i can do this?

View Replies View Related

Mod Function

im using the mod function to create a calendar for me, which everything works perfectly, all is totally well with that!
but...when i use the mod function it churns out this loooooooooong string which is the whole table...
if there is some way that i can insert hard breaks IN THE CODE ITSELF.

View Replies View Related

NaN Function

I used to be quite an experienced ASP programmer but I haven't used it for a while

I’m trying to do something that I remember as very simple I'm trying to check that the value of a form text box is numerical using the isNaN function. The code I am using is:

<%
quantity = Request.Form("number1")

if isNaN(quantity) = true then
Response.Write "Your input was not a number"
else
Response.Write "Your input was a number"
end if
%>

All I get is a NaN type mismatch error.

View Replies View Related

Contains Function

Is there a function to check to see if a string contains a space
Thanks

View Replies View Related

Mid Function

I was just wondering when using the mid function how does the assigment work when the length is longer then string itself? For example

test = mid(12345, 1, 10)

What would be the end result of test?Would it be 0000012345 or 1234500000 or 12345?

View Replies View Related

Mid() Function

When I create a single character string

var str = "A"
'convert to ascii
num = asc(str)
Response.Write num ' 65 shows up
'when I have a whole string
str = "hello"
str = mid(str, 1, 1) ' return 'h'
num = asc(str)

'I get an error:

Invalid procedure call or argument:'asc'What can be done to fix this?

View Replies View Related

Use Asc() Function

I've an array to store alphabets, in my code...in a random order. How can i use the Asc() function to get the equivalent Ascii of each alaphabaet of that array....
whenever i use ,

for i = 0 to NoOfElements
Response.write Asc("ArrayName(i)")
next

it displays 65, "NOOfElements" times (ascii of A)...on the other hand..i can't write

Response.write Asc(ArrayName(i))

since this shows some error...How can i solve this?

View Replies View Related

Function To Be Available

Depending on some situations, I or the user, need to execute a function (e.g., login, sending email, etc...) and then continue from the original place. How can I make one function to be available from any page from my site?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved