1 Today, –Some Date functions/formats –Number Formats –Some String functions –String/Integer Conversions –Control Statements If then...Elseif then...else.

Slides:



Advertisements
Similar presentations
1a)I can identify the hypothesis and the conclusion of a conditional 1b)I can determine if a conditional is true or false 1c)I can write the converse of.
Advertisements

Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
AP STUDY SESSION 2.
1 VBA Introduction. Basic Components 2 VBA LANGUAGE OFFICE OBJECTS EXCEL OBJECTS ACCESS OBJECTS WORD OBJECTS OUTLOOK OBJECTS POWERPOINT OBJECTS.
4 Copyright © 2005, Oracle. All rights reserved. Exploring Primitive Data Types and Operators.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
OPEN SENTENCE: A math statement with one or more variables. EQUATION: A math statement that has an equal (=) sign. REPLACEMENT SET: A set of numbers that.
Break Time Remaining 10:00.
Turing Machines.
PP Test Review Sections 6-1 to 6-6
1/12 Steven Leung Very Basic Perl Tricks A Few Ground Rules File I/O and Formatting Operators, Flow Control Statements Regular Expression Subroutines Hash.
Evaluate the numerical expression 52 – 2 ∙ 4 + (7 – 2)
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 24.1 Test-Driving the Ticket Information Application.
Introduction to C Systems Programming Concepts. Introduction to C A simple C Program A simple C Program –Variable Declarations –printf ( ) Compiling and.
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
Solving Equations How to Solve Them
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
Section 7.6 What we are Learning:
1..
Lilian Blot PART III: ITERATIONS Core Elements Autumn 2012 TPOP 1.
Overview of programming in C C is a fast, efficient, flexible programming language Paradigm: C is procedural (like Fortran, Pascal), not object oriented.
Area under curves Consider the curve y = f(x) for x  [a, b] The actual area under the curve is units 2 The approximate area is the sum of areas.
CSM18 Visual Basic Section 2 Department of Computing UniS 1 CSM18 Further Constructs in VB A statement is the fundamental syntactical element of a program.
Solving Equations A Solution
1 Termination and shape-shifting heaps Byron Cook Microsoft Research, Cambridge Joint work with Josh Berdine, Dino Distefano, and.
Do Now 1/6/10 Take out HW from last night. –Text p. 401, #4-20 multiples of 4 & #22, 26, & 28 Copy HW in your planner. –Text p. 409, #4-52 multiples of.
1 of 31 Images from Africa. 2 of 31 My little Haitian friend Antoine (1985)
CS 240 Computer Programming 1
Preview Warm Up California Standards Lesson Presentation.
: 3 00.
5 minutes.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Types of selection structures
Lilian Blot CORE ELEMENTS SELECTION & FUNCTIONS Lecture 3 Autumn 2014 TPOP 1.
1 Chapter 3:Operators and Expressions| SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2006 | Last Updated: July 2006 Slide 1 Operators and Expressions.
Clock will move after 1 minute
1 Fundamental Stock Analysis The Market is NOT Efficient Fundamental analysis can uncover individual companies selling in the public market at significant.
Select a time to count down from the clock above
Warm Up Determine if each statement is true or false. 1. The measure of an obtuse angle is less than 90°. 2. All perfect-square real numbers are positive.
Warm Up Write a conditional statement questions 1 and The intersection of two lines is a point. 2. An odd number is one more than a multiple of 2.
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Pascal Programming Today Chapter 4 1 »Conditional statements allow the execution of one of a number of possible operations. »Conditional statements include:
1 PHP Statement Constructs Server Scripting. 5-2 Basic Statement All Statements end in a semicolon. Statements are delimited from the HTML code by enclosing.
On to… string operations & functions. Concatenation (&) §When we want to combine two character strings into one new (longer) string, we can concatenate.
CSI 101 Spring 2009 Review and Recap of Visual Basic Wednesday, April 29 th.
CS0004: Introduction to Programming Relational Operators, Logical Operators, and If Statements.
VB Arrays Chapter 8 Dr. John P. Abraham Professor UTPA.
CIS 338: Operators and Formatting in VB.NET Dr. Ralph D. Westfall April, 2011.
PHP - 1h. How it works Client requests document Server loads document in memory Server processes document with relevant module (PHP) Server sends XHTML.
‘Tirgul’ # 2 Enterprise Development Using Visual Basic 6.0 Autumn 2002 Tirgul #2.
Programming with Visual C++: Concepts and Projects Chapter 3A: Integral Data (Concepts)
Last Week Modules Save functions to a file, e.g., filename.py The file filename.py is a module We can use the functions in filename.py by importing it.
Midterm Review Important control structures Functions Loops Conditionals Important things to review Binary Boolean operators (and, or, not) Libraries (import.
Midterm Exam Topics (Prof. Chang's section) CMSC 201.
C Language 1 Program Looping. C Language2 Topics Program looping Program looping Relational operators / expressions Relational operators / expressions.
5-5 Indirect Proof. Indirect Reasoning: all possibilities are considered and then all but one are proved false. The remaining possibility must be true.
CONDITIONAL STATEMENTS Intro to AlgebraFarris 2015.
Java String Methods - Codehs
Basic operators - strings
البرمجة بلغة فيجول بيسيك
مراحل كتابة البرنامج بلغة فيجول بيسك ستديو
.Net Programming with C#
CS100J 26 April. Matlab Use help button!!! Variables, values, types
Logical Operations In Matlab.
Conditional Logic Presentation Name Course Name
Python Basics with Jupyter Notebook
C# Revision Cards Data types
GCSE Computing:: Selection (IF statements)
Presentation transcript:

1 Today, –Some Date functions/formats –Number Formats –Some String functions –String/Integer Conversions –Control Statements If then...Elseif then...else Select case –Loop Statements Do...while While... Wend For each.. in.. Next –How to get server variables

2 Date() Today is, the month is ; the date is - - Today is Thursday, the month is February; the date is

3 Date Formats <% var1 = now() response.write var1 %> format 0 = format 1 = format 3 = format 4 = 2/17/ :10:37 AM format 0 =2/17/ :10:37 AM format 1 =Thursday, February 17, 2005 format 2 =2/17/2005 format 3 =12:10:37 AM format 4 =00:10

4 Number Formats FormatNumber(NumToBeFormatted, NumOfDigitsAfterDecimal, IncludeLeadingDigit, UseParensForNegativeNumbers) In last 2 parameters; -1 for true, 0 for false, or -2 to use regional settings <% var1 = var2 = %>  var1 = 55, var2 =  var2 = (544,545.8) var1 =  var1 = $55, var2 =  var2 = ($544,545.8) var1 =  var1 = 5,555,643.33% var2 =  var2 = (54,454,582.3%)

5 Strings LEN # of char. of a string  12 INSTR (index, long_string, string) 0 for binary, 1 for text compare! “%> " 'writes 22%> <% mystr2 = "abcdefgh" response.write Instr(mystr2, "de") &" "  4 response.write len(mystr2)&" “  8 LCASE - UCASE response.write LCase(mystr2)&" “  abcdefgh response.write UCase(mystr2) &" “ %>  ABCDEFGH

6 Strings LEFT, RIGHT, MID <% mystr3 = "THE LORD OF THE RINGS" response.write LEFT(mystr3,3) &" “  THE response.write RIGHT(mystr3,5)&" “  RINGS response.write MID(mystr3,5,4)&" “ %>  LORD REVERSE STRING <% mystr4 = "kitap" response.write strReverse(mystr4)&" “ %>

7 Convert To Strings/Integers <% myint = 41 mystr = CStr(myint) & " " & "times Masallah!" response.write mystr %> <% mystr = "12" myint = CInt(mystr)/3 'myint will be 4 response.write myint %>

8 Select...Case Statements These are useful when you want to test one condition and do multiple actions based upon it. <% select case a case 1 ‘do this... case 2 ‘do this... case 3 ‘do this... case else ‘do this... end select %> <% if a = “1” then ‘do this Elseif a = “2” then ‘do this Elseif a = “3” then ‘do this Elseif a= “4” then ‘do this End if %> More then a few results

9 Do...Loop Statements Do Loop continues to do a specific action until the supplied statement is found to be true... <% Do { While Condition | Until Condition } ‘do this loop %> - Or - <% Do ‘do this Loop { While Condition | Until Condition } %>

10 Do...Loop Statements Do Loop continues to do a specific action until the supplied statement is found to be true... <% i= 0 Do While i < 5 Response.write(“i=“ & i &” ”) i = i +1 loop %>

11 While...WEnd Statements This loop performs the requested action until a condition is met <% While {Condition} ‘perform this WEnd %>

12 While...WEnd Statements It is commonly used to loop through a recordset that has been returned from a database. <% While NOT RS.EOF response.write(“Name= “ &RS(“Fname”) & “ ”) RS.MoveNext WEnd %>

13 For each...Next Statements It is used to loop through collections like recordsets, form collections, or arrays. <% gunler = Array(“Pazartesi”, “Sali”, “Çarşamba”, Perşembe,”Cuma”, “Cumartesi”, “Pazar”) For Each gun in gunler response.write gun response.write “ ” Next %>

14 For each...Next Statements It is used to loop through collections like recordsets, form collections, or arrays. <% For Each x in Request.ServerVariables response.write (x &“ = “ & Request.ServerVariables(x) & “ ”) Next %>

15 How to Get Server Variables Server variables are environment variables that tell you about the environment that your application is running in. <% response.write (Request.ServerVariables(“server_variable_name”)) %> Exp: <% response.write (Request.ServerVariables(“REMOTE_ADDR”)) response.write (Request.ServerVariables(“HTTP_USER_AGENT”)) %>