![]() | |
![]() | |
![]() |
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: PyScript vs. JavaScript: A Battle of Web Titans Towards Data Science Fake online shops rely on tech skills: what drives Cameroon’s web developers to assist online fraudsters The Conversation Why Businesses Choose Bilions: A Top Web and Software Development Company for Scalable Solutions openPR.com AI-Powered Website Builders: Real Results or Empty Promises? Analytics Insight Vulnerability affecting Next.js web development framework National Cyber Security Centre Prompt Engineering for Web Development SitePoint How Wasm reinvents web development InfoWorld Pagoda: A Web Development Starter Kit for Go Programmers The New Stack Top 10 Frontend Trends in 2025 Netguru How To Become A Entry-Level Web Developer in 2025 Simplilearn.com Rediscover the Joy of Early Web Development With XSLT The New Stack Bolt.new and Netlify Power 1 Million AI-Generated Websites, Marking a New Era of AI-Driven Web Development Yahoo Finance Digital Silk Unveils Key Web Development Trends For 2025 Evrim Ağacı TypeScript: The future of web development (Front-end & back-end) NASSCOM Community How AI is Transforming Frontend Development in 2025? Analytics Insight Web Design and Development Muskegon Community College Plug-and-play web development with Astro InfoWorld Top Web Developer Interview Questions and Answers (2025) Simplilearn.com The Rise of Rust and WebAssembly in Web Development The New Stack 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 Global News Your Guide To the Best Backend Languages For 2025 Simplilearn.com How Much does Website Development Cost in 2022? appinventiv.com Top 10 Coding Languages to Learn in 2025 Education Times Top 15 Front-End Technologies in 2025 DesignRush How to Use Node Js for Backend Web Development in 2024 Simplilearn.com AI and the Web Developer's Future CMSWire.com Web Development Services elixirrdigital.com Top Web Design Trends for 2025 Designmodo Web Development | Website Design for Yachting Companies Yachting Pages 11 Best Interactive Website Designs in 2025 DesignRush The frontend web and mobile app developer’s guide to AWS re:Invent 2024 Amazon Web Services Is Web Development Approaching Its Peak as We Head Into 2025? IoT Business News 16 Best Modern Website Designs of the Moment DesignRush Essential Web Developer Skills for 2025 Simplilearn.com Top 10 Front End Languages: A Beginner's Guide Simplilearn.com 38 Web Development Stats You Should Know in 2024 Influencer Marketing Hub 23 In-Demand Full Stack Developer Skills in 2025 Simplilearn.com |
![]() |
![]() |
![]() |
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 |