School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,145 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,808 people online right now. Registration is fast and FREE... Join Now!




Programming Reference Sheets: Visual Basic

2 Pages V  1 2 >  

Programming Reference Sheets: Visual Basic

skyhawk133

14 Aug, 2006 - 09:19 AM
Post #1

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,842



Thanked: 151 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
Alrighty you VB experts, I need your help putting together the ref sheet for Visual Basic.

It should cover the same type of things the C++ ref sheet covers, and we'll eventually do a more advanced one. Post everything here and we'll start to assemble this bad boy!

User is offlineProfile CardPM
+Quote Post


Jayman

RE: Programming Reference Sheets: Visual Basic

14 Aug, 2006 - 09:24 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 8,543



Thanked: 226 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Will this be a VB.NET ref sheet or VB6?
User is offlineProfile CardPM
+Quote Post

skyhawk133

RE: Programming Reference Sheets: Visual Basic

14 Aug, 2006 - 09:32 AM
Post #3

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,842



Thanked: 151 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
Let's go with VB6 as that is what is still taught in most schools I believe...
User is offlineProfile CardPM
+Quote Post

Louisda16th

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 07:12 AM
Post #4

dream.in.assembly.code
Group Icon

Joined: 3 Aug, 2006
Posts: 1,893



Thanked: 5 times
Dream Kudos: 755
My Contributions
Datatypes:
Boolean, Byte, Currency, Date, Double, Integer, Long, Single, String, Variant.

Control Structures:

1)
If (<condition>) Then
<statments>
else
<statements>
End If

2)
IIF(<condition>,<truestatements>,<falsestatements>)

Case Control:
Select Case(<expression>)
Case(<expression 1>)
<statements>
Case (<expression 2)
<statements>
.
.
.
Case(<expression n>)
<statements>
Case else
<statements>
End Select

This post has been edited by Louisda16th: 15 Aug, 2006 - 07:11 AM
User is offlineProfile CardPM
+Quote Post

Louisda16th

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 07:29 AM
Post #5

dream.in.assembly.code
Group Icon

Joined: 3 Aug, 2006
Posts: 1,893



Thanked: 5 times
Dream Kudos: 755
My Contributions
3) Loops

a)
For (<counter>) = <startvall> To <endval> Step <Increment/Decrement>
(<statements>)
Next (<counter>)

B )
Do While(<expression>)
<statements>
Loop

c)
Do
<statements>
Loop While(<expression>)

d)
Do Until(<expression>)
<statements>
Loop

e)
Do
<statements>
Loop Until(<expression>)

f)
While <expression>
<statements>
Wend


Operators:
Arithmetic:
+,-,*,/,Mod,^
Logical:
AND, NOT, OR XOR,IS,EQV,IMP,LIKE
&-(Concatenation)
Comparision:
=,<,>,<=,>=


Common Events
Activte
Click
Change
DblClick
KeyDown
KeyUp
KeyPress
GotFocus
LostFocus
MouseDown
MouseUp
MouseMove

This post has been edited by Louisda16th: 15 Aug, 2006 - 07:29 AM
User is offlineProfile CardPM
+Quote Post

skyhawk133

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 07:52 AM
Post #6

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,842



Thanked: 151 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
What color should the VB sheets be? I was thinking something kinda yellow/orange. no idea why though.
User is offlineProfile CardPM
+Quote Post

Amadeus

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 08:11 AM
Post #7

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 13,259



Thanked: 147 times
Dream Kudos: 25
My Contributions
Great start, Louisda16th!
User is offlineProfile CardPM
+Quote Post

Louisda16th

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 05:13 PM
Post #8

dream.in.assembly.code
Group Icon

Joined: 3 Aug, 2006
Posts: 1,893



Thanked: 5 times
Dream Kudos: 755
My Contributions
Thanx Amadeus (call me Ashwith). Heres smthin more:
Type declaration characters:
%-Integer
$-String
@-Currency
&-Long
#-Double
!-Single
Variable Declaration:
Dim/Static/Public <VarName> As <DataType>

Defining Constants:
Const <Name> = <Value> smile.gif

This post has been edited by Louisda16th: 16 Aug, 2006 - 05:14 AM
User is offlineProfile CardPM
+Quote Post

Louisda16th

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 05:23 PM
Post #9

dream.in.assembly.code
Group Icon

Joined: 3 Aug, 2006
Posts: 1,893



Thanked: 5 times
Dream Kudos: 755
My Contributions
Arrays:
Declaration(0 Based Indexing)
Dim <varname>(<MaxIndexVal>) As <DataType>

(User Defined Indexing)
Dim <Varname>(<MinIndexVal> To <MaxIndexVal>) As <DataType>

Dynamic Arrays
Dim <varname>() As <DataType>
Redim <varname>(MaxIndexVal>)

For Each Next Loop
This Shud be at the loops section. I 4got bout it:
For Each <element> In <Group>
<statements>
Next <element>

With Statement(Im not sure wat section this cms under)

With <objectname>
.<Property1> =<Value>
.<Property2> =<Value>
.
.
.<Propertyn> =<Value>
End With
User is offlineProfile CardPM
+Quote Post

skyhawk133

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 05:24 PM
Post #10

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,842



Thanked: 151 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
Alrighty, I think I can put all of that together, let me get all of the data put in the sheet and I'll post it tomorrow. Thanks a ton!!
User is offlineProfile CardPM
+Quote Post

Louisda16th

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 05:34 PM
Post #11

dream.in.assembly.code
Group Icon

Joined: 3 Aug, 2006
Posts: 1,893



Thanked: 5 times
Dream Kudos: 755
My Contributions
Well Im not sure if these can be included as part of a reference sheet but i put em cause they are (dats wat i think) used very often
Common Controls
Label, Textbox, CommandButton, PictureBox, Frame, CheckBox, ScrollBars, Timer, DriveListBox, DirectoryListBox, FileListBox,Shape,Line,Data control,Image,OLE,ADODC

Some Library Functions

String:
LCase, UCase, Len, Trim, LTrim, RTrim, Left, Right, Mid, InStr, Space, String, Str, Asc, Chr, StrReverse

Numeric:
Int, Fix, CInt, Sgn, Val, Rnd, Randomize, Format, Round

Date & Time:
Now, Date, Date$, Time, Time$, DatePart, Day, Month, Year, Hour, Minute, Second, Timer, DateAdd, DateDiff.

Math:
Abs, Atn, Cos, Exp, Log, Sin, Sqr, Tan

Miscellaneous:
Is..., VarType, InputBox, MsgBox
User is offlineProfile CardPM
+Quote Post

Louisda16th

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 05:41 PM
Post #12

dream.in.assembly.code
Group Icon

Joined: 3 Aug, 2006
Posts: 1,893



Thanked: 5 times
Dream Kudos: 755
My Contributions
Procedures:

[Private/Public] Sub <name> (<ArgumentList>)
<statements>
End Sub
Calling:
[Call] <name>

Functions:

[Private/Public] <Name>(<ArgumentList>) [As <Type>]

Modules:
Form Module
Standard Module
Class Module
User is offlineProfile CardPM
+Quote Post

Louisda16th

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 05:48 PM
Post #13

dream.in.assembly.code
Group Icon

Joined: 3 Aug, 2006
Posts: 1,893



Thanked: 5 times
Dream Kudos: 755
My Contributions
Error Handling

On Error Statement:

On Error Goto <LineNumber>
On Error Goto <Label>
On Error Resume Next

Err Object:
Properties:
Number
Source
Description

Methods:
Clear
Raise

Error Object:
Properties:
Description
Number
Source
SQLState
NativeError

Leaving Error Handlers:
Resume
Resume Next
Exit Sub/Function/Property
End Sub/Function/Property
Err.Raise

(dat kinda wraps up all I know. theres also Database systems which i had to learn in school but it wont fit in) smile.gif

This post has been edited by Louisda16th: 15 Aug, 2006 - 05:52 PM
User is offlineProfile CardPM
+Quote Post

skyhawk133

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 05:53 PM
Post #14

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,842



Thanked: 151 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
We'll be doing an advanced one once I get all the basic ones done... we can fit the more advanced stuff in those smile.gif Thanks again for all the hard work!
User is offlineProfile CardPM
+Quote Post

Louisda16th

RE: Programming Reference Sheets: Visual Basic

15 Aug, 2006 - 07:05 PM
Post #15

dream.in.assembly.code
Group Icon

Joined: 3 Aug, 2006
Posts: 1,893



Thanked: 5 times
Dream Kudos: 755
My Contributions
QUOTE(skyhawk133 @ 15 Aug, 2006 - 09:22 PM) *

What color should the VB sheets be? I was thinking something kinda yellow/orange. no idea why though.

About da colours, i guess its fine if its light. orange looks gud i guess.
User is offlineProfile CardPM
+Quote Post

born2c0de

RE: Programming Reference Sheets: Visual Basic

17 Aug, 2006 - 04:09 AM
Post #16

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,542



Thanked: 98 times
Dream Kudos: 2825
Expert In: J2ME, 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
I know I'm posting this kinda late...Just hope Chris reads this in time

File Handling:

Open "<filename>" for <mode> as <#handler>

where mode is:
INPUT : For Reading Files
OUTPUT : For Writing/Overwriting a File
APPEND : For Adding Data to a File


and handler is a positive integer. Eg. 1,2,100...etc..

For reading fields from one line of data from a file into variables
INPUT <#handler>, <variable list>

For reading the entire line in the file into a single string
LINE INPUT <#handler>,<string_variable>

For Writing Data enclosed in quotes:
WRITE #1, <variable/constant/expression>

For Writing Data without quotes:
PRINT #1, <variable/constant/expression>

To Close the Data File:
CLOSE <#handler>

Common Functions used:
EOF(<#handler>) : returns 1 if End of File is encountered else returns 0.

LOF(<#handler>) : returns the size of the file in bytes


P.S : I haven't mentioned Binary and Random File Modes (along with R/W Access permissions) because I felt it would fit better in the Advanced VB Reference Sheet.
User is offlineProfile CardPM
+Quote Post

skyhawk133

RE: Programming Reference Sheets: Visual Basic

18 Aug, 2006 - 03:40 PM
Post #17

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,842



Thanked: 151 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
Born2Code, can you take what you posted, and the things in this thread and combine them in to a document that's 115 lines in length... Just take the important/most used things a beginner to VB would use.

Once you've posted the .txt I'll put it in the pdf. Thanks!!!
User is offlineProfile CardPM
+Quote Post

Louisda16th

RE: Programming Reference Sheets: Visual Basic

18 Aug, 2006 - 07:00 PM
Post #18

dream.in.assembly.code
Group Icon

Joined: 3 Aug, 2006
Posts: 1,893



Thanked: 5 times
Dream Kudos: 755
My Contributions
Heres my version:

This post has been edited by Louisda16th: 18 Aug, 2006 - 07:11 PM
User is offlineProfile CardPM
+Quote Post

born2c0de

RE: Programming Reference Sheets: Visual Basic

19 Aug, 2006 - 07:34 AM
Post #19

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,542



Thanked: 98 times
Dream Kudos: 2825
Expert In: J2ME, 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
QUOTE(skyhawk133 @ 19 Aug, 2006 - 05:10 AM) *

Born2Code, can you take what you posted, and the things in this thread and combine them in to a document that's 115 lines in length... Just take the important/most used things a beginner to VB would use.

Once you've posted the .txt I'll put it in the pdf. Thanks!!!

I'll just do that now.
User is offlineProfile CardPM
+Quote Post

born2c0de

RE: Programming Reference Sheets: Visual Basic

19 Aug, 2006 - 08:34 AM
Post #20

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,542



Thanked: 98 times
Dream Kudos: 2825
Expert In: J2ME, 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
Ok, I've attached the Text File.
I've taken stuff from Louisda16th's Version,Corrected all the errors(lucky I noticed them) and added some content as well.

The Content looks perfect for a beginner.

Looking forward for the next Reference Sheets.


Attached File(s)
Attached File  vbref_compiled.txt ( 2.23k ) Number of downloads: 54
User is offlineProfile CardPM
+Quote Post

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 04:49AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month