Beruflich Dokumente
Kultur Dokumente
134
135
Use of Variables :
a. Left Side :That the variable is the location where the value will
be stored .
b. Right Side :That the variable here is the value that will be stored
or part of it .
- ( Me ) : Of the used words in VisualBasic.Net and it indicates to
the current Form window .
- ( & ) : it is used in Visual Basic.Net to link the text values to make
one text value .
- ( VbCrlf ) : of used words in VisualBasic.Net and is used in the
code window to create a new line .
- ( Under Score ) ( _ ) : it is typed at the end of the code line to
complete the code line in the next line .
- ( Rem ) or (' ) : it is typed at the start of the line in the code
window to make the code as a comment so the compiler doesn't
execute it during the program runtime.
Constants :
- They are locations in the computer memory ( RAM ) that have
data type and their values cannot change during the program
runtime .
- The constant should take a value when declaring it .
Formula for declaring Constants :
- Const Constant Name As Data type = Value
Range of Variables and Constants :
- It means the allowed range for using a variable or constant .
- Visual Basic .Net do not allow using any variable or constant out
the range of declaration .
136
Errors :
1- Syntax Errors :
- They occur when typing words with typing errors in the code
window .
Example :
- Dem H As Integer.
2- Logical Errors :
- They are the errors which result in False results when using the
program as typing an equation or assignment incorrectly .
To avoid those errors we should :
a. Check the codes in Code Window well .
b. Check the validity of the program through inputs with predefined
outputs .
3- Runtime Errors :
- They are the errors which occur as a result of the user input
incorrect values during the program runtime .
( The programmer will not be responsible directly for this error )
How to avoid the ( Runtime Errors ) :
a. By using ( Try . Catch )
- It finds the runtime errors and enables the programmer to answer
the error with a clear message .
Form of ( Try . Catch ) statement :
Try
The codes that may have errors
Catch
The codes that should be executed in case of error .
End Try
137
138
Identification
Equal
Not equal
Greater than
Less than
Greater than or equal to
Less than or equal to
139
Code
End If
Using (IsNumeric) :
- It is a predefined function in VisualBasic.Net and it is used to
identify the content of Textbox or the content of the variable and
whether it is a number or a character.
a- when the functions value is numeric : True
b- When the functions value is non - numeric : False .
The Form
IsNumeric( Parameter )
1- Variable .
2- Property .
( Focus ) Method :
- Indicates to the attention or concentration so the typing pointer
appears in this tool .
The Logical Operators :
The Logical Operator ( And ) :
- It is used for combining two conditions , the result will be
( True ) , when the two conditions are ( True ) .
( True And True True )
The Logical Operator ( Or ) :
- It is used for combining two conditions and the final result will be
( True ) if the value of one condition is ( True ) or both of them.
True Or True True
True Or False True
140
141
142
143
Now
144
145
146