Presentation is loading. Please wait.

Presentation is loading. Please wait.

VBScript Microsoft Visual Basic: Scaleable Solutions Visual Basic  Best tool for distributed client/server solutions  Powerful, robust,

Similar presentations


Presentation on theme: "VBScript Microsoft Visual Basic: Scaleable Solutions Visual Basic  Best tool for distributed client/server solutions  Powerful, robust,"— Presentation transcript:

1 VBScript Eric@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 Scripting Edition  Great for active HTML content  Fast, lightweight Visual Basic for Applications  More sophisticated application scripting  End-user focus, natural upgrade, superb integration  Part of Office 97 and widely licensed  Standard edition  Professional edition  Enterprise editions  Control creation edition

3 Extending HTML HTMLHTML FormcontrolsFormcontrols<INPUTPicturesPictures<IMGOfficedocsOfficedocs<EMBEDJavaappletsJavaapplets<APPLETLayoutLayout<TABLE FXFX<MARQUEEHyperlinksHyperlinks<AParsers/compilersParsers/compilers<SCRIPTGenericGeneric<OBJECT

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 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 object’s events to customize behavior - this is “scripting” ButtonObjectButtonObject ClickEventClickEvent Sub Button_Click MsgBox “Hello world” MsgBox “Hello world” End Sub Sub Button_Click MsgBox “Hello world” MsgBox “Hello world” End Sub

6 6 The Scripting Spectrum Dynamic run-time environments have varying requirements - no one size fits all! Small scripting languages can target 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 7 Visual Basic ® Scripting Edition A lightweight scripting solution Small, fast, and safe Proper subset of Visual Basic ® for Applications –100% compatible with Visual Basic –Built into Internet Explorer 3.0 and Windows NT ™ Cross-platform for easy mobility –All clients, servers –Licensable, not just for the Internet Free distribution

8 8 VBScript Characteristics Native support for OLE Run time is a subset of Visual 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 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 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 features and convenience OLE is fundamental to both

11 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 nits…see Web page for details

12 Terms ScriptA “bunch of code”, or a persistent object representing a “bunch of code” Scripting engineAn OLE server that provides a class of scripts. E.g., vbscript.dll Scripting host An application or other component that uses scripting engines Script siteA host-provided object that facilitates communication with a particular script

13 Browser Methods  Refresh Refresh view  GoBack Navigate to the previous item  GoForward Navigate to the next item  GoHome Go to home/start page

14 Browser Methods  GoSearch Go to search page  Open(Target, Location, NoHistory) Opens a target  Stop Stops opening a target  PrintOut(…) Prints the document

15 Browser Methods Frame specific  Navigate(Hlink, OpenInNewWin, NoHistory)  Browse Browse for a new folder to view  Quit Exit frame and close the open window

16 Browser Properties  IDispatch* Container A pointer to the container, if any  IDispatch* Document The document  BSTR Type The type of the document  BOOL Busy Busy flag  BOOL Visible Whether the browser is visible or hidden

17 Browser Properties Frame specific  BOOL FullScreen  BOOL ToolBar  BOOL StatusBar  BSTR StatusText  long Top & Left Position of the frame window relative to the screen (pixels)  long Height & Width Size 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


Download ppt "VBScript Microsoft Visual Basic: Scaleable Solutions Visual Basic  Best tool for distributed client/server solutions  Powerful, robust,"

Similar presentations


Ads by Google