SlideShare a Scribd company logo
Juanito Bibat
Angelika Cabus
Code for Visual Basic
 There are many sources of code
 within the Visual Basic
 documentation set. This topic
 helps you get started in locating
 that code. Note that some of this
 code is contained within topics
 that provide further explanation
 or instructions on how to perform
 a task, whereas some is contained
 in special topics devoted only to
 displaying a code example.
   Visual Basic applications usually
    consist of the following:


    1.Forms-an application may
    consits of one or more
    forms.
    2.Form controls-forms are
    created with controls.
    3.Code-programming language
    that will direct application
    execution.
*   Input and output-are terms used to
    describe the method of receiving data and
    sending data from the computer to the user.
    *Form module-a module file
    that holds one or more
    forms.
    *Standard module-a file that
    holds code that is not related to
    a form.
    *String-a series of
    characters that is treated
    as a single entity.
Output / Input
FORM
FORM MODULE




STANDARD
MODULE
STRING
Data
 basics:)
Data types
The three broad categories of data
in Visual Basic.

1.numeric-for numbers used in
data
2.string-for alphanumeric data
3.special-for special data type
including items that check box
values
VISUAL       Description
BASIC DATA   and range
TYPES
             Data type that
             takes one of two
BOOLEAN      of the following
             values true or
             false.
             Numeric values
BYTE         without
             decimals from
             0 to 255
Here's a simple Visual Basic form. It looks just like any other form that you use in Windows applications. The header area has a caption, the control menu, and the minimize/ma




                                                                          Holds tdate and time values
                                                                          from 0:00:00(midnight) on
          DATE                                                            january 1, 0001 through 11:59:59
                                                                          PM on december
                                                                          31, 9999

                                                                             That represents
    Decimal                                                                  numbers with 28
                                                                             decimal places

                                                                            Numeric values from -
     Double                                                                 1.79769313486232E+308
                                                                            To
                                                                            1.79769313486232E+308.
NUMERIC VALUES
INTEGER   WITH NO DECIMAL
          POINT FROM -32,768
          TO 32,767
          THE INTEGER DATA VALUES
LONG      FROM-2,147,483,647



          SPECIAL DATA TYPE
OBJECT    THT HOLDS CONTROLS
          AND FORMS.

SINGLE    NUMERIC VALUES FROM -
          3.402823E+38 TO 3.402823E+38.
THE DIM STATEMENTS LOCATION
 Dim that appears in an event
procedure and can only be
used within that event
procedure called a Local
variable.Dim in a module’s
general section that can
access all the variables
within that module is called
Global variable.
The Dim statement is usually
written in the following format:

*Dim VarName As DataType

*VarName is a variable name
that you create  .
Prefix Data type example
 Bln   Boolean    blnlsOverTime

 Byt   Byte          bytAge
 Cur   Currency curHourlyPay

 Dtm   Date      dteFirstBegan
Dbl    Double dblMicroMeasurement
Int Integer ingCount
Lng Long lngStarDistance
Obj Object objSoundClip
Sng Single sngYearSales
Str String strLastName
Vnt or
var    Variant vntControlValue
Take note of the following code:


  curNetSales =curGrissSales
  - curCostOfSales


   intResult = (1 + 2 ) * 3
Working with scientific
 notation
 Scientific notation is used
to represent extremely
large and small decimal
numbers without
including a lot of zeros or
other digits.
To convert a scientific
 notation value to its real
 value:
 1.After the D or E ,raise 10 to the number.for
 example,the +6 in the number 1.2345E+6 raise 10
 to the 6th power to get 1,000,000.


2.Multiply the number at the left of
the D or E by the value in step
1.Multiply 1.2345 by the 1,000,000 to
get a result of 1,234,500.
Variables that hold data
To hold data that can change based on
calculations or the changes can be stated
within the application,variables must be
declared.
The Dim statement lets you recognize that the
variables holds the Currency data type and
The curToTalSales is the variable’s name.
Expressions and math
operators
 Math operators allow
calculation and assignment
of expression results to
variables when you code
assignment statements that
contain expressions.
Visual basic primary
math operators
Operator Description
 +     Adds two values
       Subtracts one
 -     value from
       another value
*          Multiplies
            two values
 /         Divides one value
           by another value
           Raises a value
 ^         to a power
           Concatenates
& (or +)   two strings
Concatenation
 The concatenation
operator joins one
string to the end of
another.
Take note of the
following code:
strFullName = lblFirstName
& “ “ & lblLastName
Visual basic coding

More Related Content

PDF
Ijcatr04041020
PDF
Number Systems
PDF
International Journal of Engineering Research and Development
PDF
Variables in Visual Basic Programming
PPT
Data Representation
PPTX
Data representation
PPTX
What is Gray Code?
PDF
EFFICIENT MULTIPLIERS FOR 1-OUT-OF-3 BINARY SIGNED-DIGIT NUMBER SYSTEM
Ijcatr04041020
Number Systems
International Journal of Engineering Research and Development
Variables in Visual Basic Programming
Data Representation
Data representation
What is Gray Code?
EFFICIENT MULTIPLIERS FOR 1-OUT-OF-3 BINARY SIGNED-DIGIT NUMBER SYSTEM

What's hot (20)

PDF
Module 1 number systems and code1
PPTX
Data Representation
PPTX
Data representation
PPT
Lec 02 data representation part 1
PDF
Data representation computer architecture
PPTX
Chap ii.BCD code,Gray code
PDF
Csc 2313 (lecture 3)
PPTX
Data representation
PPTX
data representation
PPTX
Data representation in computers
PPTX
Representation of Integers
PPT
Lec 02 data representation part 2
PDF
Data representation in computers
PPT
Lecture 2
PDF
Data representation
PDF
F044033742
PPSX
Fixed point and floating-point numbers
PDF
CArcMOOC 02.04 - Special encodings
PPT
Digital logic design part1
PPT
digital logic design number system
Module 1 number systems and code1
Data Representation
Data representation
Lec 02 data representation part 1
Data representation computer architecture
Chap ii.BCD code,Gray code
Csc 2313 (lecture 3)
Data representation
data representation
Data representation in computers
Representation of Integers
Lec 02 data representation part 2
Data representation in computers
Lecture 2
Data representation
F044033742
Fixed point and floating-point numbers
CArcMOOC 02.04 - Special encodings
Digital logic design part1
digital logic design number system
Ad

Viewers also liked (15)

PDF
Lo39
DOCX
C++ Sample Codes (Data Structure)
PPTX
Code Inventory
PPTX
Interoduction to c++
PDF
How to Work with Dev-C++
PPTX
Payroll
PPT
Visual Basic 6.0
PPT
visual basic for the beginner
PPTX
Atm (bm)
PPT
An atm with an eye
PPTX
automated teller machines
PDF
Payroll Management System SRS
PPT
Atm System
PPT
Visual Basic Codes And Screen Designs
Lo39
C++ Sample Codes (Data Structure)
Code Inventory
Interoduction to c++
How to Work with Dev-C++
Payroll
Visual Basic 6.0
visual basic for the beginner
Atm (bm)
An atm with an eye
automated teller machines
Payroll Management System SRS
Atm System
Visual Basic Codes And Screen Designs
Ad

Similar to Visual basic coding (20)

PDF
Learning VB.NET Programming Concepts
PPTX
Data types vbnet
PPTX
Data types vbnet
PPTX
Data types vbnet
PPS
Visual Basic Review - ICA
DOCX
UNIT-II VISUAL BASIC.NET | BCA
PPT
Visual basic intoduction
PPTX
Input output
PPTX
Input output
PDF
2 beginning problem solving concepts for the computer
PPT
Mesics lecture 3 c – constants and variables
PPT
Datatypes
PPT
FP 201 Unit 2 - Part 2
PPTX
Chapter 03
PPT
Chapter 03
PPTX
c++ computer programming language datatypes ,operators,Lecture 03 04
PPT
ملخص البرمجة المرئية - الوحدة الثالثة
DOCX
MaciasWinter 2020ENG 107Project #2A Year in Gami.docx
PDF
Chapter 2 basic element of programming
DOC
Field datatypes
Learning VB.NET Programming Concepts
Data types vbnet
Data types vbnet
Data types vbnet
Visual Basic Review - ICA
UNIT-II VISUAL BASIC.NET | BCA
Visual basic intoduction
Input output
Input output
2 beginning problem solving concepts for the computer
Mesics lecture 3 c – constants and variables
Datatypes
FP 201 Unit 2 - Part 2
Chapter 03
Chapter 03
c++ computer programming language datatypes ,operators,Lecture 03 04
ملخص البرمجة المرئية - الوحدة الثالثة
MaciasWinter 2020ENG 107Project #2A Year in Gami.docx
Chapter 2 basic element of programming
Field datatypes

More from Sara Corpuz (9)

PDF
Title, heading and paragraph tags
PPTX
Creating your 1st html page
PPTX
Program logic formulation
PPTX
Flowcharting and pseudocoding
PPTX
Working with visual basic applications
PPTX
Building visual basic application
PPT
Visual basic
PPTX
PPTX
Working with comparison operators
Title, heading and paragraph tags
Creating your 1st html page
Program logic formulation
Flowcharting and pseudocoding
Working with visual basic applications
Building visual basic application
Visual basic
Working with comparison operators

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25-Week II
A comparative analysis of optical character recognition models for extracting...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The AUB Centre for AI in Media Proposal.docx
Assigned Numbers - 2025 - Bluetooth® Document
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Network Security Unit 5.pdf for BCA BBA.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...

Visual basic coding

  • 2. Code for Visual Basic There are many sources of code within the Visual Basic documentation set. This topic helps you get started in locating that code. Note that some of this code is contained within topics that provide further explanation or instructions on how to perform a task, whereas some is contained in special topics devoted only to displaying a code example.
  • 3. Visual Basic applications usually consist of the following: 1.Forms-an application may consits of one or more forms. 2.Form controls-forms are created with controls. 3.Code-programming language that will direct application execution.
  • 4. * Input and output-are terms used to describe the method of receiving data and sending data from the computer to the user. *Form module-a module file that holds one or more forms. *Standard module-a file that holds code that is not related to a form. *String-a series of characters that is treated as a single entity.
  • 10. Data types The three broad categories of data in Visual Basic. 1.numeric-for numbers used in data 2.string-for alphanumeric data 3.special-for special data type including items that check box values
  • 11. VISUAL Description BASIC DATA and range TYPES Data type that takes one of two BOOLEAN of the following values true or false. Numeric values BYTE without decimals from 0 to 255
  • 12. Here's a simple Visual Basic form. It looks just like any other form that you use in Windows applications. The header area has a caption, the control menu, and the minimize/ma Holds tdate and time values from 0:00:00(midnight) on DATE january 1, 0001 through 11:59:59 PM on december 31, 9999 That represents Decimal numbers with 28 decimal places Numeric values from - Double 1.79769313486232E+308 To 1.79769313486232E+308.
  • 13. NUMERIC VALUES INTEGER WITH NO DECIMAL POINT FROM -32,768 TO 32,767 THE INTEGER DATA VALUES LONG FROM-2,147,483,647 SPECIAL DATA TYPE OBJECT THT HOLDS CONTROLS AND FORMS. SINGLE NUMERIC VALUES FROM - 3.402823E+38 TO 3.402823E+38.
  • 14. THE DIM STATEMENTS LOCATION Dim that appears in an event procedure and can only be used within that event procedure called a Local variable.Dim in a module’s general section that can access all the variables within that module is called Global variable.
  • 15. The Dim statement is usually written in the following format: *Dim VarName As DataType *VarName is a variable name that you create .
  • 16. Prefix Data type example Bln Boolean blnlsOverTime Byt Byte bytAge Cur Currency curHourlyPay Dtm Date dteFirstBegan Dbl Double dblMicroMeasurement
  • 17. Int Integer ingCount Lng Long lngStarDistance Obj Object objSoundClip Sng Single sngYearSales Str String strLastName Vnt or var Variant vntControlValue
  • 18. Take note of the following code: curNetSales =curGrissSales - curCostOfSales intResult = (1 + 2 ) * 3
  • 19. Working with scientific notation Scientific notation is used to represent extremely large and small decimal numbers without including a lot of zeros or other digits.
  • 20. To convert a scientific notation value to its real value: 1.After the D or E ,raise 10 to the number.for example,the +6 in the number 1.2345E+6 raise 10 to the 6th power to get 1,000,000. 2.Multiply the number at the left of the D or E by the value in step 1.Multiply 1.2345 by the 1,000,000 to get a result of 1,234,500.
  • 21. Variables that hold data To hold data that can change based on calculations or the changes can be stated within the application,variables must be declared. The Dim statement lets you recognize that the variables holds the Currency data type and The curToTalSales is the variable’s name.
  • 22. Expressions and math operators Math operators allow calculation and assignment of expression results to variables when you code assignment statements that contain expressions.
  • 23. Visual basic primary math operators Operator Description + Adds two values Subtracts one - value from another value
  • 24. * Multiplies two values / Divides one value by another value Raises a value ^ to a power Concatenates & (or +) two strings
  • 25. Concatenation The concatenation operator joins one string to the end of another.
  • 26. Take note of the following code: strFullName = lblFirstName & “ “ & lblLastName