Erdal abi;
Ana programının başında kullandığın/kullanacağın tüm programları ve fonksiyonları
Visual Fox Pro
1
| SET PROCEDURE TO ErdalTools.prg ADDITIVE |
biçiminde tanımlasan daha kolay olmaz mı?
Birde bahsettiğin program/fonksiyonları eğer sadece bir form içinde kullanıyorsan ( yada class ) Add Property / Add Class / Add Object komutları ile formuna yada objene kolayca ekleyebilirsin. Kullandığın nesne hafızada olduğu sürece de o program parçacığını ( object yada method ) kontrol etmene gerek kalmaz.
Aşağıdaki örnekteki
Visual Fox Pro
1
2
| Add Object grdFriends As Grid With ;
recordsource='Friends',Height=250,Width=800,RowHeight=30,ColumnCount=3 |
satırı belki sana fikir verebilir:
Visual Fox Pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
| *!* Author : Çetin Başöz
Public oForm
oForm = Createobject('mytest')
oForm.Show
Define Class myTest As Form
DataSession = 2
Height = 300
Width = 830
KeyPreview = .T.
Add Object grdFriends As Grid With ;
recordsource='Friends',Height=250,Width=800,RowHeight=30,ColumnCount=3
Procedure Load
Create Cursor Friends (Name C(40), Address C(30), State I)
Create Cursor States (FullName C(20), Abbrev I)
Insert Into States Values ('Alaska ', 2)
Insert Into States Values ('Colorado', 4)
Insert Into States Values ('Florida ', 6)
Insert Into States Values ('Idaho ', 1)
Insert Into States Values ('Maine ', 3)
Insert Into States Values ('Ohio ', 5)
Insert Into States Values ('Texas ', 7)
Index On Abbrev Tag Abbrev
Rand(-1)
For ix = 1 To 5
Insert Into Friends Values ('Friend'+Padl(m.ix,2), '', Int(Rand()*6)+1)
Endfor
Select Friends
Locate
Endproc
Procedure Init
With This.grdFriends
With .Columns(1)
.ControlSource = 'Friends.Name'
.Width = 152
Endwith
With .Columns(2)
.ControlSource = 'Friends.Address'
.Width = 166
Endwith
With .Columns(3)
.ControlSource = ;
"(IIF(SEEK(Friends.State,'States','Abbrev'),states.fullname,''))"
.Bound = .F.
.AddObject('combo1','combobox')
With .Combo1
.BoundColumn = 2
.BoundTo = .T.
.ColumnCount = 1
.ControlSource = 'Friends.State'
.RowSourceType = 6
.RowSource = 'States.Fullname,Abbrev'
.Style = 2
.Visible = .T.
Endwith
.Width = 93
.CurrentControl = 'combo1'
Endwith
Endwith
Endproc
Procedure KeyPress
Lparameters nKey,nShift
If m.nKey = -4 && F5
Nodefault
Insert Into Friends (Name) Values ('')
Endif
Endproc
Enddefine |
Son düzenleyen, ugurlu2001 (25.05.2010 09:03:19)
Uğur
-------------------------------------------------------------------------------------------------------------
Hayat bir bisiklete binmek gibidir. Pedalı çevirmeye devam ettiğiniz sürece düşmezsiniz. Claude Peppeer
Kusuru söylenmeyen adam, ayıbını hüner sanır. Türk Atasözü