Welcome

Please register to have access to more features!

It is highly recommended that you have Javascript enabled; many features will not work unless you do. The recommended browsers are Firefox and Chrome; the board is also NOT mobile-friendly.

Please invite your friends!

If you were referred by someone (ex. me, Jessica) please put their username in the referral box on the registration page. Ask them if you don't know their username.

If you are visiting for TESTING PURPOSES ONLY, this is the test account information:


Username:
Test
Password: test123



Select a forum to post in:

Visual Basic

Helpful topics on HTML, C++

Moderators: Jessica, Teachers

Visual Basic

Post Number: #1  Postby Jessica » January 24th, 2013, 10:33 pm

Before you can begin programming, you must understand the concept of variables. Variables are the storage media within programs. For example if you wanted the program to know the user's name, then you might declare a variable called strName, ask the user for their name, and then store the result into the strName variable.



Declaring a variable

Before you can use a variable, you have to declare the variable. In Visual Basic you use the Dim statement to declare variables. Some common variable types are Integer, and String. This is how you use the Dim statement.

    Dim [variable name] As [variable type]

Examples:

    Dim strName As String

    Dim intCounter As Integer
  • 0

User avatar
Jessica
Board Owner
Topic Author

Founder
Sapphire
Sapphire
 
8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership
 
Posts: 3,469
Topics: 1,244
Articles: 30
Joined: December 22nd, 2010, 8:04 pm
Local time: October 22nd, 2019, 11:08 am
Last Visit: Yesterday, 10:22 pm
Location: Pennsylvania
Gender: Female
Cash on hand: 4,767.32
Bank: 138,647.08
Reputation: 148
Medals: 20
#1: July 2012 1st Place (1) R-Contest #1 First Place (1) Best staff member 2013 (1) Easter Egg Hunt 2013 (1) Graphic Drawing Participant (1) 1 Year (1) 2 Years (1) 3 Years (1) 4 Years (1) 5 Years (1)
6 Years (1) 7 Years (1) 8 Years (1) Founder (1) Highest Rep (1) Referrer (1) Top poster (1) Facebook group (1) Pin-Board (1) Article Author (1)
Referrals: 27
Blog: View Blog (478)
Subject(s): Chinese, Math
Global Moderator
Admin
Moderator

Re: Visual Basic

Post Number: #2  Postby Jessica » January 29th, 2013, 9:32 pm

An event procedure is invoked when something happens to a specified object. Some events are object.Click (object is clicked), object.TextChanged (a change occurred in the value of the object's Text property), object.Leave (object loses the focus), and object.Enter (object receives the focus).
  • 0

User avatar
Jessica
Board Owner
Topic Author

Founder
Sapphire
Sapphire
 
8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership
 
Posts: 3,469
Topics: 1,244
Articles: 30
Joined: December 22nd, 2010, 8:04 pm
Local time: October 22nd, 2019, 11:08 am
Last Visit: Yesterday, 10:22 pm
Location: Pennsylvania
Gender: Female
Cash on hand: 4,767.32
Bank: 138,647.08
Reputation: 148
Medals: 20
#1: July 2012 1st Place (1) R-Contest #1 First Place (1) Best staff member 2013 (1) Easter Egg Hunt 2013 (1) Graphic Drawing Participant (1) 1 Year (1) 2 Years (1) 3 Years (1) 4 Years (1) 5 Years (1)
6 Years (1) 7 Years (1) 8 Years (1) Founder (1) Highest Rep (1) Referrer (1) Top poster (1) Facebook group (1) Pin-Board (1) Article Author (1)
Referrals: 27
Blog: View Blog (478)
Subject(s): Chinese, Math
Global Moderator
Admin
Moderator

Re: Visual Basic

Post Number: #3  Postby Jessica » January 29th, 2013, 9:44 pm

Standard Naming Conventions



These are the prefixes for the data types used in Visual Basic.
Data Type Prefix Example
Boolean bln blnFound
Currency cur curTotal
Date (time) dat datStart
Double dbl dblTolerance
Error err errNumber
Integer int intQuantity
Long lng lngDistance
Object obj objCurrent
Single sng sngAverage
String str strFullName
User-Defined type udt udtEmployee
Variant vnt vntCheckSum
  • 0

User avatar
Jessica
Board Owner
Topic Author

Founder
Sapphire
Sapphire
 
8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership
 
Posts: 3,469
Topics: 1,244
Articles: 30
Joined: December 22nd, 2010, 8:04 pm
Local time: October 22nd, 2019, 11:08 am
Last Visit: Yesterday, 10:22 pm
Location: Pennsylvania
Gender: Female
Cash on hand: 4,767.32
Bank: 138,647.08
Reputation: 148
Medals: 20
#1: July 2012 1st Place (1) R-Contest #1 First Place (1) Best staff member 2013 (1) Easter Egg Hunt 2013 (1) Graphic Drawing Participant (1) 1 Year (1) 2 Years (1) 3 Years (1) 4 Years (1) 5 Years (1)
6 Years (1) 7 Years (1) 8 Years (1) Founder (1) Highest Rep (1) Referrer (1) Top poster (1) Facebook group (1) Pin-Board (1) Article Author (1)
Referrals: 27
Blog: View Blog (478)
Subject(s): Chinese, Math
Global Moderator
Admin
Moderator

Re: Visual Basic

Post Number: #4  Postby Jessica » January 29th, 2013, 9:45 pm

Common Data Types Defined


These are the most commonly used data types.

Integer: the most commonly used data type. It can only store whole number integers within the range -32,768 to 32,767.

Long: same as Integer, but with a range of -2,147,483,648 to 2,147,483,647. For most practical uses Integer will do just fine, and there is no need for using Long, however there are some cases when the range of Integer just won't cut it.

String: the second most commonly used data type. It stores a "String" of characters. In Visual Basic, a string is contained within quotes "".

Single: represents a floating point number, or in other words a number with a decimal. It has a range of -3.402823e38 to -1.401298e-45 for negative numbers, and 1.401298e-45 to 3.402823e38 for positive numbers.

Double: same as Single except with a range of -1.79769313486232e308 to -4.94065645841247e-324 for negative numbers, and a range of 4.94065645841274e-324 to 1.79769313486232e308 for positive numbers. Double like Long is just a bigger variable type, in most instances there is no need for the precision that the double types can support, but in some cases it may be necessary.

Boolean: represents either True or False
  • 0

User avatar
Jessica
Board Owner
Topic Author

Founder
Sapphire
Sapphire
 
8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership
 
Posts: 3,469
Topics: 1,244
Articles: 30
Joined: December 22nd, 2010, 8:04 pm
Local time: October 22nd, 2019, 11:08 am
Last Visit: Yesterday, 10:22 pm
Location: Pennsylvania
Gender: Female
Cash on hand: 4,767.32
Bank: 138,647.08
Reputation: 148
Medals: 20
#1: July 2012 1st Place (1) R-Contest #1 First Place (1) Best staff member 2013 (1) Easter Egg Hunt 2013 (1) Graphic Drawing Participant (1) 1 Year (1) 2 Years (1) 3 Years (1) 4 Years (1) 5 Years (1)
6 Years (1) 7 Years (1) 8 Years (1) Founder (1) Highest Rep (1) Referrer (1) Top poster (1) Facebook group (1) Pin-Board (1) Article Author (1)
Referrals: 27
Blog: View Blog (478)
Subject(s): Chinese, Math
Global Moderator
Admin
Moderator


Return to ICT Topics

Login  •  Register
cron
Reputation System ©'