Download presentation
Presentation is loading. Please wait.
1
1 ASP-Code Examples if....then....else...... end if for..............................next do while.................... loop database response.write “ “ & “ “ & i htmlIETuna Tuna Tuna Tuna response.write “ Tuna “ typeMismatch
2
2 response.write response.write “ Tuna “ Handling Error: 1 st way: Do not use “ “ in HTML! But; face = lucida ? <% response.write %> ? 2 nd way: use ‘ ‘ instead of “ “ Examples: Example 1:Adding 2 numbers <% num1 = 40 num2 = 30 response.write num1 + num2 %>
3
3 response.write Example 2:finding y <% num1 = 10 num2 = 20 sq1 = num1 * num1 sq2 = num2 * num2 sum = num1 + num2 response.write sq2 &","& sq1 & "," & sum Example 3:finding the square of 2 numbers and the addition of their square
4
4 response.write & if..then..else..end if Example 4:VAT included Price 0 THEN response.write num &" "& "is a positive number.“ ELSE response.write num &" "& "is a negative number.“ END IF %> Example 5:positive or negative?
5
5 response.write & if..then..else..end if Example 6: If a number less than 10, output it's square otherwise the number only. 10 THEN sq = num * num response.write sq ELSE response.write num END IF %> num2 THEN num = num1 - num2 ELSE num = num2 - num1 END IF Response.Write num %> Example 7: Subtract the smaller from the larger
6
6 response.write & if..then..else..end if Example 8: SNG room 100$ others 150$> Example 9: PASS, FAIL = 50 THEN Response.Write "PASS“ ELSE Response.Write "FAIL“ END IF %>
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.