You are on page 1of 6

What is Visual Basic?

It's a computer programming system developed and owned by Microsoft. Visual Basic was originally
created to make it easier to write programs for the Windows computer operating system. The basis of
Visual Basic is an earlier programming language called BASIC that was invented by Dartmouth College
professors John Kemeny and Thomas Kurtz. Visual Basic is often referred to using just the initials, VB.
Visual Basic is easily the most widely used computer programming system in the history of software.

Data Types
All programs are composed of two items: Data and Operations on that
Data. Because, at their heart, computers are simple devices, they can only
represent very simple pieces of information. All complex information
must be built up from these basic Data Types. The data types can roughly
be described as: numbers, booleans, characters, arrays, and structures.
Some languages like ActionScript replace characters with "strings".
Object oriented languages, such as C++ and Java replace "structures" with
"objects".
Data Types
All programs involve storing and manipulating data.
Luckily (???) the computer only knows about a few types of data. These include,
numbers, true/false values, characters (a,b,c,1,2,3,etc), lists of data, and complex
"Structures" of data, which build up new data types by combining the other data
types.
Here is a brief summary of the available data types:
C, Matlab
ActionScript
Numbers, (e.g., 7, 3.14).
Booleans (true or false)
Characters ('a', 'b', ... 'z', '1', '2', ... '9', '!', '^', etc)
Arrays (a list of data (all of the Same Data Type!))
Structures (a collection of named data referring to a single entity)
All computer programs, from brain scanners to video games to music players, use
these same basic data types to represent all possible information.
It should be noted that computer programs often approximate information, that is
they represent information inaccuratelyor perhaps it would be better to
say imprecisely. An example of this is the value of pi. For most of us, pi is roughly
3.1415 and this value works just fine. For engineers pi is 3.14159265358979323846.
For mathematicians and scientists, pi might be
3.1415926535897932384626433832795029. Thus it can be said that a computer deals
in abstractions and approximations.
Below are some more examples and specifics for the various data types.
Numbers

students_listening = 112; % an "
integer" (whole) number

average_number_of_students_in_class = 89.5; % a "d
ouble" (a real) number


More on Numbers
Booleans (true or false)
utah_won_the_game = true;
More information on Booleans
Warning: The two Booleans values are trueand false, (not the strings 'true' and 'false'
but keywords true and false. Further, while some languages allow you to use 1 and 0 for true and
false, every time you write a program and need to assign the value's true or false, you should use the
keywords trueand false, not the shortcut 1,0.
Characters ('a', 'b', ... 'z', '1', '2', ... '9', '!', '^', etc)
middle_initial = 'j';
More info on Characters
Arrays (a lists of data (of the SAME TYPE!))
student_grades = [97, 78, 88, 93, 89];

More Info on Array
You can find more info on arrays under the chapter explicitly dealing with
arrays.
Structures are a way to create more complex "Data Types" than the basics.
They basically allow you to "build up" bigger and more interesting collections
of data by naming sub-parts of information.
Below, we create a "student structure" containing, an integer part (the age), a
string part (the name), and a boolean part (the fact that tuition has been paid or
not).

student.name = 'jim'; % array of characters, or st
ring, part
student.age = 27; % an integer part
student.paid_tuition = false; % a boolean part


byte: The byte data type is an 8-bit signed two's complement integer. It has a
minimum value of -128 and a maximum value of 127 (inclusive). The bytedata
type can be useful for saving memory in large arrays, where the memory
savings actually matters. They can also be used in place of int where their
limits help to clarify your code; the fact that a variable's range is limited can
serve as a form of documentation.
short: The short data type is a 16-bit signed two's complement integer. It has a
minimum value of -32,768 and a maximum value of 32,767 (inclusive). As
with byte, the same guidelines apply: you can use a short to save memory in
large arrays, in situations where the memory savings actually matters.
int: By default, the int data type is a 32-bit signed two's complement integer,
which has a minimum value of -2
31
and a maximum value of 2
31
-1. In Java SE
8 and later, you can use the int data type to represent an unsigned 32-bit
integer, which has a minimum value of 0 and a maximum value of 2
32
-1. Use
the Integer class to use int data type as an unsigned integer. See the section
The Number Classes for more information. Static methods
likecompareUnsigned, divideUnsigned etc have been added to the Integer class
to support the arithmetic operations for unsigned integers.
long: The long data type is a 64-bit two's complement integer. The signed long
has a minimum value of -2
63
and a maximum value of 2
63
-1. In Java SE 8 and
later, you can use the long data type to represent an unsigned 64-bit long, which
has a minimum value of 0 and a maximum value of 2
64
-1. The unsigned long
has a minimum value of 0 and maximum value of 2
64
-1. Use this data type
when you need a range of values wider than those provided byint.
The Long class also contains methods like compareUnsigned, divideUnsigned etc
to support arithmetic operations for unsigned long.
float: The float data type is a single-precision 32-bit IEEE 754 floating point.
Its range of values is beyond the scope of this discussion, but is specified in
the Floating-Point Types, Formats, and Values section of the Java Language
Specification. As with the recommendations for byte and short, use
afloat (instead of double) if you need to save memory in large arrays of
floating point numbers. This data type should never be used for precise values,
such as currency. For that, you will need to use the java.math.BigDecimal class
instead. Numbers and Strings covers BigDecimal and other useful classes
provided by the Java platform.
double: The double data type is a double-precision 64-bit IEEE 754 floating
point. Its range of values is beyond the scope of this discussion, but is specified
in the Floating-Point Types, Formats, and Values section of the Java Language
Specification. For decimal values, this data type is generally the default choice.
As mentioned above, this data type should never be used for precise values,
such as currency.
boolean: The boolean data type has only two possible values: true and false.
Use this data type for simple flags that track true/false conditions. This data
type represents one bit of information, but its "size" isn't something that's
precisely defined.
char: The char data type is a single 16-bit Unicode character. It has a minimum
value of '\u0000' (or 0) and a maximum value of '\uffff' (or 65,535
inclusive).
In addition to the eight primitive data types listed above, the Java programming
language also provides special support for character strings via
the java.lang.Stringclass. Enclosing your character string within double quotes will
automatically create a new String object; for example, String s = "this is a
string";.String objects are immutable, which means that once created, their values
cannot be changed. The String class is not technically a primitive data type, but
considering the special support given to it by the language, you'll probably tend to
think of it as such. You'll learn more about the String class in Simple Data Objects
Default Values
It's not always necessary to assign a value when a field is declared. Fields that are
declared but not initialized will be set to a reasonable default by the compiler.
Generally speaking, this default will be zero or null, depending on the data type.
Relying on such default values, however, is generally considered bad programming
style.
The following chart summarizes the default values for the above data types.
Data Type Default Value (for fields)
byte 0
short 0
int 0
long 0L
float 0.0f
double 0.0d
char '\u0000'
String (or any object) null
boolean false


Local variables are slightly different; the compiler never assigns a default value to an
uninitialized local variable. If you cannot initialize your local variable where it is
declared, make sure to assign it a value before you attempt to use it. Accessing an
uninitialized local variable will result in a com
Command Syntax
The administration commands use UNIX style command syntax and notation according to the
following conventions:

-<letter> - Specifies a command operation or option, for example, "-o" or "-a". Letters are both
lowercase and uppercase.

< >- Required argument. Replace appropriately. For example,
"-u <DB_User_name>" could become "-u av".

| - Mutually exclusive arguments. Pick one from the list.

{ } - Used with " | " to specify a list of choices for an argument.

[ ] - Optional parameter.

Each command has "operations" and "options". An operation does a specific task related to the
command and is specified with "o <task>". For example, some of the sdetable command
operations are:

sdetable -o create
sdetable -o delete
sdetable -o truncate
sdetable -o list
sdetable -o describe
sdetable -o create_index
sdetable -o delete_index

You might also like