You are on page 1of 35

1

PDF created with pdfFactory Pro trial version www.pdffactory.com


...

. v.b .





BASIC

Beginners All-purpose Symbolic Instruction Code



..

PDF created with pdfFactory Pro trial version www.pdffactory.com


Dartmouth 1963
..

:
26:
1983/8/5 :
07707797637 :

PDF created with pdfFactory Pro trial version www.pdffactory.com

PDF created with pdfFactory Pro trial version www.pdffactory.com


NEXT

NEXT

NEXT

PDF created with pdfFactory Pro trial version www.pdffactory.com

NEXT

CONTINUE

OK

PDF created with pdfFactory Pro trial version www.pdffactory.com


CONTINUE

PDF created with pdfFactory Pro trial version www.pdffactory.com

Start :
Start > Programmes > Microsoft Visual Studio 6.0 > Microsoft
Visual Basic 6.0

PDF created with pdfFactory Pro trial version www.pdffactory.com

:
...


:


Form1 ...
Twip 120

...
:View Code ...
.
:Menu Editor ...
.
:Lock Controls
... ...
:Paste .
:Properties .

:
9

PDF created with pdfFactory Pro trial version www.pdffactory.com

Microsoft Visual Basic 6.0


PictureBox
Timer TextBox Label
..


Components :

Apply OK
ActiveX DLL Browse ..

10

PDF created with pdfFactory Pro trial version www.pdffactory.com

...
Directory Forms

Directory Module ... Class Module
Form ...Form1


:



:

11

PDF created with pdfFactory Pro trial version www.pdffactory.com

...
... Caption Form1 ...

Name
Categorized
... Alphabetic


... Name
..


: Pointer

.
PictureBox :
... .
Label : ...
...
Text Box :

Frame : Frame
.
Command Button :
.

12

PDF created with pdfFactory Pro trial version www.pdffactory.com

Options .
Option Button : ...
.
Compo box :

ListBox : List
.
HScrolBar : ...
.
VScrollBar :
.
Timer :
.
DriveListBox : ListBox
.
dirListBox : ListBox
Folders .
FileListbox : Listbox
Files .
Shape : .
Line : .
Image :
. Picturebox
data:
.

13

PDF created with pdfFactory Pro trial version www.pdffactory.com

.

..

13 :
:File
..Exe

:Edit
..
:View
...
:Project
Module ClassModule ..
:Format

LockControls

...
:Debug

StepInto StepOver StepOut

RunToCursor BreakPoints


...
14

PDF created with pdfFactory Pro trial version www.pdffactory.com

..
:Query ..SQL
:Diagram SQL ..ORACLE

:Tools
AddProcedur

ProcedureAtributes
ID ..
:Add-Insert
..
:Window
..
:Help
MSDN
..

15

PDF created with pdfFactory Pro trial version www.pdffactory.com



True



...


= False
...

False
...
















...

Name
Appearance
AutoRedraw
BackColor
BorderStyle
Caption
ControlBox
Enabled
Font
ForeColor
Height
Left
MaxButton
MinButton
MouseIcon
MousePointer
Movable
Picture
RightToLeft
ShowInTaskBar
StartUpPositio

16

PDF created with pdfFactory Pro trial version www.pdffactory.com

Top
Visible
Width
Window State

:
Object.Property = Style
Object Property
Style ..

<
17

PDF created with pdfFactory Pro trial version www.pdffactory.com

>

><

=<

=>

Mod

Cos Tan
..


For.. Next

18

PDF created with pdfFactory Pro trial version www.pdffactory.com

For X = 1 To 10 Step 2
Print X
Next X
End Sub

1
..9 7 5 3 1 :
:
X 1 10
For X = 1 To 10 Step 2 Print X
Next X ..

If Then

If


...
:
(1
(2
(3
(4
(5

:IF
.
:Then If
) (If .
:Else If
.
:ElseIf If
If End If ElseIf
.
:End If
.


..
19

PDF created with pdfFactory Pro trial version www.pdffactory.com

If Text1.Text = Ehab Then


Image1.Visible = True
ElseIf Text1.Text = Bibo Then
Image1.Visible = True
Else
Image2.Visible = True
End If
End Sub

:
Password

If Text1.Text = Ehab Ehab
Image1.Visible = True Then
Bibo
ElseIf Ehab Bibo
.Else
.
:IFF
If..Else:
Private Sub Command1_Click
X = Text1.Text
)"MsgBox IIf(X = 7, "X=7", "X<>7
End Sub
7 = 1
..

20

PDF created with pdfFactory Pro trial version www.pdffactory.com

:
)(Private Sub Command1_Click
End Sub

:
Private
...

.Private
Sub Sub End Sub
... .
Command1
Command1
.
Click Click
End Sub )(

v.b

:
)(Private Sub Command1_Click
End
21

PDF created with pdfFactory Pro trial version www.pdffactory.com

...


) (End
) ( Unload Me

.

End

Unload Me

22

PDF created with pdfFactory Pro trial version www.pdffactory.com

End

Unload Me

Label1 Label2 Interval 1000


..
:


:
)(Private Sub Timer1_Timer
Label1.Caption = Time
Label2.Caption = Date

System Label1 Label2
...

:
)Label1.Caption = DateAdd(Interval, Number, Date
23

PDF created with pdfFactory Pro trial version www.pdffactory.com

Number Date
.. ..
:
)Date1 = DateAdd(M, 3, Date

:
)"Label1.Caption = DateDiff(Interval, "Date1", "Date2
Date1 Date2 Interval
M D
:
Label1.Caption = DateDiff("m", "14/7/1989", "26/4/2003") \ 12

Interval 1000
..
:
)Label1.Caption = Format (Date, YYYY
:
)Label2.Caption = Format (Date, MMMM
:
)Label3.Caption = Format (Date, MM
:
)Label4.Caption = Format (Date, DDDD
:
)Label5.Caption = Format (Date, DD
5 ...

24

PDF created with pdfFactory Pro trial version www.pdffactory.com


..
Calendar = vbCalHijri
:

Calendar = vbCalGreg

:Len :
Dim Stl As Integer
)Stl = Len(String1

25

PDF created with pdfFactory Pro trial version www.pdffactory.com

:
)Result = Trim(String1

:LTRim . :
)Result = LTrim(String1

:RTrim . :
)Result = Rtrim(String1

:Mid
:
)Result = Mid (String1, 2, 1

)( :chr AscII :
)Result = Chr(13

)( :ASC ASCII
:
Dim AscCode
)AscCode = Asc(E

)( :Str .
:
)Result = Str(5
26

PDF created with pdfFactory Pro trial version www.pdffactory.com

)( :Val
:
Dim Number
)Number = Val(String1


: Mathematics Functions
: Abs

) (13- ) (13
..
)Number=Abs(-45.6
Text1.Text = Number
Number=45.6

Null Null

..

: Sqr
.
)Number=Sqr(25
Text1.Text = Number
.. Number=5

:Log
:
)Number=Log (20
27

PDF created with pdfFactory Pro trial version www.pdffactory.com

..MyNumber=2.9957327
:Int


:
)Number=Int (332.54
Text1.Text = Number
MyNumber=332

:Atn ""

:
)( MyNumber=Atn
Text1.Text = MyNumber

:Tan
:
)( MyNumber=Tan
Text1.Text = My Number

:Cos
:
)( MyNumber=Cos
Text1.Text = MyNumber

28

PDF created with pdfFactory Pro trial version www.pdffactory.com

:Sin
:
Number=Sin ()
Text1.Text = Number

29

PDF created with pdfFactory Pro trial version www.pdffactory.com


Form

*
* Text

Command )(6

)(3

Caption

Form2


Command -1

Caption

30

PDF created with pdfFactory Pro trial version www.pdffactory.com

Label

.
Private Sub Command6_Click()

Form2. show

31

PDF created with pdfFactory Pro trial version www.pdffactory.com


Private Sub Command1_Click()
Text3. text = val (text1. text) + val (text2. text)

Private Sub Command2_Click()

Text3. text = val (text1. text) - val (text2. text)


Private Sub Command3_Click()

Text3. text = val (text1. text) * val (text2. text)

Private Sub Command4_Click

Text3. text = val (text1. text)/ val (text2. text)


Private Sub Command5_Click
dim x as String
dim y as String
x = text1.text
y = sqr (x)
text2.text =y
End Sub

32

PDF created with pdfFactory Pro trial version www.pdffactory.com

if

*^*

Text )(2


Text ) (18
) Text2( .

33

PDF created with pdfFactory Pro trial version www.pdffactory.com

Private Sub Text1_Change()


If Text1.Text >= 18 Then
Text2.Text = ""
Else
Text2.Text = ""
End If
End Sub

34

PDF created with pdfFactory Pro trial version www.pdffactory.com

35

PDF created with pdfFactory Pro trial version www.pdffactory.com

You might also like