Documents

visualbasic lecture5.pdf

Description
Copyright © 2011 Pearson Addison-Wesley Declaring Variables ã A variable declaration is a statement that creates a variable in memory ã The syntax is: Dim VariableName As DataType – Dim (short for Dimension) is a keyword – VariableName is the programmer designated name – As is a keyword – DataType is one of many possible keywords for the type of value the variable will contain ã ere is an example of a variable declaration: Dim intLength as Integer !hapter # $lide % Copyright © 2011 Pears
Categories
Published
of 19
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
  Copyright © 2011 Pearson Addison-Wesley Declaring Variables ã A variable declaration is a statement that creates a variable in memory ã The syntax is: Dim VariableName As DataType  –   Dim  (short for Dimension) is a keyword  –   VariableName  is the programmer designated name  –   As  is a keyword  –   DataType  is one of many possible keywords for the type of value the variable will contain !hapter # $lide %  Copyright © 2011 Pearson Addison-Wesley Declaring &ultiple Variables ã $everal variables may be declared in one statement if they all hold the same type of value Dim intLength, intWidth, intHeight as Integer ã 'r this can be done in separate statements Dim intLength as IntegerDim intWidth as Inteer !hapter # $lide   Copyright © 2011 Pearson Addison-Wesley Variable aming *ules ã The first character of a variable name must be a letter or an underscore ã $ubse+uent characters may be a letter, underscore, or digit  – Thus variable names cannot contain spaces or periods (or many other kinds of characters) ã Visual -asic keywords cannot be used as variable names !hapter # $lide   Copyright © 2011 Pearson Addison-Wesley Variable aming !onventions ã  aming conventions are a guideline to help improve readability but not re+uired syntax ã A variable name should describe its use ã .ach data type has a recommended prefix, in lower case, that begins the variable name ã The %st letter of each subse+uent word in the variable name should be capitali/ed  – intours0orked # an integer variable  – str1astame # a string (or text) variable !hapter # $lide 2
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x