![]() | |
![]() | |
![]() |
Web Development Information |
|
![]() |
Functions and Subroutines in ASP
Functions and Subroutines in ASPIf you read our Tutorial on Include Files (SSI) then you learned how to encapsulate ASP code within include files and the benefits it brings us. Function getBalloon(strColour) Dim Tempstr strColour = lcase(strColour) 'This converts the value lowercase. Select Case strColour Case "red" Tempstr = "Here is your red balloon" Case "yellow" Tempstr = "Here is your yellow balloon" Case "green" Tempstr = "Here is your green balloon" Case "blue" Tempstr = "Here is your blue balloon" Case Else Tempstr = "Sorry, we have sold out of that Colour" End Select getBalloon = Tempstr End Function %> A Function is passed some information. The information we pass a Function, is known as an 'argument'. The information we get back from a Function is known as the 'return value'. Whilst a Function can have many arguments, it can only have one return value. Function calcTax(amount, taxrate) Dim Tempvar Tempvar = amount * (taxrate / 100) CalcTax = Round(Tempvar, 2) 'round the result to 2 decimal places End Function %> Again, another basic example. We should notice this time that the Function accepts two arguments. shoppingbill=goodsTotal + calcTax(goodsTotal,17.5) Response.Write "Your shopping came to £" & goodsTotal Response.Write " VAT amount = £" & calcTax(goodsTotal) Response.Write "Total Amount Due = £" & shoppingbill %> Above you see the example function in action... easy huh! Sub Bday(strName, intAge) Response.Write "Happy Birthday " & Name Response.Write ", You are " & intAge & " years old today" End Sub 'now, call the sub bDay "Joe",26 %> The above Sub, demonstrates my point. We put something in, it performs an action (in this case writing to the screen), but nothing is returned to us in the code. One thing that REALLY IS important when using a sub, is that we do not put brackets around the arguments... Because we do not have a return value we do not need brackets and in this case, if we try we will get an error. Rob Collyer, experienced with 20 years programming knowledge and site administrator of www.webforumz.com - Copyright 2003-2004
MORE RESOURCES: Securing WebAssembly in Web Development NASSCOM Community Top 5 Uses of WebAssembly for Web Developers The New Stack Top 15 Front-End Technologies in 2025 DesignRush Web Design and Development Muskegon Community College UA Little Rock Student Gains International Experience as Web Development Intern in Australia University of Arkansas at Little Rock Rediscover the Joy of Early Web Development With XSLT The New Stack DOGE.gov Debacle: How a Government Website Went to the Dogs and What It Means for Cybersecurity Security Boulevard Essential Web Developer Skills for 2025 Simplilearn Elon Musk's DOGE Website Database Vulnerability Let Anyone Make Entries Directly - CybersecurityNews 2024: Rising Senior Uses Computer Science Coursework to Thrive in Web Development Role Muhlenberg College Northeastern grad goes from schooling to working full time at web development startup he created Northeastern University How Much does Website Development Cost in 2022? Appinventiv Best PHP Frameworks for Web Development in 2024 Simplilearn StackBlitz achieves $4M ARR in 4 weeks for their AI web development platform with Claude - Anthropic The Rise of Rust and WebAssembly in Web Development The New Stack Register for AIM’s free web development course by Sept. 10 Silicon Prairie News Top 10 Front End Languages: A Beginner's Guide Simplilearn Best web design software of 2024 TechRadar Is Web Development Approaching Its Peak as We Head Into 2025? IoT Business News HeartCore Partners with NTT Data Business Brains GlobeNewswire Top Web Design Trends for 2025 Designmodo 23 In-Demand Full Stack Developer Skills in 2025 Simplilearn Web Design Statistics By UI/UX, Market Size, Web Development, Industry and Demographics Coolest Gadgets New Web Development Tool Pulls Design Tokens From Figma The New Stack Best web development tool of 2024 TechRadar Generative AI for Web Developers O'Reilly Media 38 Web Development Stats You Should Know in 2024 Influencer Marketing Hub Web Development | Website Design for Yachting Companies Yachting Pages Best Web Design Companies Toronto Search Engine People Node Javascript: A Complete Guide to Node Js Simplilearn Free Internship 2025 on Python | AI | ML | Data Science | Web Development! Sakshi Education English The best websites for finding developers Business.com 11 Best Interactive Website Designs in 2025 DesignRush |
![]() |
![]() |
![]() |
RELATED ARTICLES
10 Things You Should Be Monitoring On Your Website Every business needs to know how it is doing. That's the idea behind exit surveys, customer feedback forms, suggestion boxes and other devices. Make Your Own Website - General Website Design Tips Wow, we`ve already taken a domain and chosen a web host. Great job ! Now it`s time for something special: making your own website. Are You Overlooking the Benefits of Using Sub-Domains within Your Web-hosting account? One of the most useful features offered by some web hosting companies, is the option of creating sub-domains in the same web hosting account. The problem is, most website owners are not aware of why and how to create sub-domains. In Business? 10 Reasons Why You Need a Website -- Now! 1) Word of Mouth The single most powerful form of new business creation is word of mouth. Your past customers, friends, acquaintances and staff aren't likely to carry your brochure or even your business card everywhere they go. How to Build a Database Driven Web Site If you ever want to create a state directory, articledirectory, dating site or link directory, you need to know aboutcreating database driven web sites. This may seem like adaunting task at first, if you have never done it, howeverI was in the same boat as you. Up The Sandbox! Go to any internet marketing forum you want these days andone of the topics is sure to be whether or not there is a"sandbox" at Google where new sites are forced to come andplay for 3-6 months before joining the ranks of ranked andsearched results. On the surface it would appear that thisis so. Better Web Site ROI: Efficient Online Business with SEO, PPC, Split Testing, and Forums If you're looking for better web site ROI, chances are, the web is only one part of your business, you have a specific budget for your web site, and you want the site to not only carry its own weight, but why can't it make you some extra dough, too?The corporate situation: budgets need to be closely watched, and tech people can't get carried away with unnecessary frills.My own experience making money online and becoming and SEO expert was more guerilla than corporate. Top 7 Tips for Building an Antique Car Website Like wine cars get more attractive to collectors as years pass by. The fact is there are only a finite number of cars made in the world in any model and make. Instant Relevant Web Site Content - No Its Not a Bot In about the Time it takes to Watch a Reality TV Show (About 1 Hour) I added 10 Pages of Relevant Content to my Web Page without a Bot.Adding content to your Page Fast is Easy with the Use of Free Articles you Can Reprint. The Number 1 Reason Most Websites Fail Failure, just like success, is measured differently by each and every one of us. What one man treats as success another may view as failure. Lead Generation How to -- 10 Tips On Generating More Internet Sales Leads Many millions of dollars are being wasted on promoting and sending traffic to ineffective lead generation websites. Here are my top 10 tips to make your site generate more leads for you and your company. What Does An Ex-Basketball Coach Know About Pulling Web Metrics? In my previous life.. How Disabled Users Access The Internet In 1995 a new era of accessibility for disabled people began. The Disability Discrimination Act was passed, stating that:"It is unlawful for a service provider to discriminate against a disabled person by refusing to provide any service which it provides to members of the public. User Interface Design: Key to Achieve Best Web Development From early days of www, the Internet sites that are added day by day are increasing tremendously. When you will consider this pool of web, may be they are about computers, industry, entertainment, search engines, fashion, organizational or even individual, all of these sites are concerned about one major part of web development apart from the logic or programming efforts behind it is 'User Interface Design'. 50 Ways To Use Your Website A website is the most versatile and cost-effective marketing tool on the market. It is also an investment. The Cost Of A Web Site Just starting out, you can start with a simple informational site, which is all most need initially, and build up to a fuller site (e-commerce and/or interactive) when you can afford it.Your goal should be to get an online presence. Be Creative Before You Purchase Or Create A Website Before you jump into spending coutnless hours on designing and publishing your website, or spending hundreds on having it done by anyone else you should plan out your full design (or structure). This is very important so that when it comes time to do this long-lasting project you will be well prepared. Creating Websites that Cater to Exam Preparations One of the things that Internet excels is disseminating information and knowledge across many brains and continents. In this global economy the aspirations of the younger generation is not bounded by countries or continents. UK Online Shopping with an Edge, for Buyers and Sellers Alike Any new website competing on the internet, needs to take its business seriously, as there is so much competition around. So, there needs to be an edge on quality, content, and general user appeal. How to Create a Professional Web Site in 24 Hours While creating a Web site may seem like a difficult, time-intensive and expensive process, it's actually possible to have a professional site up and running in less than 24 hours for under $50 with little to no prior Web development experience. And whether your business sells products or services, you can use a Web site to increase your revenue and reduce your start-up costs. ![]() |
home | site map |
© 2006 |