Visual Basic Programming - Baylor ECS

3y ago
85 Views
7 Downloads
353.17 KB
48 Pages
Last View : 2m ago
Last Download : 2m ago
Upload by : Nora Drum
Transcription

Visual Basic ProgrammingAn Introduction

Why Visual Basic?Programming for the Windows UserInterface is extremely complicated.H Other Graphical User Interfaces (GUI) areno better.H Visual Basic provides a convenient methodfor building user interfaces.H Visual Basic can interface with code writtenin C, for efficiency.H

What Visual Basic is notVisual Basic is not, a powerfulprogramming language that enables you todo anything you want.H Visual Basic is not, elegant or fast.H Visual Basic is not, a replacement for C.H Visual Basic is not, anything like any otherprogramming language you have ever used.H

When You Program in VB:You draw pictures of your user interface.H You draw buttons, text boxes, and otheruser-interface items.H You add little snippets of code to handle theuser interaction.H You add initialization code, usually as thelast step.H If you like, you can code more complexfunctions. (But many do not.)H

The Visual Basic InterfaceDraw YourProgramHere!

Drawing The ProgramSelect A Control From Here(Click on the appropriate button)Then Draw the control on the form

Types of ControlsStatic TextGroup BoxCheck BoxScroll BarDrop-Down ListTimerFolder HierarchyCircles and StuffPicturesPicturesEditable TextButtonRadio ButtonListScroll BarDrive ListFile ListLinesData Base AccessAnd the List Goes On and On .

A Simple ProgramDouble-Click toAdd CodeSingle-Click toSelect andChangePropertiesUsing controls: Static TextEditable TextButtons

The Properties WindowList of PropertiesFor Currently SelectedControlClick on Property, andType In New Value, orSelect New Value FromMenu.

Adding CodeControlNameExternal EventNameYou must WriteThe BodyYourselfWhat to Do When It Happens

More Complex ControlsHComplex Controls Have:– Action Properties to Execute Commands– Active Properties that Cause Actions WhenValues Are Assigned to Them– Many Types of Events for Program InteractionHExamples:– Spreadsheets– Word Processors– Web Browsers

Using C CodeWrite a DLL in CH Use the export Property on AppropriateFunctionsH Write Visual Basic Definitions for eachFunctionH Add VB Definitions to The (general)section of the VB ProgramH Use Functions as if they were VB functionsH

C Definition vs. VB DefinitionC:long FAR PASCAL export HexToLong (char *Hex)VB:Declare Function HexToLong Lib “FIRSTONE.DLL”(ByVal InString As String) As LongFunction Name Must Be The Same in Both Declarations.The Lib keyword Must Give The Name of the Library.Argument Name in VB is arbitrary.

A (Very Annoying) ProblemIt is sometimes difficult for VB to FIND the.DLL file.H If this occurs, copy the .DLL file to theWINDOWS directory.H Remember to Delete the file when you aredone.H

Alternative MethodsSome Versions of VB do not allow DLLfunction definitions in the (general) sectionof a form.H To Get Around this Problem, Create a newModule (File Menu)H Add the declarations to the (general) sectionof the moduleH You can add your own VB functions to the(general) section of a form or a module.H

Syntax ConsiderationsAll Functions are Global in VBH Variables are declared using the syntax:H– Dim Name As Type – Every variable must have a type– Dim A,B,C As Type will work, but givesweird resultsHMost Common Types: Integer, String, Long

More VB SyntaxHUse Integers for Booleans– As in C, 0 False, everything else True– Symbolic constants True and False may be used– True -1, False 0Assignments are the same as in CH The Val function converts strings to integersH The Format function converts integers tostringsH

VB StatementsAssignments are the Same as in CH Case is not significantH– Case will be adjusted for you on keywords– For Variable Names, Case is ignoredHThe Usual Operators can be used– AND is the same as both & and && dependingon context– OR and – NOT !

VB IF StatementsIf condition Then List of Statements Else List of Statements EndIfIf condition Then List of Statements EndIfComparators: , , , , , (not equal)Connectives: And, Or, NotDON’T FORGET THE ENDIF!

VB While StatementsWhile condition do List of Statements WendThe VB Manual Recommends a different structure.Use the alternative if you wish.

VB For StatementsFor Variable start to finish List of Statements Next Variable For Variable start to finish Step increment List of Statements Next Variable Example:For I 1 to 10 doA[I] A[I] 1Next I

VB ArraysIndices Always Start With ZeroH Dim A[10] As Integer Declares 11 elements,indexed from 0 through 10.H Multi-Dimensional Arrays are Permitted.H Arrays can be resized at run time (See VBHelp File for ReDim)H

VB StringsVariable LengthH Compare using standard comparatorsH Maximum length is about 64KbH Minimum length is zeroH Allocated from VB “String Space”, so mayrun out of space even on systems with muchmemory.H

And in Conclusion .GoHaveFun!

Visual Basic ProgrammingAn Introduction

Why Visual Basic?Programming for the Windows UserInterface is extremely complicated.H Other Graphical User Interfaces (GUI) areno better.H Visual Basic provides a convenient methodfor building user interfaces.H Visual Basic can interface with code writtenin C, for efficiency.H

What Visual Basic is notVisual Basic is not, a powerfulprogramming language that enables you todo anything you want.H Visual Basic is not, elegant or fast.H Visual Basic is not, a replacement for C.H Visual Basic is not, anything like any otherprogramming language you have ever used.H

When You Program in VB:You draw pictures of your user interface.H You draw buttons, text boxes, and otheruser-interface items.H You add little snippets of code to handle theuser interaction.H You add initialization code, usually as thelast step.H If you like, you can code more complexfunctions. (But many do not.)H

The Visual Basic InterfaceDraw YourProgramHere!

Drawing The ProgramSelect A Control From Here(Click on the appropriate button)Then Draw the control on the form

Types of ControlsStatic TextGroup BoxCheck BoxScroll BarDrop-Down ListTimerFolder HierarchyCircles and StuffPicturesPicturesEditable TextButtonRadio ButtonListScroll BarDrive ListFile ListLinesData Base AccessAnd the List Goes On and On .

A Simple ProgramDouble-Click toAdd CodeSingle-Click toSelect andChangePropertiesUsing controls: Static TextEditable TextButtons

The Properties WindowList of PropertiesFor Currently SelectedControlClick on Property, andType In New Value, orSelect New Value FromMenu.

Adding CodeControlNameExternal EventNameYou must WriteThe BodyYourselfWhat to Do When It Happens

More Complex ControlsHComplex Controls Have:– Action Properties to Execute Commands– Active Properties that Cause Actions WhenValues Are Assigned to Them– Many Types of Events for Program InteractionHExamples:– Spreadsheets– Word Processors– Web Browsers

Using C CodeWrite a DLL in CH Use the export Property on AppropriateFunctionsH Write Visual Basic Definitions for eachFunctionH Add VB Definitions to The (general)section of the VB ProgramH Use Functions as if they were VB functionsH

C Definition vs. VB DefinitionC:long FAR PASCAL export HexToLong (char *Hex)VB:Declare Function HexToLong Lib “FIRSTONE.DLL”(ByVal InString As String) As LongFunction Name Must Be The Same in Both Declarations.The Lib keyword Must Give The Name of the Library.Argument Name in VB is arbitrary.

A (Very Annoying) ProblemIt is sometimes difficult for VB to FIND the.DLL file.H If this occurs, copy the .DLL file to theWINDOWS directory.H Remember to Delete the file when you aredone.H

Alternative MethodsSome Versions of VB do not allow DLLfunction definitions in the (general) sectionof a form.H To Get Around this Problem, Create a newModule (File Menu)H Add the declarations to the (general) sectionof the moduleH You can add your own VB functions to the(general) section of a form or a module.H

Syntax ConsiderationsAll Functions are Global in VBH Variables are declared using the syntax:H– Dim Name As Type – Every variable must have a type– Dim A,B,C As Type will work, but givesweird resultsHMost Common Types: Integer, String, Long

More VB SyntaxHUse Integers for Booleans– As in C, 0 False, everything else True– Symbolic constants True and False may be used– True -1, False 0Assignments are the same as in CH The Val function converts strings to integersH The Format function converts integers tostringsH

VB StatementsAssignments are the Same as in CH Case is not significantH– Case will be adjusted for you on keywords– For Variable Names, Case is ignoredHThe Usual Operators can be used– AND is the same as both & and && dependingon context– OR and – NOT !

VB IF StatementsIf condition Then List of Statements Else List of Statements EndIfIf condition Then List of Statements EndIfComparators: , , , , , (not equal)Connectives: And, Or, NotDON’T FORGET THE ENDIF!

VB While StatementsWhile condition do List of Statements WendThe VB Manual Recommends a different structure.Use the alternative if you wish.

VB For StatementsFor Variable start to finish List of Statements Next Variable For Variable start to finish Step increment List of Statements Next Variable Example:For I 1 to 10 doA[I] A[I] 1Next I

VB ArraysIndices Always Start With ZeroH Dim A[10] As Integer Declares 11 elements,indexed from 0 through 10.H Multi-Dimensional Arrays are Permitted.H Arrays can be resized at run time (See VBHelp File for ReDim)H

VB StringsVariable LengthH Compare using standard comparatorsH Maximum length is about 64KbH Minimum length is zeroH Allocated from VB “String Space”, so mayrun out of space even on systems with muchmemory.H

And in Conclusion .GoHaveFun!

What Visual Basic is not H Visual Basic is not, a powerful programming language that enables you to do anything you want. H Visual Basic is not, elegant or fast. H Visual Basic is not, a replacement for C. H Visual Basic is not, anything like any other programming language you have ever used.

Related Documents:

VPN-gateway (hereafter called the ECS-gateway). The ECS-client is used to encrypt/decrypt the traffic to and from the ECS-gateway. The ECS client can be installed on a PC with Microsoft Windows operating systems. Besides to encrypt/decrypt the traffic to and from an ECS-client, the ECS-gateway forces the user to

This document is a reference guide for configuring the VMware NSX-T load balancer with ECS. An external load balancer (traffic manager) is required with ECS for applications that do not proactively monitor ECS node availability or natively manage traffic load to ECS nodes. Directing application traffic to ECS nodes using local

Baylor Scott & White Heart & Vascular Hospital - Dallas Baylor Scott & White Medical Center - Uptown Baylor University Medical Center North Central Surgical Center Baylor Scott & White Medical Center - Sunnyvale Approved by: Baylor Scott & White Health - North Texas Operating, Policy and Procedure Board on June 25, 2019

Visual Basic is a third-generation event-driven programming language first released by Microsoft in 1991. The versions of visual basic in shown below: The final version of the classic Visual Basic was Visual Basic 6. Visual Basic 6 is a user-friendly programming language designed for beginners. In 2002, Microsoft released Visual Basic.NET (VB .

The Veritas Enterprise Vault system has archive policies that archive files to a Vault Store in which an ECS based partition has been defined. The ECS Streamer driver uses the ECS S3 API to store/access objects in the S3 bucket on the ECS cluster.

102799 CPU OMNIMET II Human Performance & Robotics Lab ECS 115 10160 2122102PP Emel Demircan . 204475 SRVER DELL POWEREDGE ECS 207 2850 5JN2791 204476 SRVER DELL POWEREDGE ECS 207 2850 8JN2791 204731 SERVER DELL ECS 207 EM501 C2072C1 205217 Dell Poweredge Server ECS 207 2900 J2535D1 2062

Doctor of Nursing Practice Program Orthotics & Prosthetics Program (Nurse Anesthesia) Baylor College of Medicine . Baylor College of Medicine One Baylor Plaza, MS BCM115 . One Baylor Plaza, MS BCM115 DeBakey Bldg., Suite M108 . Debakey Building, Suite M108 Houston, Texas 77030 (713) 798-8650 (713) 798-3098

Annex L : API Standard 650 Storage Tank Data Sheet Annex M : Requirements for Tanks Operating at Elevated Temperatures Annex P : Allowable External Loads on Tank Shell Openings Annex S : Austenitic Stainless Steel Storage Tanks Annex V : Design of Storage Tanks for External Pressure Hossein Sadeghi WELDED TANKS FOR OIL STORAGE (Rev. 0) 12 STANDARD INTRODUCTION. Hossein Sadeghi WELDED TANKS FOR .