Internet Programming - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Internet Programming

Description:

Forms are used to capture user input. FrontPage simplifies ... Write a program (or script) using a simple scripting language such as JavaScript or VBScript ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 15
Provided by: alexain
Category:

less

Transcript and Presenter's Notes

Title: Internet Programming


1
Internet Programming
  • Lecture 3

2
Web-based Forms and CGI Programs
  • Forms are used to capture user input
  • FrontPage simplifies their creation via Insert
    Form
  • To a blank form you can insert
  • Text, Tables, Graphics
  • Check Boxes, Push Buttons, Radio Buttons
  • Drop Down Menus

3
Processing a Form
  • To process the data captured on a form you can
  • Submit the form to a remote CGI (Common Gateway
    Interface) program
  • Write a program (or script) using a simple
    scripting language such as JavaScript or VBScript

4
Programming Languages
  • Need to be structured language.
  • Three basic language structures
  • Sequence
  • Selection
  • Iteration

5
Sequence
  • A list of actions to be carried out in the order
    specified
  • Do this
  • Now do this
  • Then this
  • Finishing with this.

6
Selection
  • Choose from one or more options which action to
    take
  • If you want to do this Then Do it
  • Else Do this instead
  • End If

7
Multiple Selection
  • If selectnum 0 Then exit
  • ElseIf selectnum 1 Then DoCmd WCLUPD.Show
  • ElseIf selectnum 2 Then DoCmd WENQ.Show
  • ElseIf selectnum 3 Then DoCmd WCOMDUE.Show
  • Else MsgBox You MUST type 0,1,2 or 3
  • End If
  • End If
  • End If
  • End If

8
Multiple Selection 2
  • Cumbersome using nested IfThenElses
  • Select Case selectnum
  • Case 0 exit
  • Case 1 client enquiry and input/changes
  • DoCmd WCLUPD.Show
  • Case 2 enqiry screen and reports
  • DoCmd WENQ.Show
  • Case 3 commission due to introducers
  • DoCmd WCOMDUE.Show
  • Case Else
  • MsgBox You MUST type 0,1,2 or 3
  • End Select

9
Iteration (Loops)
  • Some tasks have to be repeated
  • e.g. delegate details are added one delegate at a
    time until all have been booked on a course.
  • Or each record in a database has to be examined
    to see if it meets some given criteria

10
Loop Constructs
  • The For . Next
  • There are two variants of this structure
  • For counterstart To end Step step
  • Exit For
  • Next
  • Which executes the loop once for each value in a
    series that begins with start and ends with end
    and increments by step.

11
Another For Loop
  • The second form is
  • For Each element In group
  • Exit For
  • Next
  • Which executes the loop for each element in a
    collection or array.
  •  

12
Yet More Loops
  • b) Do While/Until condition
  • Exit Do
  • Loop
  • c) Do
  • Exit Do
  • Loop While/Until condition
  • d) While condition
  • Wend

13
An Example
  • WHILE NOT Rs.EOF
  • Count Count 1
  • Response.Write("ltligt")
  • Response.Write("lth4gt")
  • Response.Write("lta href'photos.asp?Counter")
  • Response.Write(Count)
  • Response.Write("'gt")
  • Response.Write(Rs("title"))
  • Response.Write("lt/agt")
  • Response.Write("lt/h4gt")
  • Response.Write("lt/ligt")
  • Rs.MoveNext
  • WEND

14
End of lecture 3
Write a Comment
User Comments (0)
About PowerShow.com