VBScript - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

VBScript

Description:

VBScript Eric_at_netline.be A Simple Solution (Pioneered by Visual Basic) Objects raise events for the purpose of coordinating their activity with the rest of the world ... – PowerPoint PPT presentation

Number of Views:149
Avg rating:3.0/5.0
Slides: 20
Provided by: ME64
Category:
Tags: paint | shop | vbscript

less

Transcript and Presenter's Notes

Title: VBScript


1
VBScript
  • Eric_at_netline.be

2
Microsoft Visual Basic Scaleable Solutions
  • Visual Basic
  • Best tool for distributed client/server solutions
  • Powerful, robust, scaleable
  • Creates ActiveX Controls and documents
  • Visual Basic for Applications
  • More sophisticated application scripting
  • End-user focus, natural upgrade, superb
    integration
  • Part of Office 97 and widely licensed
  • Visual Basic Scripting Edition
  • Great for active HTML content
  • Fast, lightweight
  • Control creation edition
  • Standard edition
  • Professional edition
  • Enterprise editions

3
Extending HTML
HTML
4
What Is ActiveX Scripting?
A language-independent standard that defines the
relationship between a scripting host and a
scripting engine
ActiveX Scripting
Internet Explorer (scripting host)
Visual Basic Script (scripting engine)
5
A Simple Solution(Pioneered by Visual Basic)
  • Objects raise events for the purpose of
    coordinating their activity with the rest of the
    world
  • Script code can be attached to an objects events
    to customize behavior - this is scripting

Click Event
Button Object
Sub Button_Click MsgBox Hello world End Sub
6
The Scripting Spectrum
  • Dynamic run-time environments have varying
    requirements -no one size fits all!
  • Small scripting languages cantarget specific
    integration tasks

More coding,more like an application
Less coding,more like a document
Visual C
Visual Basic
Visual Basic Script
Internet Studio
Microsoft Office (Visual Basic for Applications)
7
Visual Basic Scripting EditionA lightweight
scripting solution
  • Small, fast, and safe
  • Proper subset of Visual Basic for Applications
  • 100 compatible with Visual Basic
  • Built into Internet Explorer 3.0and Windows NT
  • Cross-platform for easy mobility
  • All clients, servers
  • Licensable, not just for the Internet
  • Free distribution

8
VBScript Characteristics
  • Native support for OLE
  • Run time is a subset ofVisual Basic for
    Applications
  • Small, fast parser and compiler suitable for code
    distributed as source text
  • Small interpreter and run-time footprint are main
    design goal

9
Flexible Approach To Safety
  • Core engine is safe, with a limited set of
    intrinsic operations
  • Unsafe or platform-dependent features such as
    file I/O and DLLs are moved into separate objects
    (to which the host controls access)
  • Safety level can be adjusted in known secure
    environments, such as private nets or servers

10
VBScript And Visual Basic For Applications Synergy
  • VBScript is a nucleus
  • Working set size is critical
  • Suitable for porting to any platform
  • Freely licensable
  • Visual Basic for Applications adds features and
    UI
  • Premier RAD environment
  • Run time adds more featuresand convenience
  • OLE is fundamental to both

11
VBScript And Visual Basic Contrasted
  • Omitted features
  • Data types
  • User-defined types and classes
  • Named arguments
  • Error trapping and DoEvents
  • Goto, gosub, and select case
  • Debugging and conditional compilation
  • File I/O, graphics, and DLL access
  • More nitssee Web page fordetails

12
Terms
Script A bunch of code, or a
persistent object representing a bunch of
code Scripting engine An OLE server that
provides a class of scripts. E.g.,
vbscript.dll Scripting host An application or
other component that uses scripting
engines Script site A host-provided object that
facilitates communication with a
particular script
13
Browser Methods
  • RefreshRefresh view
  • GoBackNavigate to the previous item
  • GoForwardNavigate to the next item
  • GoHomeGo to home/start page

14
Browser Methods
  • GoSearchGo to search page
  • Open(Target, Location, NoHistory)Opens a target
  • StopStops opening a target
  • PrintOut()Prints the document

15
Browser MethodsFrame specific
  • Navigate(Hlink, OpenInNewWin, NoHistory)
  • BrowseBrowse for a new folder to view
  • QuitExit frame and close the open window

16
Browser Properties
  • IDispatch Container A pointer to the container,
    if any
  • IDispatch DocumentThe document
  • BSTR TypeThe type of the document
  • BOOL BusyBusy flag
  • BOOL VisibleWhether the browser is visible or
    hidden

17
Browser PropertiesFrame specific
  • BOOL FullScreen
  • BOOL ToolBar
  • BOOL StatusBar
  • BSTR StatusText
  • long Top LeftPosition of the frame window
    relative to the screen (pixels)
  • long Height WidthSize of the frame window
    (pixels)

18
Browser Events
  • Navigate(Hlink, Cancel)Fired when a new
    hyperlink is being navigated to
  • StatusTextChange(Text)Statusbar text changed
  • Error()Fired when an error occurs
  • Quit(Cancel)Fired when application is quiting

19
Questions
?
Write a Comment
User Comments (0)
About PowerShow.com