Вы находитесь на странице: 1из 465

681.3.068+800.

92Visual FoxPro
32.973.26-018.1
24

24

. .
Visual FoxPro. . .: -,
2005. - 480 : .
ISBN 5-94157-627-7
,
Visual FoxPro

.
Visual FoxPro, , , ,
, . OLE-
, ActiveX ,
. ,
, .
- Visual FoxPro:

, .
.

681.3.068+800.92Visual FoxPro
32.973.26-018.1
:

.
.

02429 24.07.00. 22.04.05.


70x100Vie. . . . . 38,7.
3000 . No 1002
"-", 194354, -, . , 5.
-
77.99.02.953..006421.11.04 11.11.2004 .
.

" ""
199034, -, 9 , 12

I S B N 5-94157-627-7

. , 2005
, ' - , 2005

?
,
Visual FoxPro?

9
10
11

I.
VISUAL FOXPRO

13

1. !

15

15
16
18

2. Visual FoxPro

19

3. Visual FoxPro

24

() Visual FoxPro
?
?



24
25
33
34
34
36
36
38

4.

40

5.

45

6. .

55

(Form Designer)
(Properties)

56
60
63

""

66
75
77
78

7.

81

83

8.

88

9.

90

10.
CommandGroup

Form Wizard
AutoForm Wizard

97
97
102
105
109

11.

111












Report Wizard

111
114
117
118
120
122
122
125
125
126
128
131
136

12.

139

13.

143




Referential Integrity Builder

143
146
147
147
149
152
154
157
159
160
165

14. .

167

ListBox

(ComboBox)
(OptionGroup)
(Container)
(Spinner)
(PageFrame)
(Checkbox)
(Line)
(Shape)
(Image)
(Grid)

167
168
172
173
176
176
177
179
180
182
183
183

15. ,

197

LOCATE.
SEEK.
SET FILTER TO.

198
199
199
200

16.

203

(Query Designer)


( )
HTML
SQL- SELECT ""?

HAVING
SQL- SELECT

SQL-

203
209
212
216
217
217
218
220
221
222
227
230
233
236
236
237
243

17. ()

244

244
251
253

18. OLE-

257

OLE-
OLE-

260
263

OLE-
GETDIRQ, GETFILEO APPEND GENERAL

265
265

19. ActiveX

268


ActiveX

268
272
279

20.

280

Excel

280

21.

293

22.

296


Command ()
Submenu ()





Shortcut-

299
30 J
302
303
305
306
306
308
309

23.

311


-
What's This?.

321
324
326

24. -

328



Exclude

328
329
330
330

25.

334

. -

343

26.

345

346
349

27. Class Designer


1

352
354

2 Puzzle

359

369

28.

380

29.

388

30.

397

31.
Class Browser

401
401
404

32. Visual FoxPro

407

33. (Component Gallery)

414

Component Gallery

416
420
421

423

425

1. Visual FoxPro

427

2.

453

MessageBox

456

3.

459


Grid
Grid Grid
Builder
"" Grid
TextBox
ListBox
ListBox

ListBox
DropDown ,

Visual FoxPro

459
461

467

461
462
462
462
462
463
463
463
464
464
465
466
466

" ".
Fox Software

,
,
Microsoft. Visual FoxPro,
.

?
, ,
Microsoft Visual
FoxPro.
,
, ,
-
.
""? -, : ,
, ! ?
.
, , :
"" ;
"Atlantis";
;
.
, .
:
Visual FoxPro;
, , , . .;

10

;

;
(, ?),
.
, ? - ! ,
?
: . , ,
" " Microsoft Visual FoxPro. ?
, , ... ,
Visual FoxPro
, - , .
, Visual FoxPro ,
" ", ,
. !
,
.

,

FoxPro, ,
, , .
70-
dBase. -
"" 80- Fox Software,
FoxPro. " "
, .
, (
, "" )
GUI (Graphic User Interface, ).
"" GUI
! Fox Software
, FoxPro
, ! ,
,
.
FoxPro Microsoft,
Fox Software.
FoxPro 2.5 for DOS FoxPro for Windows,

11

"" Visual FoxPro 3.0, Visual FoxPro 5.0,


Visual FoxPro 6.0 ( ) ,
Visual
FoxPro 8.0 ( !).
"" ?
Visual FoxPro. ,
? ,
, .
, , .
, ,
,
, . , ,
( , ),

.
, .

Visual FoxPro?
, , Visual? Visual "", . . .
? ,
( ).

. , ,
:
WYSIWYG (What You See Is What You Get).
, , " "?
, "" (screen) ,
, ""
, ( ). -
"" Visual .

, Visual FoxPro.
Automation Server
. Visual FoxPro
, .
HTML-.
HTML Help Workshop
HTML.
(Builder) (Wizard)
.

12


(, . .).
JPEG, GIF
.
2YK (2000 .) , .
GUI,
.

HTML- Internet Explorer.
Visual FoxPro
.
, , "" Visual FoxPro,
.
-
.
, "" ,
.

I

Visual FoxPro
I
Visual FoxPro.
: ,
, , . .
,
(Wizard) (Builder).
,
.

!
- , , ,
. ? ?
, ,
, : " ,
-
". ? , ,
,
:
,
;
10 ;
( )
.
? ,
:
"", ;
"";
;
, ( ,
).
,
, .

?
. ,
( Visual FoxPro). , one-

I. Visual FoxPro

16

, , - ,
, ,
? , .
,
, , .
.
, , ,
, . , .
? ! , ,
, . , ,
.
- , , (
!) !
, .
,
, . ?
Visual FoxPro dbc,
, :
Tables ();
views (, :
Local Views Remote Views);
Connections ();
stored Procedures ( ).
, Visual FoxPro
.

FoxPro dbf.
(. 1.1).
1.1. Pasport

22.08.1972

, .
FoxPro (Field . ""),
(Record ~ . "") . 1.2.

1. !

17

1.2.
Field 1

Field2

Field n

Record 1
Record2

Record n

, , ,
- . pasport.dbf
( Character),
22.08.1972 ( Date).
, . . Date,
.
, ,
.
Visual FoxPro
, .
,
, :
;
;
;
;
;
;
( ).
.
, ,
dbf (Data Base File),
dbc (Data Base Container).
Visual FoxPro 3.0,
dbf.
,
,
"" ,
, , , !
, ,

18

I. Visual FoxPro

, , , 8 424 659 ? ,
...
( , )
,
.

- , ,

. "" ,
- . Visual FoxPro
.

. , Oracle, SQL
Server, Microsoft Access, Clipper . . ,
. ,

, . .
.
, ,
,
.

Visual FoxPro
, ,
Word, Excel, Internet Explorer, -,
, Windows- "
". Visual FoxPro
, .
.
(Start).
Visual FoxPro ,
Windows,
Microsoft Visual FoxPro. (Start),
,
(Programs). ,
Microsoft Visual FoxPro,
"" - . ( ""
, . , ,
). - ,
. 2.1.
c .
, .
. ,
Visual FoxPro vfp6.exe (
), ,
(. 2.2).

Visual FoxPro
, vfp6.exe,
vfp8.exe.

20

I. Visual FoxPro

. 2.1.

. 2.2.

Windows.
, , .
Visual FoxPro,
Vfp6.exe,
(Double Click) , , (. 2.3).
Vfp6.exe
.

2. Visual FoxPro

21

.
.
.
-, ,
Visual FoxPro. : Vfp6.exe,
. ,
| . .
" Vfp6.0".
, . .
. . (

.)

. 2.3.

, , -
Windows, ,
, ... ,
. (. 2.4).
, , ,
(Command Window).

22

I. Visual FoxPro

\\

HUM

. 2.4. Visual FoxPro

Visual FoxPro ,
- (. 2.5), :
Open the new Component Gallery to organize your Visual FoxPro com
ponents
Visual FoxPro;
Discover programming solutions by exploring sample applications
;
Create a new application ;
Open an existing project ;
Close this screen .
- Don't display this
Welcome screen again (He ).
.
( ),
Visual FoxPro, -.

2. Visual FoxPro

. 2.5. - Visual FoxPro

23

Visual FoxPro
:
(Caption);
(System menu);
(Toolbar);
(Desktop);
(Command window);
(Status bar).
,
, ,
, ? ,
...

.

, , , . : Microsoft Visual FoxPro. ,


, Windows
. ,
, .
, Visual FoxPro.
. 3.1.
, ?
. ,
-

3. Visual FoxPro

25

Windows. Visual FoxPro .


. ,
,
Visual FoxPro.
:
, ,
;
,
.
Ha 3 a
, ,
Windows (
| ).
3.1.

Restore ()

Move ()

Visual FoxPro (
) ,

Size ()


, (
)

Minimize ()

Maximize ()

" ".

Close ()

Visual FoxPro

() Visual FoxPro
, !
,
Visual FoxPro ,
. !
File (). ,
, . -

26

I. Visual FoxPro

, , ,
. . 3.2.
3.2. File

New ( )

Open ()

Open,
,

Close ()

Save ()

.
,

Save as ( )

,

.

Save as HTML
( HTML)

HTML

Revert ()

,

""

Import ()

,
FoxPro

Export ()

, , "
" Visual FoxPro

Page Setup
( )

Page Preview
( )

,
. ,

Print ()

Send ()

E-Mail.
, ,

Exit ()

. .
Visual FoxPro.
!

Edit ().
(. 3.3).

3. Visual FoxPro

27

3.3. Edit

Undo ()

. , ,
, , - .
?! , . Undo
!

Redo ()

. "
". -

Cut ()


(Clipboard)

()

Paste ()

Paste Special
( )

, Paste, ""
,

Clear ()

Select All ( )

.

.
,
...

Find ()

Find Again ( )

, Find,
,

Replace ()

Go to Line
( )

Insert Object
( )

Paste Special,
,

Object ()

OLE

Links ()

OLE

Properties ()

View () " ". ,


, View , .

28

I. Visual FoxPro

, ,
Toolbars (
).
Toolbars ( ),
Visual FoxPro.

View
. 3.4.
3.4. View

Edit ()

E d i t
.

Browse ()

Browse
.
.

Append Mode (),


( )

Design ()

(Form
Designer),
(Report Designer),
(Label Designer) ,

Tab Order ( )


<>

Preview
( )

Data Environment
( )

,

()

Properties ()

Properties (
),

Code (, )

Form Controls Toolbar (


)

3. Visual FoxPro

29
3.4 ()

Report Control Toolbar


( )

Layout Toolbar (
)

Color Palette Toollbar (


)

Report Preview Toolbars (



)

,
,

Database Designer
( )

Database Designer (
),
,

Grid lines ( )

Show Position
( )

General Options
( )


(Menu Designer)

Menu Options ( )

Toolbars ()

Toolbars (
),
Visual FoxPro

Format ().
, . ,
Visual FoxPro
.
(. 3.5).
3.5. Format

Font ()


(, . .)

30

I. Visual FoxPro
3.5 ()

Enlarge Font ( )

Reduce Font ( )

Single Space ( )

11/2 Space ( )

Double Space ( )

Indent ()

Unindent ( )

Comment ()

Align ()

Size ()

Horizontal Spacing
( )

Vertical Spacing
( )

Bring to Front ( )

Send to Back ( )

Group ()

Ungroup ( ,
)

Snap to Grid
( )

"" ""
( )

Set Grid Scale ( )

Text Alignment ( )

3. Visual FoxPro

31
3.5 ()

Fill (, )

()

Mode ()

Tools ()
: , , ""
(. 3.6).
3.6. Tools

Wizards ()

Visual FoxPro

Spelling ()

?
.

Macros ()

Class Browser
( )

Visual
FoxPro

Component Gallery
( )


Visual FoxPro

Coverage Profiler

Beauty ()


,
.
!

Run Active Document


( )

Debbuger ()

, ... Bugs "".



.
. ,

OPtions ()

Visual FoxPro

I. Visual FoxPro

32

Visual FoxPro Program (


). , ,
(. 3.7).
3.7. Program

Do ()

Cancel ()

Resume ()

,
. ""

Suspend ()

Compile ()

Run ()


Window () (. 3.8).
3.8. Window

Arrange All
( )

Hide ()

"" ,

Show All ( )

Clear ()


Visual FoxPro

Cycle ()

Command Window
( )

Data Session ( )

,
,
. ( - 32 767!)

<>

(. .
) . ,
More Windows ( ).
,

3. Visual FoxPro

33

Help ().
: , !
! ! ?
: "Help me! Save me! I'm dying!".
:
Help () . 3.9.
3.9. Help

Microsoft Visual Fox Pro Help Topic


( )

Contents ()

Index ()

Search ()

Techical Support
( )

Microsoft on the Web


( Microsoft
)

Web-
Microsoft

About Microsoft Visual Fox Pro


( )


, . .

,
, .

?
! Windows, Visual FoxPro
, , .

(
, ).
.

, <F10> <Alt>.

<Enter>.
.
2

. 1002

34

I. Visual FoxPro

"" ("hot key"). ,



Ctrl+O? "" "
". ( )
<Ctrl> .
Open.
, ,
,
. , ,
<Ctrl> , ,
. !

?
:

;

<Esc>.
<F10> <Alt>.


, Visual FoxPro
, -
,
.

, , . .
.
,
Visual FoxPro (. 3.1)
Standard ()
.

. 3.1.


comboBox ( , comboBox -

3. Visual FoxPro

35

, ).
(TooiTips),
. , ,
,
. 3.10.
3.10.
()

New ( )


.
New

Open ()

Open,
,

Save ()

.
,

Print One Copy


( )

,
Command

Print Preview
( )

Spelling ()

Cut ()


(Clipboard)

()

Paste ()

Undo ()

Redo ()

Run ()


. ? ,
,

Modify Form
( )

Form Designer (
)

Databases
( )

36

I. Visual FoxPro
3.10 ()

()

Command Window ( )

Data Session Window


( )


Data Session ( )

Form ()

Form Wizard (
)

Report ()

Report Wizard ( )

Auto Form Wizard (


)

Auto Report Wizard (


)

Help ()

.
,
, .
,
.


,
Visual FoxPro. ,
- Windows.
"-" (,
) Visual FoxPro.
? !



Visual FoxPro. ""
Windows, . .
, .
.

3. Visual FoxPro

37

. ,
Visual FoxPro,
, , .
. . , ,

Visual FoxPro. (, !)


,
"Hello,World!" He :
. . 3.2 <Enter>.

. .2.

, ? , . ,
, <Enter>
.
. ,
FoxPro
. (
3.1), <Enter>,
.

38

I. Visual FoxPro

3.1.
cmessage = "Hello, World !"
cname = "My name is ...."
@10,15 SAY cmessage FONT "arial",16
012,15 SAY cname FONT "arial",16

<Enter>.

Execute Selection (
) . 3.3.

. 3.3.


Visual FoxPro.
:
.

3. Visual FoxPro

39


. , .
.
( ).
.
, :
Exclusive , ;
Record unlocked ;
Record locked .
.

, ,

Visual FoxPro.
, <Insert>
OVR Visual
FoxPro .
NUM ,
<NumLock>.
<CapsLock>
, CAPS.
, ,
. , SET
CLOCK STATUS Tools | Options (
| ) Options ()
View ().
!
, .


,
,

,
.
dll. pjx pjt.
,
:
File () New ('
);
New () .
New (),
, (. 4.1). Proje
() ( ).
New file ( ).
() (. 4.2). Enter project ( )
, ,
.
Enter project ( )
projl. , , .
,
(Save) , Project Manager (
) (. 4.3).
. . 4.1
.
.
- ,

4.

. 4 . 1 .
New

41

. 4.2. Create

4.1. Project Manager

All ()

Data ()

, , ,

Documents ()

, ,

Classes ()

Code ()

Other ()

"+". ? , ,
"" Data (). ?
,
(. 4.4).
- ,
. 4.5.
, ""
(. 4.6).

42

I. Visual FoxPro

. 4.. Project Manager

. 4.4. Project Manager

. 4.5. Project Manager Documents

,
Visual FoxPro Project ()?
,
. 4.2.
:]

4.

43

. 4.6.

4.2. Project

New File ( )

Add File ( )

Modify File ( )

Browse File ( )

Browse (
)

^Rename File ()

Preview ()

Remove ()

Exclude ()

Set Main ( )

44

I. Visual FoxPro

4.2 ()

Edit Description
( )

Project Info ( )

Errors ()

Build ()

Refresh ()

Cleah Up Project ()

(. 4.7).
, ,
Project (),
.

. 4.7. Project Manager


-! ! , . ,
, ,
, ...
, "" . ,
.
,
, .
, ,
.
? - ,
, , .
,
Visual FoxPro.
, ,
examples.
Visual FoxPro ,
New ()
Project New (). New
New File ( ) (. 5.1).
Create () Enter project ( )
,
(examples) .
(. 5.2).
,
Data (), Free Tables ( )
New, New Table (
) (. 5.3).

46

I, Visual FoxPro

, 5.1. Create

. 5.2. Equation

. 5.. New Table

5.

47

Table Wizard ( ), ,
New Table ( ).
, Create (. 5.4)
, ,
.

. 5.4. Create

Enter table tabiei.


. ,
, mytab .
Table Designer ( ).
:
Fields () ;
Indexes () ;
Table () .
Fields (),
.
10
. ,
. ,
.

. : Abed,
F

i r s t _ N a m e , Fox 6.

48

I. Visual FoxPro

. 5.5. Table Designer

Visual FoxPro " " 13.



Visual FoxPro, ,
Integer (Autolnc).

.
character
. 1 254 ,
, , .
. , 10 ,
10 , , .
? ,
, , character
.
character ,
. , .
? -, 000458 Numeric,
458. -,
"" - .
, ,
?
, :
Numeric.
C h a r a c t e r .

currency ,
.

5.

49

- 922 . , ?
,
. ,
currency:
-922 337 203 685 477,5807 922 337 203 685 477,5807
Date .
1 01 ( ) 31 9999 (
...).
DateTime , Date,
12,00,00 am 11,59,59 .
Logical , ,
.. (True) () .F. (False) ().
- ,
. , "/"
,
.
Memo . "
"? :
C h a r a c t e r , . . 2 5 4 Memo.

character (binary) ,
.
integer .
-2 147 483 547 2 147 483 547.
General
. ,
Memo.
N u m e r i c F l o a t

-0,9999999999*1019 0,9999999999*20.
Double :
4,94065658541247*10324 1,79769313486232*10308.
,
, , ,
, .
,
:
2 + +=0
d =

b2-

xl=(-b+sqrt(d)/2*a
x2=(-b-sqrt(d)/2*a

50

I. Visual FoxPro

sqrt (d) , d.
,
FoxPro, .
, Numeric,
, , , d, xi 2,
character , , Date.
mytab.
Fields () Table Designer (
) "" (. 5.6).

. 5.6. mytab

, Name (), ,
, ""
.
, first_a.
, , ()
, ,
. character.
, Numeric.
<> Width
(), .
, , . .
spinner ( ).
.
,
. .

5.

51

Fields Decimal ( ).
Numeric
. ,
, , . .
Width.
Index ,
(Ascending) (Descending).
( ) , Visual FoxPro
.
NULL ,
NULL.
,
. 5.7.

. 5.7.

, ,
.
, .

. . ,
!
:
;
Cansel ;
Insert ;
Delete .

52

I. Visual FoxPro

, , ,
(. 5.8).

. 5.8.


. Yes ()
.
(Append Mode),
(. 5.9).

. 5.9.

,
.
: , <Enter>
.
"", . . .
.
, .

5.

53

,
(. . 5.9), .
Windows:
,
.
<Ctrl>+<W>.
(Project
Manager) (. 5.10). ,
, Free Tables Data.
: +.
+, .

. 5.10.

,
. , Description (
) (Path) .
,
Browse () (. 5.11).
,
,
, .

54

I. Visual FoxPro

. 5.11.

.

""
,
,
.

. ,
, .
,
.
, :
, ,
, .
: ,
, Form Wizard Form Designer.
"" Wizard, ,
, "" , Form Designer
( ).
.
New () File ()
New () New File ( ),
Form ().
New () .
, .
, ?
New (),
, .
, .

56

I. Visual FoxPro

. 6.1. New Form


Documents () ,
Forms () New ().
New Form ( ) (. 6.1),

(Form Wizard). ,
,
New Form ( ),
.

(Form Designer)
(. 6.2) :
( Forml);
Form Controls ( );
Color Palette ( );
Layout ();
Properties ();
(Data Environment).
, , ,
View ().
.
Color Palette ( )
, .
Layout () -1
.
Data Environment ( )
(, ), .
Properties () , ,
, .

6. .

57

Form Controls { ), ,
Form Designer,
(. 6.3).
. 6.1.

. 6.2. Form Designer

. 6.3. Form Controls

6.1. Form Controls

58

I. Visual FoxPro
6.1 ()

6. .

59
6.1 ()

60

I. Visual FoxPro
6.1 ()

(Properties)
,
, (Properties) (. 6.4).

. 6.4. Properties

6. .

61

, ,
View (),
,
(. 6.5).

. 6.5. Properties

Properties ()
Visual FoxPro.
, ,
.
: ,
, , (
), , ,
(, ). Default
User Procedure.
default , ,
User Procedure (, ).
(, )
, ,

62

I. Visual FoxPro

, (, )
.
:
All ,
(. 6.6);

. 6.6. All Properties

. 6.7. Data Properties

Data ,
(. 6.7);
Methods (. 6.8);

. 6.8. Methods Properties

6. .

_ _ _ _ _ _ _ _ ^ _ ^ _

63

Layout , ""
(. 6.9);
Other (. 6.10).

. 6.9. Layout Properties

. 6.10. Other Properties


.
mytab,
, , "" ,
.
:
1. Data Environment ( ),

. Open (),
.
2. Add Table or View (
) (. 6.12), ,
. (
), Tables in database ( )
.
Other ().
3- Open () (. 6.13),

(. 6.14).

64

I. Visual FoxPro

. 6.11. Data Environment


. 6.12. Add Table or View


, ,
Browse (),
Remove (). ,
tabie2 .
.
, , , .

6. .

65

. 6.13. Open

. 6.14. Data Environment

, ,
Data Environment ( )
.
,
.
02

66

I. Visual FoxPro




Form Controls, .
,
TextBox ( ).
Form Controls, ,
, . ,
(. 6.15).

. 6.15. TextBox

pacno . ,
Properties () ,
, . , ,
.
"" ,
, .
. !
, TextBox z
Textl. Visual FoxPro ,
TextBox,
Text2. .

Properties Name ().

6. .

67

, Texti, Text2 . . Visual FoxPro


,
Form Designer. ,
, Data Environment (
), Form Wizard
.
Label (),
, Textl (. 6.16).

. 6.16. (Label)

Label ,
(Labeli). ,
caption () .
:
TextBox FontBoid .. (
), Fontsize ( )
22 ;
Label ,
26
AutoSize () .. "
" ,
.
.
, ()

68

I. Visual FoxPro

Paste (), .
, ,
. ,
. , ,
? , !
<Shift> , ,
. :
( )
, .

.
, Paste
.
Paste.

Visual FoxPro , , ,
.

.
: Text2, Text3, Labei2 Labei3
(
"" Texti Labeli), Text4
(. 6.17).

. 6.17. TextBox L a b e l

Visual FoxPro
, . ,
"" Data Environment ( ).
, ,
,
. xi 2
mytab (. 6.18).

6. .

69

. 6.18. xl 2
Data Environment

, "" ,
: Label TextBox.
Label , , .
, , , ,
Name (). , ?
. , ,
, ,
, ? ! , "
", : - .
, TextBox
mytab. Texti
Data () . controisource (
) ,
, F i r s t a (. 6.19).
controisource
:
Text2 mytab.second_b;
Text3 mytab.third_c;
Text4 mytab.result.

70

I. Visual FoxPro

. 6.19. T e x t l

.
a l i a s . ,
Visual FoxPro , ,
.

,
txtx1 txtx2?
, |
,
Visual FoxPro . !
, Properties.

,
, |
, Properties. ,
Properties , - j
, . - , |
.
, Fontsize . ., |
. -1
j
.
M u l t i S e l e c t i o n ( ).

6. .

71

(commandButton)
,
. Form
Controls
(. 6.20).

. 6.20.

Caption ():
commandi ;
command2 .
. ,
,
, .
, ,
,
"".
Forecoior.

, (. 6.21).
.
ForeCoior (255, , 0),
, .
, RGB.

Color Palette () (. 6.22).
txtxi,
.
Foreground color (
). (txtxi),
.

72

I. Visual FoxPro

. 6.21. Properties

. 6.22. Color Palette

Background color

. .

Other colors
. -1
.
:
,
,
.
, |
.
:
1. , Methods ()
Properties, ClickEvent.
click, , . |
,

6. .

73

,
ciickEvent. ,
(. 6.23).

. 6.23.

2. Object ()
, Procedure ()
.

click

thisform.Release .

,
.
? .
"" (thisform)
RELEASE .
,
, Visual FoxPro, QUIT.
, Visual FoxPro -
. ,
? , ,
? !
.
.
click (. 6.24).

74

/. Visual FoxPro

. 6.24.

. ]
;
, .)
Visual FoxPro : !
, . , -j
Replace Repia.
.
* (). ,/
.^
)
, , . * ,
,
? : &&.
Replace , ;
with. , *
: , , -
. , . ,
Numeric FoxPro ^
.

6. .

75

:
do c a s e &&
c a s e < - !
< >
case < - 2
< >

>

>

endcase &&

, Refresh ,
. .


, .
( ), ,
.
, ""
. - ,
Select.

Replace.
, "" ,
Visual FoxPro ,
.

Visual FoxPro ,
. ,
, ,
.
, Visual FoxPro (. 6.26.6).
, . .
, ,
. ., .
6.2.

. "", :
"Fox" + " P r o " = "FoxPro"

76

I. Visual FoxPro

^ ^ ^ ^

6.2 ()

6.3.

**

6.4.

( )

6.5. ()

<

>

! = # < >

<=

>=

==

( )

___

6. .

77

6.6.

-
,

NOT !

AND

()

OR

()

""
, ,
"" " ".
Formi,
Caption : Caption=
.

( !),
Border style ( ) 2
Fixed Dialog ( ).
AutoCenter ( )
. . .

ShowWindow : in screen ( Visual FoxPro),


in LeveiForm ( ) As Top Level Form (
). ,
: ,
. As Top Level Form.
Text4 Alignment ()
2Center ( ).
"", :
.
Picture () -
. ,
, ,
( ).
Open ()
(. 6.25), .
Preview () -

78

I. Visual FoxPro

. ( ,
.)
, .

. 6.25. Open

,
, . (
Mouse icon.) MousePointer ( )
99 - Custom ().
Backstyle ( )
Label 1, Labei2 Labei3 Transparent ( ).
,
Formi. , Forml.


. :
Run ;
Run Form Form;
Run ;
Command : do form forml.
, , -j
. , |
, . 6.26.

6. .

79

. 6.26.

, , . ,
,
, .
. ? ,
? " ",
( ) . , ,
, ! .
Texti, Properties
vaiidEvent,
:
if this.value=0
this.backcolor = RGB(255,0,0)
return .F.
else
t h i s . b a c k c o l o r = RGB(192,192,192)
endif

, .
if...endif docase.
:
&&
if <1>
< 1>
else
<

2>

endif &&

: <1> , < 1>,

< 2>.

:
c

oe>.

<>=<>

80

I. Visual FoxPro

<> value (), <>


Texti, . . Texti 0,
:
this.backcoior ,
RGB ( );
return .F. ErrorMessage (
), , Valid
. ErrorMessage
, invalidinput ( ).
invalid,
! ErrorMessage :
MessageBox ( " . , .",
" ")

MessageBox - .
- .
. messagebox -
(. 6.27). .

. 6.27.


,
Visual FoxPro. .
:
255 ;
;

(
);

FoxPro. ,
replace . .
, (255 ) .
, ...
?
MyVar

=456

MyVar . ,
456.
,
. , Visual FoxPro
" ". ,
. :
MyVar = 456
MyVar = "Fox Pro"

&& 456
&&
&&

? .
Visual FoxPro , , -

82

I. Visual FoxPro

,
. ,
, C++
.
: " ,
?" , , ... ,

: Public, Private, Local.
, Public (), ""
. ,
.
Private ()
(, ).
Local () .
:
Local MyVar, M y V a r l , . . . , MyVarn

. . .
? ,
, .
,
STORE. :
STORE 456 MyVar,MyVarl,MyVar2

:
STORE "Moscow"

TO MyCity, MyTown, MyRegion, Adress

"" , ""
Visual FoxPro.
,
, .
. ,
, .

.
,
. , , Local
, lnMyVar, i Local,
a n Numeric. . 7.1 7.2
.
? :
,

7.

83

, , . -,
,
.
,
, " "
.
7.1. ( )

Public (Global)

Local

Private
Parameter

7.2. ( )

Array ()

Character ()

Currency ()

Date ()

Object ()

Numeric ()

L o g i c a l ()

Float ()

DateTime ( )

Double ( )


, .
(Formi) ,
File | Save As ( | ),
, FormWithVar. Data
Environmennt ( ) mytab,

I. Visual FoxPro

84

Remove () .
"" . ,
,
TextBox.

, .
(Builder).

. , Visual FoxPro
.
,
.
,
, .
, ""
T e x t l FormWithVar.

Textl , ,
Builder (). Text Box
Builder ( ) (. 7.1) :
Format ();
Style ();
Value ().

. 7.1. TextBox. Format

Format () Data Type


( ),

7.

85

.
, Numeric.
, , :
Enable at run time () ,
.
Enabled;
Alphabetic characters only ( )
;
Make read-only ( )

. Readonly;
Select on entry ( ) (
) ;
Hide selection (
( ) . HideSeiection;
Display leading zeros ( )
.
: Input Mask
( ).
. User-defined mask (,
). ,
, , ,
999.99.

Format,
Style (),
(. 7.2).
Special effect ( ) :
3D () Plain (). 3D
. speciaiEffeet.
Border ()
: Single ()
, a None () .
Character alignment ()
,
. Alignment.
Size text box to fit "" "
".
Value ()
. Field name ( )

I. Visual FoxPro

86

, (
- ).
, Open ().

. 7.2. TextBox. Style

. 7.3. TextBox. Value

.
Cancel ()
. Help ()
Help Help!
, Text2
Text3.

7.

87

click
( 7.1).
7.1.
note :
LOCAL lnvara,lnvarb,lnvarc,lnd,lnxl,lnx2,lcresult
*
invara=THISFORM.1.VALUE
lnvarb =THISFORM.TEXT2.VALUE
lnvarc =THISFORM.TEXT3.VALUE
* d
* lnd :
lnd=lnvarb**2 - (4*lnvara*lnvarc)
* d
DO CASE
&&
CASE lnd>0
&& d , :
lcresult="ypaBHeHne "
* , lnxl
lnxl=(-lnvarb+sqrt(lnd))/(2*lnvara)
* :
12=(-lnvarb-sqrt(lnd))/(2*lnvara)
CASE lnd=0
&& d , :
lcresult="ypaBHeHne "
lnxl=lnvarb/(2*lnvara)
CASE lnd<0
lcresult = " "
* :
ENDCASE
* :
THIS FORM.1.VALUE =lnxl
THISFORM.TXTX2.VALUE = lnx2
THISF0RM.TEXT4.VALUE = lcresult
:
THISFORM.REFRESH{)

Note
.

(lnVarA = THISFORM.TEXTI. VALUE . .)
Field name ( ) Value ()
.

,
.
(, ).

,
, () "",
: , (2), ().
.
,
"".
df
: "" "":
My2Darray(5,2)

, . :
MyArray(l) = 5 2 3
MyArray(2) = 348
() =* ( (1)- (2) ) *0.5

() 87,5.
,
click ( 8.1).
8.1.
NOTE ,

declare:

DECLA myar(7)
&&
*

8.

89

myar(l)=thisform.textl.value
&& a
myar(2) -thisform.text2.value
&& b
myar(3) -thisform.text3.value
&&
* d
* :
myar(4)=myar(2)**2 - (4*myar (l) *myar (3))
* d
DO CASE
&
CASE myar(4)>0 && d , :
myar(5)=" "
* , lnxl
myar(6)=(-myar(2)+sqrt(myar(4)))/(2*myar(1))
* :
myar(7)=(-myar(2)- sqrt(myar(4)))/(2*myar(1))
CASE myar(4)=0 && d , :
myar(5)=" "
myar(6)=myar(2)/(2*myar(l))
CASE myar(4)<0
myar(5) = " "
* :
ENDCASE
* :
THISFORM.TXTX1.VALUE =myar(6)
THISFORM.TXTX2.VALUE = myar(7)
THISFORM.TEXT4. VALUE = myar(5)
* :
THISFORM.REFRESH()

, (
, ,
,
THISFORM.TEXTI.VALUE), .

,
.
(- .
-
.
: " ?"
.



,
.
BROWSE ().
BROWSE
,
.
.
,
. caption
, click BROWSE
(. 9.1).
,
BROWSE (. 9.2).
BROWSE , "
" . , xl, x2, d Result,
. .
. !
,
, , " ".
, ,
, ! ,
(
,
).

9.

. 9.1.

. 9.2. Browse

91

92

I. Visual FoxPro

BROWSE ,
"":
BROWSE FIELDS first_a :h= " a", second_b :h= "
^ b,third_c :h= " "

FIELDS ()
, .
: (. 9.3). ,
BROWSE ,
, second_b,
?

. 9.3.

,
<Ctrl>+<Y>. , -
,
. -j
:
BROW FIELDS f i r s t _ a :=" A", second_b :.="
^ ", t h i r d _ c :=" "
VALID f i r s t _ a < > 0
VALID . ,

.
BROWSE ,
,
, .

9.

93

BROWSE APPEND.
, ,
click (. 9.4):
Append Fields f i r s t _ a , second_b, third_c

. 9.4. APPEND


. , ,
, BROWSE,
.
.
.
APPEND BLANK.
,
. . . ,
, . ,
.
click :
APPEND BLANK
THISFORM.REFRESH{)

REFRESH , "
" (. 9.5).

94

I. Visual FoxPro

. 9.5. ,

, ! "
". :
, . !
,
, 15
, "" . , , . ,
, ? - ...

:
SCATTER

MEMVAR

BLANK

MEMO

.
MEMO
Memo. . ,
ADDREC (. 9.6).

. 9.6.

9.

95


, SCATTER.

, ,
.
: ,
Click:
:
SELECT mytab
APPEND BLANK
GATHER MEMVAR
WAIT WINDOW " "
THISFORM.RELEASE

:
THISFORM.RELEASE

Formi
click:
SCATTER MEMVAR BLANK
DO form c:\examples\addrec

(. 9.7).
1. .
, "" (
SCATTER BLANK).
2. ADDREC. :
DO FORM (<>) < >

. 9.7.

I. Visual FoxPro

96

3. ADDREC,
.
4. :
. . ,
; SELECT
<_!>\

, APPEND BLANK;
GATTER MEMVAR
, WAIT WINDOW
" ";

(Thisfom.Release) .

ADDREC FORMI (,
ShowWindow=l).


.
Formi , ,
? , , )
. .

10


Visual FoxPro
, .
SKIP ,
, ,
. 1
SKIP.
SKIP -l SKIP,
" " .
GO BOTTOM
, GO TOP .
GO GOTO
. , GOTO 23
.
,
,
.


CommandGroup
, ,

- CommandGroup.
Formi.
Controls Command Group, CommandGroup
. ,
, Build (. 10.1).
4

02

98

I. Visual FoxPro

. 10.1. Command Group Builder

: Buttons () Layout (-1


).
Buttons (. . 10.1). Number of |
buttons ( ) , |
(2). ,
. Caption ()
, Graphic (
), , , j
( 6) -|
. -1
Open (),
(. 10.2).

. 10.2.

Layout () (. 10.3).
.

. 10.3. Layout

Button layout ( ) : Vertical


(), Horizontal ().
Spacing between buttons ( )
. .
Border style ( )
.
(. . 10.3), .
. 10.4.

. 10.4. CommandGroup

100

I. Visual FoxPro

,
. "". commandGroup.
, "" . " "?
, ,
Edit (). ,
,
. Click :
:
GO TOP
THISFORM.REFRESH

.
IF ! ()
SKIP
THISFORM.REFRESH
ENDIF

:
I F ! EOF ()
SKIP

-1

THISFORM.REFRESH
ENDIF

:
GO BOTTOM
THISFORM.REFRESH

, ,
? EOF()
?
EOF (End of File), ,
, . . . ,
.. ( ).
(Begin Of File), , .
,
, SKIP,
(. 10.5).

10.

101

. 10.5. ( )


.
. ,
. ,
.
,
, . . .
. SCAN. . .ENDSCAN
( 10.1).
10.1.
SCAN
&&
REPLACE m y t a b . d WITH m y t a b . s e c o n d _ b A 2 - ( 4 * m y t a b . f i r s t _ a * m y t a b . t h i r d _ c )
DO CASE
&&
CASE d>0
&& d , :
REPLACE m y t a b . r e s u l t WITH " "
* r e p l a c e ,
xl
Replace m y t a b . x l w i t h (-mytab.second_b + s q r t ( m y t a b . d ) ) / ( 2 * f i r s t _ a )
* :
REPLACE mytab.x2 WITH (-mytab.second_b - s q r t ( m y t a b . d ) ) / ( 2 * f i r s t _ a )
CASE d=0
&& d , :
REPLACE m y t a b . x l WITH ( m y t a b . s e c o n d _ b ) / ( 2 * f i r s t _ a )
REPLACE m y t a b . r e s u l t WITH " "
Case d<0
REPLA m y t a b . x l WITH 0,mytab.x2 WITH 0 , m y t a b . r e s u l t WITH " ;
"
:
ENDCASE
ENDSCAN
&& -

SCAN. . .ENDSCAN .
,

" ", ,

102

I. Visual FoxPro

SCAN ENDSCAN. SCAN


, FOR WHILE.
REPLACE
ALL FOR ( 10.2).
I 10.2.
REPLACE ALL m y t a b . d WITH mytab. second__b A 2 -;
(4*mytab.first_a*mytab.third_c)
<S<S d , :
REPLACE ALL m y t a b . r e s u l t WITH " " FOR mytab.d>0
REPLACE ALL m y t a b . x l WITH (-mytab.second_b + s q r t ( m y t a b . d ) ) / ( 2 * f i r s t _ a ) ;
FOR y t a b . d > 0
REPLACE ALL mytab.x2 WITH (-mytab.second_b - s q r t ( m y t a b . d ) ) / ( 2 * f i r s t _ a ) ;
FOR y t a b . d > 0
&& d , :
REPLACE ALL m y t a b . x l WITH ( m y t a b . s e c o n d _ b ) / ( 2 * f i r s t _ a ) FOR mytab.d=0
REPLACE ALL m y t a b . r e s u l t WITH " " FOR mytab.d=0I
* 0:
REPLA ALL m y t a b . x l WITH 0,mytab.x2 WITH 0 , m y t a b . r e s u l t WITH ";
" FOR mytab.d<0
REPLA ALL m y t a b . d a t WITH d a t e

DO CASE
REPLACE () FOR (), .
ALL () , , FOR.
Dat
Date , .
, , - "-". , Visual FoxPro Date, 2.
, i n i t Formi *.
SET DATE TO German


,
- . , BROWSE

10.

103

(. 10.6).
Delete Mark ( ).
, ,
. , ,
, Remove Deleted Records (
) Table () Visual
FoxPro.

. 10.6.

, ,
.
, , : ,
,
"" . ,
BROWSE ( ,
),
,
BROWSE NODELETE,
.
, <Ctrl>+<T>.

104

I. Visual FoxPro

(BROWSE), , :

DELETE .
,
, FOR/WHILE. DELETE ALL
;
PACK ,
DELETE.
, Memo, PACK MEMO
Memo,
"";
RECALL .
,
. ?
USE "" Visual FoxPro.
, , ,
.
,
:
USE (<>) <_!>

? ,
. inijl
Formi
USE C:\Examples\Mytab EXLUSIVE


, .
USE ,
.
click command6,
commandGroupi ( ):
DELETE
PACK
THISFORM.REFRESH()

10.

105


Form Wizard
,
(Form Wizard)
, (One-to-Many Form
Wizard). (Form Wizard) , ,
(. 10.7).

. 10.7.

. 10.8. New Form


Form Wizard ("", "")


. ,
""
.
, .
NewForm ( ) Form Wizard
(. 10.8).
,
, . ,
!
(. 10.9)
,
.
Open (), .
Avail
able fields ( ).
, ,
, Selected fields ( ).

106

I. Visual FoxPro

Next (),
Back ().

. 10.9.

. 10.10.

(. 10.10) -1
. Style (). !

10.

107

,
, . Button type
( ) 4 :
Text buttons ( );
Picture buttons ( );
No buttons ( );
Custom ()
.
(. 10.11) ,
(
Ascending Descending).

. 10.11.

, , (. 10.12)
( Type a title for your form)
:
Save form for later use (
) ;
Save and run form ( )
;
Save form and modify it in the Form Designer (
).

108

I. Visual FoxPro

. 10.12.

. 10.13.

10

109

Add pages for fields that do not fit


, .
Preview ()
. . 10.13.
: ,
, ,
. Return to Wizard (
)
. ,
,
, .
,
, .
,
Finish (),
.


AutoForm Wizard
, AutoForm
Wizard ( ).
.
Data ()

( AutoForm Wizard). Save
As ( ), (. 10.14).
.
,
(. 10.15).
, Visual FoxPro
,
. ,
,
.
, ,
, ,
, !

110

I. Visual FoxPro

. 10.14. Save As

. 10.15. ,

11


, , , ,
- ? ,
! , , ...
, (
), ,
.
, , ,
, ...

? , ,

.
Visual FoxPro
Report Wizard Report
Designer.
,
, ,
"",
Report Designer.


:
File () New ()
New () New File
( ), Report ();
New () .
;

112

I. Visual FoxPro

. 11.1. New Report

New () Project Manager (


), Reports () Documents ().
New Report ( ) (. 11.1).
New Report ( ), a Report Wizard "
". Report Designer (. 11.2).
:
G Report Controls ( );
Color Palette ();
Layout ().

. 11.2. Report Designer

11.

113

, , ,
View (),
, Report Designer (
) (. 11.3).

. 11.3. Report Designer

"" , , Report Controls


.
, (. 11.1).
11.1. Report Controls

,
: ( ) -

114

I. Visual FoxPro

, .
, ,
, .
: ,
, . . . 11.2.
11.2.

Title ()

Page Header
(
)


.
, , . .

Group Header
( )



. ,

Detail ()

Group Footer ( )

Page Footer
( ,
"")

Summary ()

, . , ,
.
, ,
Data Environment ( ) View ()
. Data Environ
ment.
,
.



.
Report Controls ( ) Label

11.

115

() , ,
. , ,
.
Page Header (
) . 11.4.

. 11.4.

, .
, , Font
() Format () . 11.5.
:
" ,

". ""
Times New Roman, Courier, Arial
.
Text
() . 11.6.

116

I. Visual FoxPro

. 11.5.

. 11.6. Text

-j
( Print When), Object position|
( ) :
Float
;
Fix relative to top of band ""
;
Fix relative to bottom of band ""
.

11.

117


Detail ().
(
?).
,
Report Designer.
Field () Detail ().
Report Expression ( ) (. 11.7).
,
,
,
.

. 11.7. Report Expression

Expression (
), Format (). Expression
,
Expression Builder ( ),
, .
,
, Expression Builder
(. 11.8).
Fields () ,
. Variables ()
Visual FoxPro, , -

I. Visual FoxPro

118

. Functions ()
, , ,
FoxPro, .

. 11.8. Expression Builder

, , , )
Expression for Field on Report ( ). ,
Fields.
Expression for Field on Report,
. , ,
, ,
. -
Verify ().
- , .


Format () (. 11.9)
, Format Report Expression
(. . 11.7).
, ,
, , ,

11.

119

,
, .

. 11.9. Format

, , ,
. 11.311.5.
11.3.

upper case
( )

Set Date format


( )

Ignore input mask


( )

Left justify ( )

Right justify ( )

_Center justify ( )

SET

DATE

11.4.

Left justify ( )

120

I. Visual FoxPro
11.4 ()

Blank if zero
(, )

(Negative)
( )

SET DATE format


( )

British date (
)


(British)

CR if positive (,
)

,
CR ()

DB if negative (,
)

,
DB ()

Leading zeroes
( )

Currency ()

SET DATE

( SET CURRENCY)

Scientific
()

11.5. Date

Set Date format


( )

British Date
( )


(British)

SET DATE


,
, Print When ( |
(. 11.10), Print When
Expression (. . 11.7).
, |
Print repeated values (

11.

121

) No (). Yes
() .

. 11.10. Print When

Also print ( ) :
In first whole band of new page/column
;
When this group changes
. ;
When detail overflows to new page/column
Detail () /.
Remove line if blank
.
Print only when expression is true ,
.
(true) .
Report Expression (
) (. . 11.7) ...
, ,
, .
,
, . .
,
. ,

, .
, ,
, . 11.11.

122

I. Visual FoxPro

. 11.11.

Report Expres
sion, .


, , Report Controls (
).
, , ""
.
: , "" -.



Report ( Title/Summary ( | / ).

123

11.

. 11.12. Title/Summary

Title/Summary (. 11.12),
Title Title band,
, , Summary band.

(. I I.J3).

. 11.13. Title

Fill () Format (),


. ,
.
"" , Send To Back (
) Format.
,
() (. 11.6).
11.6.

Hairline ( )

1 Point ( )

2 Point ( )

4 Point ( )

124

I. Visual FoxPro
11.6 ()

6 Point ( )

None ()

Dotted ()

Dashed ()

Dash-dot (-)

"-"

Dash-dot-dot (--)

"--"

Summary,
.
() (Paste),
Detail Summary.
, Report Expres
sion Calculations (),
Calculate Field ( ) (. 11.14).

. 11.14. Calculate Field

, |
, (. 11.7).
11.7.

Nothing ()

Count ()

Visual FoxPro
1

11.

125
11.7 ()

Sum ()

Averange ( )

Lowest ( )

Highest ( )

Standard deviation
( )

: "
"

Variance ()

Count ().
Reset () ,
:
End of Report ( ) ;
End of Page ( ).



Color Palette ( ).
, ""
, .
, , :
?


, ,
, General.
Report Controls
.
Report Picture ( ),
(. 11.15).
Picture from ( ?
, ...).
,

File (). ,

126

I. Visual FoxPro

Open
().
Field () General.

. 11.15. Report Picture

, If picture and frame are different sizes


( ) :
Clip picture ( ) ;
Scale picture, retain shape ( , )
, ;
Scale picture, fit the frame ( , ) , .

. 11.16.


Preview () -

11.

. 11.16.

. 11.17.

127

128

(. Visual FoxPro

.
. 11.17.
, ~
Print Preview ( )
(. 11.18).
, ,
, ,
.

. 11.18. Print Preview


, , , -
Visual FoxPro . .
Print () File ().
Print () .
Run Report ( ) Report ().
Print One Copy ( )
.
<Ctrl>+<P>.
Print ().

Name () .
Print range ( )
All () , ,
Pages () 'from (), to ().
Number of copies ( ), .
Properties ()
, , (. 11.20).

11.

129

. 11.19. Print

. 11.20.

, , Windows.

Options () Print (. . 11.19)


(. 11.21).
02

130

I. Visual FoxPro

. 11.21. Print Options

Print what ( )
(), . File
() .
:
Line numbers ( )
. ;
Page eject before ( ) ;
Page eject after ( )
;
Restore environment ( ) "" FoxPro.
, , Options (). ,
, .
Report and Label Print Options ( ) (. 11.22),
:
Scope ( ) ;
For () , . ,
.. ();
While () , , ,
.F. ().

11.

131

. 11.22. Report and Label Print Options


Report Wizard
Report Wizard ( )
,
Form Wizard ( ).

(. 11.23).

. 11.23. Wizard Selection

132

I. Visual FoxPro

, ,
:
One-to-Many Report Wizard
;
Report Wizard .


(. 11.24).

. 11.24.

(. 11.25) ,
. -]
. :
, , Grouping]
options ( ),
Grouping Intervals (. 11.26).
Grouping intervals ( )
:
Entire Field ;
1st Letter ;
2, 3, 4, 5 Initial Letters , . . .
Summary Options ( )
Summary Options,
(, 11.27).

11.

133

. 11.25.

. 11.26. Grouping Intervals

"" .
:
Field ;
^ Sum ;

134

I. Visual FoxP/qj

. 11.27. Summary Options

Avg ;
Count ;
Min ;
.
, ,
.
(. 11.28).

. 11.28.

(. 11.29) :
Portrait ;
Landscape .

11.

. 11.29.

. 11.30.

135

136

I. Visual FoxPro


Field Layout ( ).
(. 11.30)
.
, Preview ()
. 11.31.

. 11.31. ,

? ^
, KOTOJ
. ]
.
,
AutoReport Wizard Quik Report, -j
.


, , ,
, )
.

11.

137

,
click .
:
REPORT FORM () _ PRINTER

,
. ,
NOCONSOLE:
REPORT FORM C:\EXAMPLES\REPORTl PRINTER NOCONSOLE


:
REPORT FORM C:\EXAMPLES\REPORTl PREVIEW

:
REPORT FORM C:\EXAMPLES\REPORTl FILE TXT1.TXT ASCII

.
,
, ,
Norton Comander Windows (. 11.32).

. 11.32.

,
REPORT FORM C:\EXAMPLES\REPORTI PREVIEW, . 11.33.
,
.
.
REPORT FORM...
. ,
, , :
REPORT FORM REPORTI PREVIEW FOR D>O

138

I. Visual FoxPro

. 11.33.

12


, ,
.
, ,
Build () Project Manager.
,
.
Set Main ( )
Project ()
, . ,
, .
,
. Set Main
Formi (. 12.1).
Build Build Options
(. 12.2).
Action ()
, :
Rebuild Project ( )
,
;
Build Application ( )
.
, Visual FoxPro;
Build Executable ( )
"-"! , ,
, ,
,
- : .

140

I. Visual FoxPro

Visual
FoxPro (Vfp6renu.dll Vfp6r.dll);
Build COM DLL ( )
dll (Dynamic Link Library, ).
, Options Buil
Options, :
Recompile All Files ( )
,
;

. 12.1.

. 12.2. Build Options

12.

141

Display Errors ( ) ,
,
err.
ERR-
;
Run After Build ( )
,
;
Regenerate Component IDs (
) Auto
mation-, .
Build COM DLL Build Executable.
, ,
, Include
() Exclude ().
.
, , ,
"" Visual
FoxPro: " , ?! ,
, ?!"
, . , Visual FoxPro
Setup Wizard,
,
, ""
. .
,
. ,
Build Project Manager.
Save As ( ) ,
, .
,
"Build application completed",
Visual FoxPro (. 12.3).


, FoxPro,
Windows,
i n i t :
SCREEN.VISIBLE=.F.

142

I. Visual FoxPro

. 12.3. Windows

13


?
, , "" .
Visual FoxPro ,
- .
. ,
.
? ,
, , ,
. ,
, .
, Visual
FoxPro. ,
. ,
,
Database ( ).
:
CREATE DATABASE <_>

(Project Manager)
( New)
( Modify) Database
Designer.


(. 13.1)
Database Designer.
. 13.1.

144

I. Visual FoxPro

. 13.1. Database Designer


13.1. Database Designer

13.

145
13.1 ()

,
. .
( , )
, .
,
. .
, , :
? ,
. ,
. , ? -
: , . .
? (), "" ,
, : Database, Forms, Menus, Progs,
Images, Others . . , , ,
. , , ,
, ,
.
, .
New () Database Designer
Create () ,
Table Designer ( ) (. 13.2).
, - , ? ,
"" .
( Format Input mask)
.
( Caption).
BROWSE FoxPro
. ,
Caption.
Q .
Rule (),

146

I. Visual FoxPro

Expression Builder (
),
.
Message () ,
,
Rule.
, ,
(Default value).

. 13.2. Table Designer

Field comment ( )
. ,
. . Memo.


, . Visual
FoxPro , cdx
.
idx, ,
.

13.

147


, ,
FoxBase Visual FoxPro.

.
. ?
,

"", ,
!

.



idx,
:

;
,
;
""
.
?
. (Tag) .
, ,
TAG , .
TAGCOUNT ().
, CDX () MDX ().
Visual FoxPro :
Primary ().
( ),
;
Candidat ( ).
, Primary
;
Regular ( ).
;

I. Visual FoxPro

148

Unique ().
. Regular, [
FoxPro.
.
,
New Table ( ) Database Designer,
Countries.dbf , . 13.2.
13.2. Countries.dbf

Integer (4)

IDcountry

Character (10)

cCountry


(. 13.4).

Cities.dbf (. 13.3),

13.3. Cities.dbf

Integer (4)

Idcountry

Character (30)

CCity

Integer (4)

idcity

13.4. Streets.dbf

Integer (4)

Idcity

Character (10)

cStreet

Countries.dbf:
TAG: Idcountry
TAG: country

Primary
Regular

INDEX ON : idcountry
INDEX ON: country

Regular
Regular
Candidate

INDEX ON: Idcountry


INDEX ON: ccities
INDEX ON: idcity

Cities.dbf:
TAG: idcountry
TAG: ccities
TAG: idcity

Streets.dbf

13.

149

0 Streets.dbf:
TAG : i d c i t y
TAG: s t r e e t

Regular
Regular

INDEX ON : i d c i t y
INDEX ON: s t r e e t


Countries.dbf. (Table Designer)
Indexes (). Name ,
() . ,
Expression (),
.

(. 13.3).

. 13.3.

, ,
.


(Relation) .
"" .

150

I. Visual FoxPro

SET RELATION (
) Visual
FoxPro.
" ". ,
SET RELATION .

.
( ,
) ,
. , , !
: ,
, Primary candidate,
, .
:
(. 13.4).
. countries
. ,
.
|
( cities).
, . cities]
s t r e e t s .

. 13.4.

countries (parent table)


cities, , , (child
table) countries. c i t i e s
streets. ?
! , ,
, " " !
, , ? ,
, . -

13.

151

, "--" (one-tomany).
,
countries? " " ,
cities, ,
, countries.
idcountry. ,
"--".
, ?
"--".
,
, . "--"
,
, , .
"-".

Edit Relationship ( ) (. 13.5).
, ,
.

. 13.5. Edit Relationship

, . ,
! , idcountry countries (, ).
cities?
,
.
, -

,
.
,
.

152

I. Visual FoxPro

Visual FoxPro , Referential


Integrity Builder ( ).

Referential Integrity Builder


Referential Integrity Builder
, ,
Edit Referential Integrity (
).
(. 13.6).

. 13.6. Referential Integrity Builder

: Rules for Updating ( **


), Rules for Deleting ( ) Rules for Inserting (-y
).
, . ^
, *|
.
1
: Update (*]
), Delete (), Insert (). ^
.
(Update, Delete, Insert)
Ignore () , ,
.
,
.

13.

153

,
:
Cascade ( )

. ,
;
Restrict ()
,
;
Ignore ()
.
,
.
(Insert) :
Restrict ()
,
;
Ignore () ,
.
,
.
, c i t i e s

countries streets
cities.
,
, .
, ,
(. 13.7).

. 13.7.


.
, ,
?

154

I. Visual FoxPro

,
, .
, " " (primary key). ,
countries idcountry
. ,
.
,
,
:
. ?
,
: -, , -,
.

( ,
, , ...).
, ,,
.
!
:
: ?
.
:
, ;

- "",
"" .
:
- .
:
-!
;

"".
:

, ""
;
/

13.

155

- (
), ,
ALLTRIMO,
.
,
, .
:
? ,
. -
. :
- ()
;
- .
.
,
. , ,
.
click , 13.1.
13.1.
* ,
SELECT C o u n t r i e s
*, . RECCOUNT()

IF RECCOUNT()=0
* ,

APPEND BLANK
REPLACE Idcountry WITH 1
ELSE
* ,
GO RECCOUNTO
*
Lastid = Idcountry

APPEND BLANK
REPLACE Idcountry WITH Lastid +1
ENDIF

,
Go RECCOUNTO? GO BOTTOM! ,

156

I. Visual FoxPro

RECCOUNTO ,
GO BOTTOM SET ORDER TO (
) SET FILTER TO ( ,
). GO BOTTOM

- , "" ,
.
?
,
.
,
- , , .
,
.
:
, Myjast_id.dbf
iast_id (integer) ( 13.2).
13.2.
SELECT Countries
APPEND BLANK
REPLA Idcountry WITH my__last_id . Last_id+1
SELECT My_Last_Id
REPLA Last_Id WITH countries . Idcountry
SELECT Countries

, -|

.
, , , , " ]
",
, .
, , : )
"" My_iast_id, ,
, - .
""
.
, ?
" !"
, , COPY? ...

13.

157

, . , ,
.
Lastid.dbf
. 13.5.
13.5. Lastid.dbf

Integer (4)

lastid

Character (20)

alias

M y l a s t i d ( 13.3).
13.3. M y l a s t i d
FUNCTION M y l a s t i d
PARAMETER a l i a s
IF TYPE ("Myalias")#"C".OR.EMPTY("Myalias")
Myalias=ALIAS()
ENDIF
SELECT Lastid
LOCATE FOR Lastid.Alias=Myalias
IF FOUND()=.T.
REPLACE Lastid.Lastid WITH Lastid.Lastid+1
ELSE
APPEND BLANK
REPLA Lastid.Alias WITH Myalias,Lastid.Lastid WITH 1
ENDIF
SELECT SMyalias
RETURN Lastid.Lastid

! ,
. ,
,
.


,
, . . , .
:

, Stored Procedures ( )

158

I. Visual FoxPro

(. 13.8) New ().


,
, , Vis
ual FoxPro. (
.)

. 13.8. Stored Procedures

? )
, .
? ""
(
) ,
(. 3.9).

. 13.9.

13.

/59

,

, ...

, ,
().

INSERT ,
.
UPDATE , .
DELETE ,
.
Table Table Designer Triggers (),
: Insert Trigger, Update Trigger, Delete
Trigger. - ,
,
. ..
(True) - !
.
:
UPDATE ,
REPLACE, REPLACE FROM ARRAY, UPDATE-SQL, GATHER;
DELETE
/ DELETE;
INSRET BROWSE EDIT, a
APPEND FROM, APPEND FROM ARRAY, APPEND
BLANK,

IMPORT,

RECALL,

INSERT-SQL

.
:
,
.
"
DELETE TRIGGER.
? (. 13.10):
(Table Designer) countries
Default value ( ) :
m y l a s t i d ("countries")

160

I. Visual FoxPro

. 13.10.

. , ?,
!
, -1
cities. Default value
myiastid ("cities") ! lastid?
. 13.11.

. 13.11. l a s t i d


, ,
. -

13.

jgj

: - , ,
, , ,
? " " ,
. 13.6.
,
.
13.6. Names.dbf

Idcountry

(i4)

Idcity (i4)

Ccountry (c30)

Ccity (c30)

CFirstname (c30)

CSecondname (c30)

CLastname (c30)

DBirthday (d8)

CStreet (c30)

CHome (c5)

CRoom (c5)

GPhoto (g)

Csex (clO)

Darrdate (d8)

Ddepdate (d8)

Idroom (i4)

MDescr (Memo)

Depclients.dbf ,
- (. 13.7). ""
Clients.dbf.
13.7. Depclients.dbf

Idcountry (i4)

Ccountry ()

02

162

I. Visual FoxPro
13.7 ()

Ccity ()

Idcity (i4)

CFirstname ()

CSecondname ()

Lastname ()

DBirthday (d8)

CStreet ()

CHome (c5)

CRoom (c5)

GPhoto (g)

Csex (clO)

Darrdate (d8)

Ddepdate (d8)

Ndays

Ncost

Idroom (i4)

MDescr (Memo)

Rooms.dbf (. 13.8).
13.8. Rooms.dbf

Idroom (Integer)

( )

Idfloor (Integer)

Nprice (Numeric)

Nplaces (Numeric)

Ltv (Logical)

Lphone (Logical)

Floors.dbf, , |
(. 13.9).

13.

163
13.9. Floors.dbf

Idfloor
Cfloor

(Integer)
(Character)


(, . .)

Todayrecords.dbf
(. 13.10).
13.10. Todayrecords.dbf

Icounter

(i4)

DToday (d8)


, . 13.12.

. 13.12. Oldfox

I. Visual FoxPro

164

, ? , ...
names, Table Designer Table.
Insert trigger newrecordso . 13.13.

todayrecords .

. 13.13.


:
PROCEDURE Newrecords
SELECT Todayrecords
REPLACE Icounter WITH Icounter+1
REPLACE Dtoday WITH DATE()
SELECT Todayrecords
RETURN .T.

, : ,
todayrecords, icounte
, dtodae ,
DATE (). , ?

13.

165


Fields () Table Designer
Field validation ( ).
Rule (, ) ,
False ()
, Message ().
, dbirthday ( )
names ,
: , " ",
" "?!
(. 13.14): Fields, dbirthday
Rule dbirthday < DATE , Message
! ,
.

. 13.14.

( )
, .
, ?
, ? ,

166

I. Visual FoxPro

.
, ,
, BROWSE .
, .
: (
). Referential Integrity Builder
,
. ,
Visual FoxPro ,
, .

. "",
, ,
- . ,
,
"" . ,
.

1 4

.


, ,
.

ListBox
List .
, ,
, . .
RowSourceType ( ),
. 14.1.
14.1. RowSourceType

0 (None)

1 (Value)

2 (Alias)

3 (SQL-Statement)

SQL-

4 (Query)

5 (Array)

6 (Fields)

7 (Files)

8 (Structure)

9 (Popup)

168

I. Visual FoxPro


, ListBox,
Form Controls (. 14.1).

. 14.1. L i s t B o x

ListBox -|
(Builder),
.
(. 14.2).

. 14.2. List Items List Box Builder

14. .

169

List Items ( )
.
Fill the list with, :
Fields from a table or view ( );
Data entered by hand ( );
Values from an array ( ).
, Databases and
tables ( ) ,
.
, Available fields
( ).
Selected fields ( ).
, ,
List Items (. 14.3).

. 14.3. List Items


Values from an array

Array Name .
Range of the array
.
.
List Items Style () (. 14.4).
:
Three-dimensional ()
;
Plain () ;

170

I. Visual FoxPro

Yes, enable incremental searching (, ) ,



;
No, don't enable incremental searching (, )
, , .

. 14.4. Style List Box Builder

Rows to display ( )
.
, Layout (
) (. 14.5).

. 14.5. Layout List Box Builder

14. .

77

Adjust the width of the list box to


display all columns
.
,
"" .
, , Value ()
(. 14.6).

. 14.6. Value List Box Builder

, .
Properties () controisource.
"", .
Texti,
Keypress ( ),
. 14.7.
nKeycode , Keypress (
). <Enter> (13 ),
,
EMPTY , .
,
. . ,
,
<Enter>.
ListBox ,
.

172

I. Visual FoxPro

. 14.7.

(ComboBox)
Visual FoxPro,
.
, , ,
.
, ComboBox "" - ListBox .
, ,
(Builder)
.
,
.
Properties ().
, ListBox,
, <Delete>.
(. 14.8).
Properties Data
. RowSourceType ,
ListBox.
, 6.
RowSource , controisource ( ).
, , Layout.
. 14.9.

14. .

. 14.8.

173

. 14.9.

, Keypress
.
ComboBox ListBox.

,
, . (Data
Environment) . RowSourseType i
(Value, ). Controisourse None ().
RowSourse .

(OptionGroup)
,
.
, , ,
.
, , .
OptionGroup , . .
, .

OptionGroup, Form
Controls (. 14.10).

. 14.10. O p t i o n G r o u p

174

I. Visual FoxPro

,
. 14.11.

Help

OK

Cancel |

. 14.11. Buttons Option Group Builder

Number of buttons
.
Standard Graphical " "
. Standard () (.
. 14.10), Graphical () -|
.

(Caption) , , (Graphic).
Option Group Builder Layout
(),
(. 14.12):
Button layout (Vertical, Horizontal)
: ( ) ;
Spacing between buttons (in pixels)
;
Border style (Single, None) ,
(Single)
.
, Value ()
, . j
Properties controisource ( ).

14. .

175

. 14.12. Layout Option Group Builder

. 14.13. Value Option Group Builder

,
, ,
(. 14.14).

.
. 14.15
OptionGroup.
, , ( . .)
Properties (). ""

I. Visual FoxPro

176

,
"".
-.

. 14.14. O p t i o n G r o u p

( Standard)

. 14.15. O p t i o n G r o u p

( Graphical)

(Container)
. , ,
.
, , progressBar () .
, , . 14.16
. speciaiEffect
2 (), 1 (), (
).

. 14.16.

(Spinner)
. ,
,
().
, Properties () ^
:
1. controisource ( )
, , , . ,
Character!

14. .

177

2.
SpinnerHighValue SpinnerMinValue.

3.
,
. ,

KeyboardHighValue KeyboardMinValue.

4. , ,
I n c r e m e n t .

, , . ,
, !
,
, , ,
interactiveChange :
THISFORM.Commandl.WIDTH=THIS.VALUE
THISFORM.Commandl.REFRESH()

...
, !

(PageFrame)
,
-
.
,
, .
: Form
Controls, .

. ,
Properties (). , PageFrame
Edit
().
, ,
PageCount Properties (. 14.17).
, , Pagel,
Page2, Page3. , .
PageFramel

178

I. Visual FoxPro

Edit .
.
, caption (. 14.18).

. 14.17.

. 14.18.

. Edit ,
"" , ;
PageFrame.

14. .

179

"" .
Edit (
) .
, ,
, ,
(. 14.19).

. 14.19.

(CheckBox)
,
. , ?
, Logical,
"" (True) "" (False).
"", "",
' :
' ,
Form Controls.

180

I. Visual FoxPro

2. controisource ,
L o g i c a l

3. Caption.
, , . 14.20.

. 14.20. CheckBox

(Line)
, . , , . )
...|
, ? ,
, "" .
, :
. Paint ? -,
. , : |
Borderwdth;

"" B o r d e r C o l o r ;

, width |
Height . "
" ;
Borderstyle,
, . 14.2.
14.2. Borderstyle
Borderstyle

0 Transparent

1 - Solid (Default)

2 - Dash

3-Dot

4 Dash-Dot

5 - Dash-Dot-Dot

6 InsideSolid

14. .

181

. . ,
""
. ! , "
".
. click
14.1.
14.1. C l i c k
DECIA X ( 4 0 0 ) , Y ( 4 0 0 )
FOR I = 1 TO 360
FOR K=l TO 200
Z=6.6832*1/360
X ( I ) = 120+90*SIN(5*Z)*COS(THISFORM.TEXT1.VALUE*Z)
Y d ) = 120+90*COS(5*Z)*SIN(THISFORM.TEXT2.VALUE*Z)
THISFORM.CURRENTX=X(I)
THISFORM.CURRENTY=Y(I)
THISFORM.PRINT ( " ( ( * ) ) " )
ENDFOR
ENDFOR

, "" (. 14.21
14.22).

. 14.21.
( 60, 1)

. 14.22.
( 5, 1)

182

I. Visual FoxPro

(Shape)
,
:

BackColor;

BackStyle;

B o r d e r S t y l e ;

SpecialEffeet;
curvative ( 1 99);
Fiilcoior;
, Fiiistyie, )
(. 14.3).

14.3. Fiiistyie

F i i i s t y i e

0 - Solid

1 Transparent(Default)

2 Horizontal Line

3 Vertical line

4 Upward Diagonal

5 Downward Diagonal

6 Cross

(- )

7 Diagonal Cross

""

shape, , . 14.23.

. 14.23. Shape

14. .

183

(Image)
image
(. 14.24).
Picture, .
, ?
,
, stretch,
:
Clip () ;
Isometric (, )
image, ;
Strech (, )
image, .

. 14.24.

(Grid)
Grid .
Browse,
. , . ,
Grid, ,
.
.
Grid . , ,
.

184

/. Visual FoxPro


Builder (. 14.25). ,
(. 14.26).

. 14.25. G r i d

Grid Builder ( ) ,
. Grid Items () ,
. Databases
and tables ( ) oidFox,
.
,
AvaiJables fields ( ).
, Grid, Selectee
fields ( ).
, Style ()
(. 14.27).
. . npe . ,
Layout () (. 14.28).

14. .

185

. 14.26. Grid Builder

. 14.27. Grid Builder

. ,

.
Caption (). Control type (
) ,

.
.

186

I. Visual FoxPro

. 14.28. Grid Builder

, Relationship (
).

. 14.29. Grid Builder

()
(). , ,
Grid .
, ,
Grid (. 14.30).

14. .

187

. 14.30. G r i d

Keypress Text 11 14.2.


14.2.
LPARAMETERS N k e y c o d e , N s h i f t a l t c t r l
IF N k e y c o d e = 1 3 && ENTER
DO CASE
CASE EMPTY ( T h i s . V a l u e ) = . F .
SELECT C o u n t r i e s
APPEND BLANK
REPLACE C c o u n t r y WITH T h i s . V a l u e
This.Value=""
_SCREEN.ACTIVEFORM.REFRESH()
ENDCASE
ENDIF

Grid "",
. Grid, .
,
p
ageFramei, ,
(Edit).
Grid, (. 14.31)
, Properties ().
Layout Properties.
(Column) coiumncount.
-1 ( ).
,
, .

cities. ,
Data Properties RecordSource ( ) (. 14.32).

188

I. Visual FoxPro

. 14.31.
G r i d

. 14.32.
G r i d

, Grid , . e.j
.
Properties , Grid]
(. 14.33).

. 14.33. G r i d

Column . Coiumncount, -|
. :
controisource ;
Alignment ;
coiumnOrder ;
Backcolor .
, ,
, , . /

14. .

189

Header , .
, ,
, caption.
Text , ,
.
. Grid
, (spiner), (checkbox),
(EditBox), (ComboBox).
,
Grid, ,
. Keypress
, (. 14.2),
cities , ,
Replace.

Grid, .
. ,
. 14.34. ( )
, .

. 14.34.

I. Visual FoxPro

190

? ? .
-, , , ,
, ,

. Names.dbf
.
, ,
, ,
. (ReadOnly=.T.).

, ?
Grid.
AfterRowCoichange, , Grid. , Grid ( )
:
THISFORM.REFRESH()

&& Grid
&& .

Grid ():
THISFORM.PAGEFRAME1.PAGE1.5.REFRESH()


Text5.

Grid:
THISFORM.PAGEFRAME1.PAGE1.TEXT6.REFRESH()

,
. Code
() Programs (). New ().
14.3.
14.3.
SET TALK OFF
SET ECHO OFF
SET DATE TO GERMAN
SET PATH TO C:\OLDFOX\
OPEN DATABASE Oldfox
USE Names IN 1 EXCLUSIVE
USE Depclients IN 2 EXCLUSIVE
DO FORM Main && Main -

14. .

191

. ,

. ,
<Enter>. , Grid
,
. , .
, ,
, Grid.
- names, ",
, " . .?

click 14.4.
14.4. C l i c k
SELECT names && names.dbf
SCATTER MEMVAR BLANK &&
THISFORM.REFRESH() &&

. ( 14.5).
14.5. c l i c k
SELE Names
APPEND BLANK
GATHER MEMVAR
REPLACE I d c o u n t r y WITH C o u n t r i e s . I d c o u n t r y ;
Ccountry WITH C o u n t r i e s . C c o u n t r y
REPLACE C s t r e e t WITH S t r e e t s . S t r e e t
REPLACE I d c i t y WITH C i t i e s . I d c i t y , C c i t y WITH C i t i e s . C c i t y
REPLACE Idrooms WITH Rooms.Idroom
I
E THISFORM.Pageframel.Pagel.Optiongroupl.Optionl.Value=l
REPLACE Csex WITH "M"
ELSE
UEPLACE Csex WITH ""
ENDIF

, -
names.
. , 14.6.

192

I. Visual FoxPro

14.6.
IF EMPTY(THISFORM.Pageframel.Pagel.Textl.Value)
-> = MESSAGEBOX(" ", "...")
ELSE
...
< >...
END IF

, ]
?
.
4
, (. 14.35).

. 14.35.

, <
.
: , |
, , . , 6yJ
. 14.36.
/

14. .

193

. 14.36.


(Depclients.dbf)?
.
,
names ( )
depciients ( 14.7).
14.7. d e p c i i e n t s
( )
LOCAL Nroomprice
* rooms
SEL Rooms
* rooms ,
LOC FOR Idroom=Names.Idrooms
*
Nroomprice=Rooms .Nprice
* names
SELECT Names

194

I. Visual FoxPro

* ,

SCATTER MEMVAR MEMO


*
DELETE
* depclients
SELECT Depclients
*
APPEND BLANK
* names
GATHER MEMVAR MEMO
*
REPLACE Ddepdate WITH DATE()
*
REPLACE Ndays WITH Ddepdate-Darrdate
*
REPLACE Ncost WITH Ndays*Nroomprice
* names
SELECT Names
*
PACK
*
THISFORM.REFRESH()


( )
.
, ""
, , - .
? (
15 . ) ,
! , .

( 14.8).
%

14.8. d e p c l i e n t s
SELECT Names
SCAN FOR Ddeptdate=DATE ()
LOCAL Nroomprice
SELECT Rooms
LOCATE FOR Idroom=Names.Idrooms
Nroomprice=Rooms.Nprice

14. .

195

SELECT Names
SCATTER MEMVAR MEMO
DELETE
SELECT Depclients
APPEND BLANK
GATHER MEMVAR MEMO
REPLACE Ndays WITH Ddepdate-Darrdate
REPLACE Ncost WITH Ndays*Nroomprice
SELECT Names
ENDSCAN
PACK
THISFORM.REFRESH ()

i n i t ,
, .
(. 14.37).

. 14.37.

? Grid - "? PACK. ,

196

I. Visual FoxPro

, !
, -3
Grid. , :
""
Grid, ( 14.9).
14.9. G r i d

SELECT Names
THISFORM.Pageframel.Page2.Gridl.Recordsource=.NULL.
PACK
THISFORM.Pageframel.Page2.Gridl.Recordsource="NAMES"

: Gril
,
.
, ,
. ,
Grid, .

15

,

, ? , ,
, , . ?
, , . , . ,

,
. , ,
.
, .
, ,
, .
, Visual FoxPro 32 627 ,

. . ,
. ,
(private data session),
32 627 !
( ) ,
USE. , : USE ROOMS. rooms
. USE FLOORS
floors, a rooms
. ? USE
,
:
USE ROOMS IN 1
USE FLOORS IN 2

.
SELECT :

198

I. Visual FoxPro

SELECT 2
BROWSE

,
(alias) . ,
.
SELECT FLOORS
BROWSE

.
, , ,
:
OPEN DATABASE OLDFOX
USE ROOMS IN 1
USE FLOORS IN 2

,
, ,
.
, :
OPEN DATABASE C:\OLDFOX\OLDFOX
USE C:\OLDFOX\ROOMS EXCLUSIVE

, :
SET PATH TO C:\OLDFOX

LOCATE.
,
. ,
, LOCATE

, , .
.
, ,
. , click :
SELECT NAMES
LOCATE FOR CSECONDNAME=THISFORM.PAGEFRAME1.PAGE1.TEXT1.VALUE
THISFORM.REFRESH()

15. ,

199

, ,
. ,
, , , ?
, , LOCATE .
LOCATE
( , )
,
. : LOCATE
CONTINUE,
, .
Rightciick ( )
. , LOCATE
,
.

SEEK.

LOCATE SEEK,
.
, "" , . . .
SET ORDER TO,
. rooms,
202.
SELECT ROOMS
SET ORDER TO IDROOM
SEEK 202

. , ,

. character,
.

SET FILTER TO.



,
, SET FILTER TO.
,
, ,

200

I. Visual FoxPro

"" LOCATE CONTINUE. SET FILTER , :


SELECT NAMES
SET FILTER TO CFIRSTNAME="MB"
BROWSE

SET FILTER TO ,
. : ,
" " . ,
!
. , ! ? :
SELECT NAMES
SET FILTER TO UPPER()="".AND.DBIRTHDAY<=CTOD("01.01.1986");
.AND.DBIRTHDAY>=CTOD("01.01.1983")
BROWSE

, . 15.1.

. 15.1. SET FILTER TO


, :
.
, . .
.
. ,
. .
, ? ,
.
, . . . , -

15. ,

201

, ,
. , , .
, SORT:
USE NAMES
SORT TO NEWNAMES ON CFIRSTNAME


names ( newnames),
cfirstname.
.
. , .
, names
, .
,
, :
USE NAMES
INDEX ON ALLTRIM (CFIRSTNAME) TAG FIRSTN

SET ORDER TO FIRSTN ,


(. J 5.2).

. 15.2.

, ,
?
:
INDEX ON ALLTR(CFIRSTNAME)+ALLTR(CSECONDNAME) TAG FIRSTN

202

I. Visual FoxPro

, , ? ,
,
ADDITIVE:
USE NAMES
INDEX ON ALLTRIM (CFIRSTNAME) TAG FIRSTN ADDITIVE

SET ORDER TO

16

: " ?" : " ".


, ? ,
,
. .

1 26 ?

?
,
?
?
, , . : "
? , ,
!" ,
. , SET FILTER
, LOCATE, SCAN . ., .
, .
? ,
( , , ). ,
,
"", (Query).

,
.

(Query Designer)
Visual FoxPro
Query Designer. "" ,
: .

204

I. Visual FoxPro

File | New ( | ). New


Query () New file ( ) (. 16.1).

. 16.1. New

. 16.2.
Add Table or View

, , : "
?" (. 16.2).
, cities streets, ,
Close (),
(. 16.3).
Query Designer
(. 16.4), . 16.1.
16.1. Query Designer

Add Table ( )

Remove Table ( )

Add Join ( )

16.

205

16.1

()

View SQL ( SQL)

Maximize The T^ble View


( )

Query Destination ( )

SQL-,


,
,

. 16.3. , Fields

. 16.4. Query Designer

, . 16.3
, ,
. , -

206

I. Visual FoxPro

idcity, Join ()
(. 16.5).

. 16.5. , Join

, , ,
. ,
, , .
,
.
,
,
. Fields () (.
. 16.3). : Availabe fields (
) Selected fields ( ). Selected fields
. ,
Add ().
.
Add All ( ). -
Remove () Remove All ( ).
.
Filter ()
(. 16.6).

16.

207

. 16.6. , Filter

Field Name ( )
, , Criteria (
) :
= , ;
Like ( ) ,
Like, , ;
= = ( );
< > " " " ";
>= <= " " " ";
Between () ,
.
Not (He) .
, ""? ,
"".

"". ,
, .
Case ()
.
Order By (
) (. 16.7).
, , .

208

I. Visual FoxPrci\

: Selected fields ( ) Ordering


criteria ( ). Ordering criteria
, Fields.

Order options: Ascending , Descending .

. 16.7. , Order By

. 16.8.

16.

209

" "
, .
:
1. Run Query Query ().
2. Run .
3. DO QUERY <_>.

,
(. 16.8).
: "
?" ,
, , .


: , ,
, .
, (. 16.9 16.10).

. 16.9. Cities

. 16.10. Streets

, cities (,
),
s t r e e t s . s t r e e t s , , (. ),

210

I. Visual FoxPro

.
,
" ".
Join
(Inner Join).
,
(. 16.11).

. 16.11.

, ,
, . , ? ,

idcity.
(Left Outer
Join).
,
(. 16.12).
(Right Outer Join),

,
(. 16.13).
, (Full Outer Join),

(. 16.14).

16.

. 16.12.

211

. 16.13.

. 16.14.

.

.
,
( . F . ) , (..).

212

I. Visual FoxPro

CTODO .
, 01/01/2001.



,
. : ,
,
depciients. ,
,
"" , , 36 500 .
? , . :
,
. ,
(names)
?
, , .

(names),
(rooms), (countries). (
,
names.)
,
. ,
Fields Name Fields Ex-
pression.
(Expression Builder) " "
Visual FoxPro (. 16.15).
, . ,
,
.
.
: From table (
), "" ,
names.
Fields () .
Expression (),
,
. - , ,

16.

213

Functions ().
, Verify, , .
, Selected fields
.
,
(. 16.16).

. 16.15. Expression Builder

. 16.16. ,

214

I. Visual FoxPro

. 16.17.

Filter, ]
(. 6.17).
(Logical)
AND ( ).
: ,
36 500, ,
. . 16.18.
, ,
AND OR? . 16.19.
, ,
, , . ,
, ( 36 500),
, "" . ?
, OR : OR .
, , .

. ? . ,
""? ?
, . , . pa . ""? .
? . .

16.

215

, , ,
.
, , . ,
AND (. 16.19).

. 16.18. AND

. 16.19. OR

216

I. Visual FoxPro

. 16.19. AND

? .
,
.
OR.
?
. ,
? , SCAN, REPLACE
... -
.
, ,
.


, ,
, Query Destination (
) (. 16.20).
(. 16.2) BROWSE
.
, .

16.

217

16.2.

BROWSE ( Browse)

BROWSE

CURSOR ( )

TABLE ()

GRAPH ()

SCREEN ()

REPORT ()

LABEL ()

. 16.20. Query Destination

. Visual FoxPro
,
. ,
, , . ""
, Visual FoxPro . ,
? ,
CURSOR (Current Set Of Records,
).

. ,
, , .

218

I. Visual FoxPro


Visual FoxPro.

.
"" Graph Wizard (
). ,
, Graph
Query Destination.

. 16.21.

,
(. 16.21).
,
.
(. 16.22).
, (. 16.23),
(Type a title for your graph),
(Show null values) (Add a legend to
the graph). Preview,
(. 16.24).

. , -

16.

219

. ,
. ,
( , ,
(. . 16.24)).

. 16.22.

. 16.23.

220

I. Visual FoxPro

. 16.24.


Visual FoxPro, , , -|
" " (. 16.25).

. 16.25. Query Destination, SCREEN

-j
Secondary output ( ):

16.

221

None ;
To printer , ;
text file .
,
, .
:
Suppress column headings ;
Pause between screens
.
, ? ,
, , :
, !


(. 16.26).

. 16.26. Query Destination, REPORT

,
, .
Open

222

I. Visual FoxPro

Report ( ). ,
. Open .

Report Wizard ( ).
:
Page preview ;
Console on /
;
Eject page before report .
(. ).

( )
, , ,
, ,
. . , - . ,
. Query Destination , (. 16.27).

. 16.27. Query Destination, LABEL


, ,
Label Wizard ( ""

16.

223

).
(. 16.28).

. 16.28.

. 16.29.

(. 16.29)
. Avery () -

22

I. Visual FoxPro

, Dimensions ()
. ,
, Columns (). ,
, Metric (
).
New Label ( ),
(. 16.30).

. 16.30. Custom Labels

New () o , --]
(. 16.31).

Edit () Custom Labels (
).
(. 16.32) Available fields ( ) Selected fields ( ). ,
, .
, . Space (
),
(
<Enter>). , Font
().
, ,
(. 16.33).
Label Designer (
) (. 16.34).

16.

. 16.31.

. 16.32.

I002

225

226

I. Visual FoxPro

. 16.33.

. 16.34.

16.

227

,
. IIF.
:
IIF(Names.cSex= " " ,

"",

"")

. . ()
.
. ,
,
IIF.
(. 16.35),

HTML.

. 16.35.

HTML
Visual FoxPro ,
.
HTML, ()
(CURSOR BROWSE). File
() Save As HTML ( HTML) (. 16.36).

228

I. Visual FoxPro

. 16.36. Save As HTML

:
Save file for later use
;
Save and edit file
;
Save file and view in web browser
.
Save As HTML (
HTML)
HTML- (. 16.37).

. 16.37.


Web- (. 16.38).
,
Miscellaneous (),

(. 16.39).

16.

. 16.38, Opera

. 16.39. , M i s c e l l a n e o u s

229

230

I. Visual FoxPro

No duplicates ( ) ,
, .
Cross tabulate ( )
. Number of
records ( )
. All ()
. e .

SQL- SELECT
""?
SQL- SELECT? ,
. : " ?
Query Designer, , ..."
" " , ... -
SQL,
Query Designer (. 16.40).

. 16.40. SQL- SELECT

SQL- SELECT. -)
? , . , , .
, SQL
.

16.

231

? , SQL- SELECT
,
, .
"" .
:
USE C:\OLDFOX\OLDFOX
SELECT * FROM OLDFOX!NAMES


names, oidfox,
Browse. BROWSE?
BROWSE .
, :
SELECT Cfirstname, Csecondname, Dbirthday FROM OLDFOX!NAMES

SELECT,
.
, ( ),

.
, . . , . . 16.40
, . ,
, "" . ,
, , , .
,
: , LOCATE ,
?
SQL-:
SELECT * FROM OLDFOX!NAMES WHERE Cfirstname="MB"


SQL: - , LOCATE.
, WHERE , FOR
.
, SQL- SELECT ORDER BY (
SET ORDER TO <_>)
SELECT * FROM OLDFOX! NAMES WHERE Cfirstname="MB";
ORDER BY Cfirstname


(. 16.41)?

232

I. Visual FoxPro

SELECT Cfirstname AS , Csecondname AS ;


DBIRTHDAY AS _;
YEAR (DATE ()) -YEAR(Dbirthday) AS ;
FROM OLDFOX! NAMES WHERE Csex=")K".AND. YEAR(Dbirthday) <1986;
.AND. YEAR (Dbirthday) >=1983 ORDER BY Cfirstname

. 16.41.


, . AS
, .
. YEAR , Date.
, . (
, .) , YEARO,
.
,
BETWEEN, :
SELECT CFIRSTNAME AS , CSECONDNAME AS ;
DBIRTHDAY AS _ ;
YEAR(DATE(>) -YEAR(DBIRTHDAY) AS ;
FROM OLDFOX!NAMES WHERE CSEX=">K";
.AND.YEAR(DBIRTHDAY) BETWEEN 1983 AND 1986 ORDER BY CFIRSTNAME

|
IN. , , -|
, -. IN
:
SELECT * FROM OLDFOX!NAMES;
WHERE ="-";
OR CCITY="MocKBa";
OR CCITY=""

IN:
SELECT * FROM OLDFOX!NAMES;
WHERE CCITY IN ("","","-")

16.

233

,
SQL- DISCTINCT (
No duplicates Miscellaneous). ,
names,
:
SELECT CCITYAS FROM OLDFOX! NAMES

. 16.42.

. 16.42.
names

. 16.43.
DISCTINCT

, . . 16.43

SELECT DISCTINCT CCITY AS FROM OLDFOX!NAMES

DISCTINCT
.

SQL-,
. , ,
. , ,
, I

234

I. Visual FoxPro

, .
, , SQL
:
SELECT Cfirstname AS ;
Csecondname AS ;
Ncost AS ;
FROM OLDFOX! DEPCLIENTS;
WHERE Ncost > (SELECT MAX (Ncost) * 0,5

FROM DEPCLIENTS)

. 16.44.

. 16.44. 1


WHERE NCOST < (SELECT MAX (NCOST) * 0,5

FROM DEPCLIENTS)

. 16.45.
(), . SQL-
(. 16.3).
SQL-,

Math () Function
() (Expression Builder).

16.

235

16.3. , SQL-

COUNT()

SUM()

AVG()

MIN()

COUNT(DISTINCT)

SUM(DISTINCT)

AVG(DISTINCT)

. 16.45. 2


:
SELECT (DATE()-NAMES.DARRDATE)*ROOMS.NPRICE; NAMES.CFIRSTNAME;
FROM OLDFOX!COUNTRIES INNER JOIN OLDFOX!NAMES;
INNER JOIN OLDFOX!ROOMS;
ON ROOMS.IDROOM = NAMES.IDROOMS;
ON COUNTRIES.IDCOUNTRY = NAMES.IDCOUNTRY;

236

I. Visual FoxPro

WHERE (DATE()-NAMES.DARRDATE)*ROOMS.NPRICE > 36500;


AND COUNTRIES.CCOUNTRY = ""

,
:
INNER JOIN OLDFOX'NAMES;
INNER JOIN OLDFOX!ROOMS;
ON ROOMS.IDROOM = NAMES.IDROOMS;
ON COUNTRIES.IDCOUNTRY - NAMES.IDCOUNTRY;

HAVING
HAVING , WHERE,
WHERE ,
, HAVING "" . , :
SELECT CCITY FROM OLDFOX!NAMES;
GROUP BY CCITY;
HAVING COUNT (*)>2


SQL- SELECT

.
, :
nMYCOST=12000
SELECT CFIRSTNAME, CSECONDNAME, NCOST FROM OLDFOXiDECLIENTS;
WHERE NCOST=NMYCOST

, ,
. ,
,
.
? :
prg
DO <__>

click - .
SQL- SELECT .
Browse. " " ,
INTO:

16.

237

nMYCOST=12000
SELECT CFIRSTNAME, CSECONDNAME, NCOST FROM OLDFOX!DECLIENTS;
WHERE NCOST=NMYCOST;
INTO CURSOR MYQWERY

MYQWERY.
INTO . 16.4.
16.4. INTO

INTO ARRAY <_>

INTO CURSOR <_>

INTO TABLE <_

TO PRINTER

TO SCREEN

TO FILE <_>



. ,

(
), ,
!
""
(. 16.46).
, , . ,
, , .
,

. ?
(Cross-Tab) ,
,
,
.

:

238

I. Visual FoxP,

SELECT DEPCLIENTS.CCITY, DEPCLIENTS.NCOST, DEPCLIENTS.IDROOMS;


FROM OLDFOX! C I T I E S , OLDFOX!DEPCLIENTS;
INTO TABLE QUERY2.DBF

. 16.46.

Cross-Tab Wizard SQL.


, :
1. New
Query ( ) (. 16.47).
2. Query Wizard, .
(. 16.48).

. 16.47. New Query

. 16.48. Wizard Selection

16.

239

,
(. 16.49).

. 16.49.

,
(. 16.50).

. 16.50.

240

I. Visual FoxPro

,
( ).

. 16.51,

(. 16.51)
(. 16.5).
16.5.

Sum

Count

Average

Max

Min


(. 16.6).
16.6.

Sum of data

16.

241
16.6 ()

Number of cells containing data

Percentage of the table total

None

. 16.52.

(. 16.52) ,
. 16.7.
16.7.

Save cross-tab query

Save and run cross-tab query

Save cross-tab query and modify


in the Query Designer

242

I. Visual FoxPro

Display null values , ,


.
, , . 16.53.

. 16.53.

, SQL.

"" SQL-, Visual FoxPro (. 16.54).

. 16.54. SQL-

16.

243


.
,
: DO (_GENXTAB) WITH. ..
_GENXTAB, Visual FoxPro.
. 16.8.
16.8. , _GENXTAB

Xtab.dbf

..

..

..

.F.

: 0 ,
1 , 3

,
.

SQL-

qpr,
:
DO < >.qpr

17

()
, ? , . ?
, .
qpr, .
.
, .
-)
, , .
.


:
File J New | View ( | )
);
: Data (), Local Views
( );
Command (): Create View (
).
, ,
New Local View ( ) (. 17.1).

17. ()

245

. 17.1. New Local View

,
, , .
, (. 17.2).

. 17.2. View Designer

(
Update Criteria),
, .
: ,
, ,
.
:
Floors.dbf, Rooms.dbf Names.dbf. Add Table

246

I. Visual FoxPro

( ), View Designer
( ),
(. 17.3).

. 17.3.

, "" . ,
. ,
, ( ).
, , :
, FoxPro. :
rooms.nprice*(date() - names.arrdate)

.
,
Join () (. 17.4).

Filter () (. 17.5).
"" Order By (
) (. 17.6).
" " (. 17.7).

17. ()

. 17.4.

17.5.

247

248

I. Visual FoxPro

. 17.6.

. 17.7.

, ,
,
, . . ,

17. ()

249


: USE, BROWSE . .
,
- .
Update Criteria (
), ,
() (. 17.8).

. 17.8. Update Criteria

, , ,
, . ,
,
Tables ().
( , ,
) Field name
( ). (),
, , .
, , ,
, .
Reset Key ( )
.
Update All ( ) ,
. ,

250

I. Visual FoxPro

, ,
Send SQL updates ( ).
, . ,
, . 17.1.
17.1. Update Criteria

Key fields only


( )

,
,

Key and updatable fields


( )

,
,

Key and modified fields


( )

,
,

Key and timestamp


( )


. ,

.

. 17.9.

17. ()

251

,
:
(SQL DELETE then INSERT),
(SQL UPDATE).
, ,
: ,
?
. 17.9.

names, . 17.10.

. 17.10.

,
.


,
. View
Parameters ( ) Query () (. 17.11).
,
.
Filter ()
(. 17.12).

252

I. Visual FoxPro

. 17.11.

. 17.12.

Example ()
, napa.
, ,
.
:
1. (. 17.13).
2. (. 17.14).
,
, -

17. ()

253

. .! .
,
.
. ! ,
.

. 17.13.

. 17.14.

, ,
Memo. - , (. )
. , .



,
. , ,

254

I. Visual FoxPro

. ,
, ,

"--". (One-ToMany Report Wizard),
.
. .
, , -|
Views ( ) (. 17.15).

. 17.15. ,


Report () (. 17.16).
Data Grouping ( ) (. 17.17).
,
, - (
Visual FoxPro, ).
, . ,
(
Group Footer), , Report | Title | Summary.
, . 17.18.
, (. 17.19).

17.

()

. 17.16.

. 17.17. Data Grouping

255

256

I. Visual FoxPro

. 17.18.

. 17.19.

, ?
,
. , .

18

OLE-
, : "
?!"
OLE-, , Visual
FoxPro, .
, "" OLE-
- Windows ( Visual FoxPro),
, "" ,
Visual FoxPro. Visual FoxPro OLE, .
,
, .
Visual FoxPro .
, ,
. , ,
,
.

,
.
.
, , -,
, -.
OLE-? ,
,
, Windows,
OLE. , Word
Excel. . ,
. OLE-
.
Old Fox Hotel.

258

I. Visual FoxP.

OLE- General .
, ,
gen Gen. ?
, gen, OLE, Gen (. 18.1).

. 18.1. , G e n e r a l

General
gen,
(. 18.2).
Insert Object (
) Edit (),
. 18.3.
, :
.

, ,
. ,
.
,

OLE-.
, .

18. OLE-

. 18.2. G e n e r a l

. 18.3.

259

260

I. Visual FoxPro

OLE-
, General,
Browse.
gen. Paintbrush
Picture ( Paint) Insert Object ( ).
,
. ,
(. 18.4).

. 18.4.

,
, Object Editj
(. 18.5).
, : . ? , ,
- ( Paint) |
Visual FoxPro, -.
, , ( )?

18. OLE-

261


.
. 18.6.

. 18.5.

. 18.6.

262

I. Visual FoxPro

. 18.7.

18. OLE-

263


, ,
(. 18.7).
. 18.8.

OLE-
Visual FoxPro
, .
OLE- ,
Insert Object Paste Special ( ).
, , .
-
.
. General
Paste Special ( ) (. 18.9).

. 18.9.


General. -
Visual FoxPro.
Insert Object
(. 18.10).
,
(. 18.11).
, , . 18.1.

264

I. Visual FoxPro

. 18.10.

. 18.11.

18.1.

. , ,

18. OLE-

265

OLE-
, , . Edit
() Clear () , " ".

GETDIR(), GETFILE()
APPEND GENERAL
:
? , :
Insert Object, Paste Special . . ,
""
Visual FoxPro. ,
. , ,
OLE. ,
.
:
(. 18.12).

. 18.12.

click:
PUBLIC Myfile
GETDIR ()
Myfile=GETFILE ("BMP")

:
APPEND GENERAL Gphoto FROM SMyfile

. ,
. :
Myfile
. "" GetDirO,
(. 18.13).

266

I. Visual FoxPro

. 18.13. Select Directory

GetFileO,
.
, .
bmp,
(. 18.14).

. 18.14. Open

18. OLE-

267

,
.
,
:
APPEND GENERAL Gphoto FROM SMyfile

APPEND GENERAL General,


FROM , .
, ,
(&),
&Myfile.

, , ""
, , , " ".

19

ActiveX

,
Visual FoxPro. , ,
, Visual FoxPro. ,
,
"", ... , ?!
,
, Visual FoxPro,
. ,
Visual FoxPro, ,
. Visual FoxPro
Visual FoxPro Foundation Classes ( Visual
FoxPro). ?
, ,
.


,
Form Controls,
View Classes ( ) (. 19.1).
, : Add
(), Standard (), ActiveX Controls (
ActiveX).

. 1 9 . 1 . !

19. ActiveX

269

Standard (),
Form Controls ,
. ,
Add ().
Open (),
. vex.
classes, ""
Visual FoxPro (. 19.2).

. 19.2. Open.

buttons.vcx. ,
.
View Classes ( )
Form Controls ( )
,
(. 19.3).

. 19.3. Form Controls

I. Visual FoxPro

270

,
buttons.vcx . 19.1.
19.1. buttons.vcx

mailbtn

vcr
cmdok
cradhelp


Help
Cancel

cmdcancel

,
(. 19.4).

. 19.4.

, , ,
" ". , .
,
. !

, ""
(Foundation Classes).
,
Tools | Component Gallery (. 19.5).

Add To Form

19. ActiveX

271

( ). ""
. '

Class Browser ( -

. 19.5. Component Gallery

. 19.6. Class Browser

272

I. Visual FoxPro

) (. 19.6). ,
Tools ().
,
.

ActiveX
ActiveX , . ,
Visual FoxPro. Visual
FoxPro , FoxPro,
, Visual C++. , ] ,
, . ActiveX, ,
...
, , .
ActiveX ActiveX Controls
( ActiveX) View Classes
( ) Form Controls ( ),
. 19.7.

. 19.7.

, ,
,
Options () Tools ()
. , . 19.8.
Selected
ActiveX. ,
, -, Add (
).
Selected .

Form Controls. -

19. ActiveX

273

ActiveX.
(. 19.9):
;
Word;
Power Point;
Microsoft Slider Control;
Microsoft ProgressBar Control;
Calendar Control.

. 19.8. Options. Controls

. 19.9. Form Controls

.
(. 19.10).
,
, Object,

274

I. Visual FoxPro

. 19.10. ActiveX

- (
Paint), .
, Visual FoxPro -|
Paint,
.

(. 19.11, 19.12).
ActiveX.
ProgressBar . , ,
- .
,
, .
:
SELECT Table1
FOR 1=1 10000
APPEND BLANK
REPLACE Nnumeric WITH RECNO()
ENDFOR

19. ActiveX

. 19.11. Word

. 19.12. PowerPoint

275

276

I. Visual FoxPro


. ActiveX
(. 19.13).

. 19.13. P r o g r e s s B a r

,
,
(. 19.14, 19.15).

. 19.14. P r o g r e s s B a r

ProgressBar
, : , |
. .
click :
SELE TABLE1
THISFORM.OLEC0NTROL1.MAX=RECCOUNT()
SCAN
REPLA NNUMERIC WITH NNUMERIC+1
THISFORM.OLECONTROL1.VALUE=RECNO()
ENDSCAN

, oiecontroii ,
ProgressBar. , .

19. ActiveX

. 19.15.
P r o g r e s s B a r

277

. 19.16.

Slider

ActiveX, slider,
. , . . ,
, .
,
slider Grid (. 19.16).
ActiveX-:
mit :
THIS.MIN-1
THIS.MAX=RECCOUNT()
CHANGE:
MYREC=THIS.VALUE
SELE TABLE1
GO MYREC
THISFORM.REFRESH()

(. 19.17).
() slider

Grid (. 19.18).
change :
:
THIS FORM.GRIDl.BACKCOLOR=RGB(THIS.VALUE,THIS.VALUE,THIS.VALUE)

278

I. Visual FoxPro

:
THISFORM.GRID1.FORECOLOR=RGB(THIS.VALUE,THIS.VALUE, THIS.VALUE)

:
THISFORM.GRIDl.FONTSIZE=THIS.VALUE

,
=255, =70, Min=8.

. 19.17. S l i d e r

. 19.18. ActiveX

19. ActiveX

279


ActiveX
.
. ,
names,
ActiveX (. 19.19).

. 19.19.

,
.

20



, Word Excel.

, . I

Excel
Visual FoxPro Excel
Export () File ()
(. 20.1).

. 20.1.

Export
() (. 20.2).

20.

281

. 20.2. Export

( ) ,
.
. . 20.2.
() ,
"" .
, ,
Save As ( ) (. 20.3).

. 20.3. Save As

, From () ,
.
, ... -
. "" ,
Options () (. 20.4).

282

I. Visual FoxPro

. 20.4. Export Options

,
. Scope
() ,
(. 20.1).
20.1. Scope

()

Next ()

Record ()

...

Rest ()

For () While ()
Expression Builder ( ), .
Fields () ,
(. 20.5).

. 20.5. Field Picker

20.

283

Field Picker .
, , . Move
(). , "" ,
, (. 20.6).

. 20.6. Excel

, , ...
-, , ?
!
1. names.dbf (. 20.7).
2. click ( 20.1).
20.1.
IF

EMPTY(Thisform.Text1.Value)

=MESSAGEBOX(" ","")
ELSE
SELE Names

284

I. Visual FoxPro

My_File=ALLTR(Thisform.Textl.Value)
EXPORT TO &My_File TYPE XLS
ENDIF

. 20.7.

. ? ,
.
. ,
?
(, , . .), ! , , ...
Excel .
"" ? , . 20.8.
"",
OLE.
20.2.
20.2. ("" )
Omyexcelreport=CREATEOBJECT("EXCEL.SHEET";
Qmyexcelreport.Application.Visible=.T.
Omyexcelreport=Omyexcelreport.Sheets[1]
SELE Names
WITH Omyexcelreport
WITH .Range("Al")
.Value=" "

20.

285

WITH .Font
.Bold-..
.Size=14
ENDWITH
ENDWITH
ENDWITH
Nrow=5
SCAN
Nrow=Nrow+l
Qmyexcelreport.Cells(Nrow,1).Value=ALLTR(Names.Cfirstname)+;
" "+ALLTR(Names.Csecondname);
+" "+ALLTR(Clastname)
WITH Omyexcelreport
WITH .Cells(Nrow,1)
WITH .Font
IF Names.Csex="M"
.Bold-.T.
.Colorindex=4
ELSE
.Bold=.F.
.Colorindex=5
ENDIF
ENDWITH
ENDWITH
ENDWITH
ENDSCAN
Qmyexcelreport.Visible=.T.
RELEASE Omyexcelreport

. " "
.
Excel, -
(. 20.9).
, ""
( 20.3).
20.3. (" " )
Oexcel=CREATEOBJECT("EXCEL.APPLICATION")
Oexcel.Workbooks.Open("C:\OLDFOX\MYREPORT")
WITH Oexcel
C e l l s (2, ID .Value=DTOC(DATE() )
ENDWITH

286

I. Visual FoxPro

SELE Names
Nrow=ll
SCAN
Nrow=Nrow+l
Oexcel.Cells(Nrow,1).Value=ALLTR(Names.Cfirstname)+"
"+ALLTR (Names. Csecondname) ;
+" "+ALLTR(Names.Clastname)
Oexcel.Cells(Nrow,2).Value=Names.Idrooms
Oexcel.Cells(Nrow,3).Value=DTOC(Names.Darrdate)
Oexcel.Cells(Nrow,4).Value=DTOC(Names.Ddepdate)
ENDSCAN
Oexcel.Visible=.T.

. 20.10.

. 20.8. ""

, Visual FoxPro
Excel.
, Visual
FoxPro . Excel.

20.

. 20.9.

. 20.10. Excel

287

288

I. Visual FoxPro

, ,
. ( , my_excei,
.)
Import () File ().
Import () (. 20.11).

. 20.11. Import

( ) , !
, From () ]
. () -j
Visual FoxPro.
(Import Wizard), -|
(. 20.12).

. 20.12.

20.

289


File Type ( ), Source File, ,
(Destination File).
Destination File , Existing table
( ), New table (
). Save As (
), .
(. 20.13) ,
( Add my table to the following
database), (Create my table as a stand-alone
free table).

. 20.13.

(. 20.14) ,
(Begin import at row)
(Field names in row). ?
. Worksheet
, -.
( Data Format).
(. 20.15)
,
.
10 ..

290

I. Visual FoxPro

. 20.14.

. 20.15.

(. 20.16):
Code Page ( Windows 1251);
Currency Symbol "" ,
Currency;

20.

291

1000 Separator ;
Decimal Separator ;
Date Format .
, (. 20.17).

. 20.16.

. 20.17.

292

I. Visual FoxPro

Finish () ,
, (. 20.18).

. 20.18. Excel

Excel? Excel , . , ,
FoxPro for DOS
, Visual FoxPro! , , , dbf, ! "", "Not a
database file". - - oe. ( "
" , "
" .) , DOS,
:
COPY My_Table TO My_Dos_Table TYPE FOXPLUS AS 886

21


Visual FoxPro FormSet,
.

, , . .
, ""
.
. Grid
. countries.dbf (. 21.1).

. 21.1.

Create FormSet ( )
Form (). , ,
FormSet.
, Add New Form (
) Form (). ,

294

I. Visual FoxPro

cities.dbf
(. 21.2).

. 21.2.

,
depclients.dbf (. 21.3).

. 21.3.

, . .

(. 21.4).

21.

295

. 21.4.

22


,
- ,
, -;
, . - ...
. . Windows,
.
Visual FoxPro,
( ""),
. ,
.
,
( ),
(popup-menu) (. 22.1).
, ,
.
, Visual FoxPro
(Menu Designer), ,
"", . , ,
.
: DEFINE PAD
, DEFINE BAR
DEFINE POPUP ( 22.1).
22.1.
*
DEFINE MENU Mymenu BAR && Mymenu -
DEFINE PAD Padone OF Mymenu PROMPT ""&&
DEFINE PAD Padtwo OF Mymenu PROMPT ""

22.

297

ON PAD Padone OF Mymenu ACTIVATE POPUP Popone &&


&&
ON PAD Padtwo OF Mymenu ACTIVATE POPUP Poptwo
DEFINE POPUP Popone &&
DEFINE BAR 1 OF Popone PROMPT " " &&
&&
DEFINE BAR 2 OF Popone PROMPT ""
ON SELECTION BAR 1 OF Popone DO FORM Main &&
&&
ON SELECTION BAR 2 OF Popone QUIT
DEFINE POPUP Poptwo && ,
&&
DEFINE BAR l OF Poptwo PROMPT " "
DEFINE BAR 2 OF Poptwo PROMPT " "
ON SELECTION BAR 1 OF Poptwo DO Procl
ON SELECTION BAR 2 OF Poptwo REPORT FORM Myreport PREVI
ACTIVATE MENU Mymenu &&
PROCEDURE Procl &&
SELE Mytab
SET ORDER TO Myorder
REPORT FORM Myreport TO PRINTER

. 22.1.

I. Visual FoxPro

298

, : -:

DEFINE MENU <_> BAR

:
DEFINE PAD

<_>

OF <_> PROMPT " _ "

,
: ON PAD <__> OF <__>

- Visual FoxPro. ,
, :
ON PAD PADONE OF MYMENU ACTIVATE POPUP POPONE

, (), , :
DEFINE

POPUP

<__>

:
DEFINE BAR l OF Poptwo PROMPT "_1"
DEFINE BAR 2 OF Poptwo PROMPT "_2"

:
ON SELECTION BAR 1 OF <__>

...

<>

, -|
:
ON SELECTION BAR 1 OF Poptwo DO Procl

ACTIVATE MENU <_>

. 22.2.

Visual FoxPro, .
Visual FoxPro, , :
DEACTIVATE MENU <_>

:
RELEASE MENUS <_> EXTENDED

, :
SET SYSMENU TO DEFAULT

22.

299

. 22.2.


,
Visual FoxPro, .
, New Menu ( )
(. 22.3).

. 22.3. New Menu

300

I. Visual FoxPro

: Menu
Shortcut .
(. 22.4).

. 22.4.

,
( Prompt (), Result ()
Options ()), Menu level ( )
.
Prompt () , Result () , ,
Prompt Option ( ),
Option,
. , ,
. 22.1.
22.1.

Insert ()

Insert Bar (
)


Visual FoxPro

Delete ()

Preview
( )

, . -

22.

301

, .
. 22.5.

. 22.5.

, "" . "
"
<AIt> , , "" .
. ""
, .
, , ,
,
Result () (. 22.2).
22.2. Result

Command ()

Pad Name
( )

Submenu ()

Procedure ()

Command ()

(. 22.6).

I. Visual FoxPro

302

. 22.6.

Submenu ()
Create (),

(. 22.7).

. 22.7.


Prompt Options ( ) (. 22.8) .
. 22.3.
22.3. Prompt Options

Skip for ()

Message ()

Pad Name ( )

Comment ()

Shortcut ,
Negotiate :
Container ()
OLE-;

22.

303

Object ()
Active Document.

. 22.8. Prompt Options


"" ,
. , ""
, ,
,
. ""
<Alt>, " ".

, .

<F1>, .
(. 22.9)?
1. .
2. Options.
3. Key Label ( )
,
<F1>. Key Text .

304

I. Visual FoxPro

. 22.9.

. 22.10.

. 22.11.

22.

305

Pad Name ( )
.
, .
Skip For (
).
Expression Builder ( ),
.
\-.
, . 22.10, 22.11.


,
, ,
. General
Options ( ) View () (. 22.12).

. 22.12. General Options

Procedure () ,
. Setup
,
, Cleanup ,
. Top-Level
Form ( )
, Visual FoxPro.
Location ()
(. 22.4).

306

I. Visual FoxPro
22.4.

Replace ()

Append ()

Before ( )

After ( )


,
. Menu (
) Generate Menu ( ) (. 22.13).

. 22.13. Generate Menu

Generate ()
... , !


:

Run;
:
DO <_>. mpr

... "" . 22.14.


? "" . -
"" , , . .
. , , .
"" .
""
(. 22.15). (. 22.16).

22.

. 22.14.

. 22.15. ""

307

308

I. Visual FoxPro

. 22.16.


Visual
FoxPro, .

showwindow 2 As top level form ( ).
i n i t :
DO MENU1.MPR WITH T H I S , . T .

"", TopLevel Form ( ) General Options


( ) .
(. 22.17).

22.

309

. 22.17.

Shortcut-
Shortcut- ,
.
,
.
New Menu ( ) Shortcut (.
. 22.3). (. 22.18).

. 22.18. Shortcut

, Shortcut
.
(. 22.19).

310

I. Visual FoxPro

. 22.19. Shortcut-


, Right Click Event (
), :
DO < >.mpr

23



HTML HELP Workshop,
Visual FoxPro. ,
Microsoft, ,
, .
- (
Visual FoxPro) ,
: www.microsoft.com/workshop/autor/htnilhelp.

HTMLHELP.EXE
.
HTML HELP Workshop . 23.1.
.
. ,
HTML. ? ,
. HTML-
( HTML Help Workshop).
Word,
HTML.
. 23.2.
HTML Help Workshop
File () New ().
New (. 23.3)
: Project (), Text (), HTML File
( HTML), Table of Contents ( ), Index
(). ,
Project () . 23.4.

312

I. Visual FoxPro

. 23.1. HTML HELP Workshop

. 23.2. Word

23.

313

. 23.3. New

. 23.4. N e w P r o j e c t


Win Help HTML Help
Workshop, .
, ,
Convert WinHelp Project (
WinHelp), .
(. 23.5).

. Browse ().
,
, .
( Word)
, (. 23.6).

314

I. Visual FoxPro

. 23.5. Destination

. 23.6. Existing Files

", ?"
(. 23.7).
Add (),
, Remove ().
(. 23.8).
, . 23.1.

23.

. 23.7. HTML Files

. 23.8.

315

316

/. Visual FoxPro
23.1. Project

Change project options



Add / Remove topic files
Windows
Windows definition
API
API information
HTML
View HTML source

Save project files

Save project and file compile

(Table of Contents).
,
, . . . , . , Contents
() . 23.9.

. 23.9.

23.

317

: Create a new contents file


( ) Open an existing contents file (
). ,
.
Save As ( )
, MY-TABLE.hhc. ,
hhc. Contents (
) (. 23.10).

. 23.10. Contents

,
. 23.2.
23.2. Contents

Contents properties

318

I. Visual FoxPr
23.2 ()

Insert a heading

Insert a page

Edit selection

Delete selection

Moving selection up

Moving selection down

Moving selection right

Moving selection left
HTML
View HTML source

Save file

. 23.11.
Entry title ( ) ,
Add () , Advanced (
) . 23.12.

, Insert a page (
) . 23.13.

23.

. 23.11.

. 23.12.

319

320

I. Visual FoxPro

. 23.13.

. 23.14.

23.

321

,
. Save project and file
compile,
. 23.14.

Compiled file ( ) View ()
. 23.15.

. 23.15.


:
Index ()
New ();
Index, .

,
(. 23.3).
" W 1-)

322

I. Visual FoxPro
23.3. Index

. 23.16.
,
, Add (
), .

23.

. 23.16.

. 23.17.

323

324

I. Visual FoxPro

,
( ).
. 23.17.
,
. 23.18.

. 23.18.

-
, (. 23.19).

. 23.19.


, , .
HeipContextiD. , 50. init
: This.SetAll ("HeipContextiD",50).
click : Help ID
This.HeipContextiD.

23.

325

HTML-, ,
, Helpform.htm.
, , ,
: #define iDH_HeipButton 50.
iDH_HelpButton HeipContextid.
, h,
Formhelp.h

HTMLHelpAPI information (. 23.20).

. 23.20. HtmlHelpAPI information

. 23.21. Alias

326

I. Visual FoxPro

Header file ( ) ,
. ,
HeipContextid.
Alias Add ().
, . 23.21.
,
.
"" . 23.22.
, <F1>.

. 23.22. -

What's This?

.
, -
,
. ,
: whatThisHeip=.T.,
WhatThisButton =.T., MaxButton =.F., MinButton =

.F., WhatThisHelpId

, 7. (
, , .)
"" .
, . 23.23.
.
formhelp.h (. 23.24).

23.

227

. 23.23. What's This?

. 23.24.

, Alias () ,
.
!

2 4

-

-.
.


,
, . .
Project Info (
) Project (). ,
. 24.1.

. 24.1. Project Information

24. -

329

: Project (), Files () Servers (


).
Project ; Author
(... ), Company ( ), Address
(), City (), Country (), State (, ), Postal code
( ).
( ) ,
Attach icon ( ) Icon ()
(),
. Debug info ( )
, Encrypted (
) .
Files () (. 24.2) ,
. ,
, , Name ().
()
(Last Modified). ,
(Included), .

. 24.2. Fifes


,
. ,

330

I. Visual FoxPro

, , , . .
,
,
Set Main ( ) . 24.3.
.

. 24.3.

Exclude
, , ,

Include (), , ,
. , ,
, ,
, .
Exclude ()
(. . 24.3). ,
.
( ...). ,
.
"" , Clean Up Project
( ) Project ().


,
Build Executable ( ) -

24. -

331

Build Options ( ) (. 24.4),


Build () .

PMC. 24.4. Build Options

: Action ()
Options (), .
Action ():
Rebuild Project ( )
;
Build Application ( )
. Visual FoxPro;
Build Executable ( )
. Visual FoxPro,
( );
Build COM DLL ( COM DLL)
dll.
Options ():
Recompile All Files ( )
,
. ,
;
Display Errors ( )
, ;
Run After Build ( )
,
;

332

I. Visual FoxPro

Regenerate Component IDs ( Auto


mation-) ,
Automation-.
Version (),
,
( . .) . 24.5.

. 24.5. EXE Version

"",
.
, -j
Visual FoxPro,
"
". , ?
READ EVENTS. ...
, :
*

DO FORM MAIN
READ EVENTS

, , . ,
,
Windows
"Cannot quit Visual FoxPro" ( Visual FoxPro)-

24. -

333

? . "
" <Ctrl>+<Alt>+<Del>. ,
CLEAR EVENTS QUIT,
Visual FoxPro:

CLEAR EVENTS
QUIT

25


, ,
- .
, Visual FoxPro

. Visual FoxPro
?
Visual FoxPro,
: ,
. , , "
..." , Visual FoxPro
Setup Wizard ( ). Tools | Wizards | Setup
Wizard ( | | ).
(. 25.1) ,
, .
,
Select Directory ( ).
(. 25.2) ,
.
Visual FoxPro, Visual FoxPro
runtime
.
Microsoft Graph 8.0, .
ActiveX, HTML-
ODBC,
.

. , ActiveX
. 25.3.

25.

335

. 25.1. Setup Wizard

. 25.2. Setup Wizard

(. 25.4)
.
: (1.44 MB 3.5-inch) (
), Web (Websetup (compressed))
(Netsetup (uncompressed)).

336

I. Visual FoxPro

. 25.3. ActiveX

. 25.4. Setup Wizard

(. 25.5)
,
, ,
. , ,
.
(. 25.6)
, npo . ,
.
, .

25.

337

. 25.5. Setup Wizard

. 25.6. Setup Wizard


(. 25.7).

ActiveX .

338

I. Visual FoxPro

. 25.7. Setup Wizard

, . 25.8.
Generate a web executable file
Web, Create a dependency (.DEP) file .
, !

. 25.8.

25.

339


, (. 25.9).

. 25.9.

. 25.10.

. 25.10.

? ,
.

(. 25.11).
,
.
Preview Report ( )
. . (. 25.12).
Setup Diskl (. 25.13).
, ,
(. 25.1425.16).

340

I. Visual FoxPro

. 25.11.

. 25.12.

25.

. 25.13.

. 25.14.

341

342

I. Visual FoxPro

. 25.15.

. 25.16. !

II
-

II ,
. ,
Visual FoxPro ,

,
- . ?
, ,
, .
( , , ),
.
FoxPro for DOS, FoxPro for Windows
. ,
Visual FoxPro. , ,
?
( , "" Visual
FoxPro) . ...

: ,
- . ,
: "-, ,
. , ..." ,
. , -
. , , . . "
", ,
.
... . ,
, .

-
. , ,
. , , . . "".
, ? ,
. "" , "" ? , "" , . .
,
. . "" ,
. . , ,
, , , "", "" . .
,
, ""
, . ,
, "", ,

.
, , ,
- . :

, - ( ), - (
) .

26

, , ,
, . :
(entities), (inheritance), (encapsulation),
(polymorphism). . ,
. ,
""
. .
- .
,
- .
? (,
, , ,
. .), ""
,
,
. .
. ,
: ,
,
? , .
,
, , ,
"" .
""
. , ?
, . . (
) ,
.

346

II. -

, , . ,
backcoior,
. ,
- ,

.
, , ,
. ? ,
- .
, ""
, .
, .
.
, :
IF BOF ()
=MESSAGEBOX(" ", " ")
ENDIF

, "" ,
, .

, : Visual FoxPro
. , ,
. ,

, ?
, .
, .
, . ,
. - -
,
. ? ,

( -), ""
.
.
, , . . ,
, .

26.

347

Visual FoxPro : DEFINE


CLASS ENDDEFINE.

:'

DEFINE CLASS _ AS __

- (superclass) ,
.
:
DEFINE CLASS Myform AS FORM
Autocenter = .T.
Caption = "MYFORM"
Backcolor = RGB(0,255,0)
Name - "MYFORM"
ENDDEFINE

, . ,
, ,
:
Oform=CREATEOBJECT ("Myform")
Oform.SHOW(l)
DEFINE CLASS Myform AS FORM
Autocenter = .T.
Caption = "MYFORM"
Backcolor = RGB(0,255,0)
Name = "Myform"
ENDDEFINE

CREATEOBJECT ():
Oform = CREATEOBJECT("Myform")

To object
. , -
- -
- . "-",
. -
15 487 ! ? ,
-.
,
. .
-
.
, , Visual FoxPro
. " "?

348

II. -

,
. . 26.1
Visual FoxPro.

()

FormControls

26.1. Visual FoxPro

ActiveDoc

CheckBox

Column

G r i d

ComboBox

CommandButton

CommandGroup

Container

Control

. ""
Container,
,

Cursor

Custom

DataEnvironment

EditBox

Form

FormSet

Grid

Header

HyperLynk
Object

Image

Label

()

26.

349

()


ForrnControls

26.1 ()

Line

ListBox

decontrol

OptionButton

OptionButton

Page

PageFrame

ProjectHook

Relation

Separator

Shape

Spinner

TextBox

Timer

ToolBar

,
. ,
, "".


, ,
. . , ,
.
ADD OBJECT, :
ADD OBJECT _ AS __
WITH
=

350

II. -

:
Of orm=CREATEOBJECT ("Myf orra")
Oform.SHOW(l)
DEFINE CLASS Myform AS FORM
Autocenter = .T.
Caption = "Myform"
Backcolor - RGB(0,255,0)
Name = "Myform"
ADD OBJECT Mylabel AS LABEL;
WITH Caption="ripMMep ",;
Autosize=.T.,;
Top=40,;
Left=100
ENDDEFINE

. 26.1.

. 26.1.

ADDOBJECTO. -|
, :
Oform=CREATEOBJECT ("Form")
Oform.Autocenter=.T.
Oform.Caption="Myform"
Oform.ADDOBJECT("Mylabel","LABEL")
Oform.Mylabel.Caption=" "
Oform.Mylabel.Autosize=.T.
Oform.Mylabel.Top=40

26.

351

Oform.Mylabel.
Lef t=100
Oform.Mylabel.Visible=.T.
Oform.SHOW(l)

ADD OBJECT ADDOBJECTO-


ADD OBJECT ,
ADDOBJECT( ) . ADDOBJECT(),
visible .. (
).

27


Class Designer
Visual FoxPro : ( ) ( )
Class Designer.
Form Designer ( ), ,
Class () . 27.1.

. 27.1. Class Designer

27. Class Designer

353

,
, .
1. Classes ()
New ().
2. New Class ( ) (. 27.2)
Class Name ( )
, Based On (
), Visual FoxPro,
.
, .
, ,
.

. 27.2. New Class

3. , Class Designer ,
,
(. 27.3).
(caption = ) click:
THIsFORM.RELEASE (), .
, ! 27.1.
27.1. E x i t B u t t o n
DEFINE CLASS EXITBUTTON AS COMMANDBUTTON
HEIGHT - 27
WIDTH = 8 4
CAPTION = ""
NAME - "EXITBUTTON"
PROCEDURE CLICK
THISFORM.RELEASE()
ENDPROC
ENDDEFINE

354

II. -

. 27.3.

,
,
. " "
,
.

1
. ,
: , . ,
,
.
,
. :
- ...
DigitButto
(. 27.4).
DigitButton "" ( 27.2).

27. Class Designer

355

. 27.4.

27.2. DigitButton
DEFINE CLASS DIGITBUTTON AS COMMANDBUTTON
HEIGHT = 27
WIDTH = 4 8
FONTBOLD = .T.
CAPTION = "1"
NAME = "DIGITBUTTON"
PROCEDURE CLICK
THISFORM. TEXT1 .VALUE==THISFORM.TEXTl .VALUE+THIS. CAPTION
THISFORM.TEXT2.VALUE=THISFORM.TEXT2.VALUE+THIS.CAPTION
ENDPROC
ENDDEFINE


. , "", .
, , ( ,
Properties ()),
.

356

II. -

New Property ( ) Form () Form Designer


( ). New Property (
) . 27.5.

. 27.5. New Property


Access Method Assign Method.
Access Method
Access (), Assign Method
Assign (). ,
,
, (Properties) . 27.6.

. 27.6.

27. Class Designer

357

,
, OperButton.
27.3.
27.3. OperButton
DEFINE CLASS OPERBUTTON AS COMMANDBUTTON
TOP - 5 3
LEFT = 147
HEIGHT = 27
WIDTH = 3 6
FONTBOLD = . T .
CAPTION = " + "
NAME = " 0 P E R 1 "
PROCEDURE CLICK
THISFORM.OPER=THIS.CAPTION

LASTVALUE=THISFORM.TEXT1.VALUE
THISFORM.TEXTl.VALUE=""
THISFORM.TEXT2.VALUE=THISFORM.TEXT2.VALUE+THISFORM.OPER
ENDPROC
ENDDEFINE

, .
View Classes ( )
Form Controls ( )
Add ().
. 27.7.
. 27.8.
,
init : PUBLIC LASTVALUE . 27.9.
? click
"=" ( 27.4).
27.4. c l i c k "="
IF THISFORM.OPER="+"
THISFORM.TEXTl.VALUE=STR(VAL(THISFORM.TEXTl.VALUE)+VAL(LASTVALUE),20,2)
THISFORM.TEXT2.VALUE=THISFORM.TEXT2.VALUE+"="+
ALLTR(THISFORM.TEXTl.VALUE)
ENDIF
IF THISFORM.OPER="-"
THISFORM.TEXTl.VALUE=STR(VAL(LASTVALUE)-VAL(THISFORM.TEXTl.VALUE),20,2)

II. -

358

THISFORM.TEXT2.VALUE=THISFORM.TEXT2.VALUE+"="+
ALLTR(THISFORM.TEXT1.VALUE)
ENDIF
I F THISFORM.OPER="*"
THISFORM.TEXT1.VALUE=STR(VAL(LASTVALUE)*
VAL(THISFORM.TEXT1.VALUE),20,2) THISFORM.TEXT2.VALUE=THISFORM.TEXT2.VALUE+"="+
ALLTR(THISFORM.TEXT1.VALUE)
ENDIF
IF THISFORM.OPER='7"
THISFORM.TEXT1.VALUE=STR(VAL(LASTVALUE)/VAL(THISFORM.TEXT1.VALUE),20,2)
THISFORM.TEXT2.VALUE=THISFORM.TEXT2.VALUE+"="+
ALLTR(THISFORM.TEXT1.VALUE)
ENDIF

, "" . 27.10.
, , ? !

G J ^ H H H I ^
: | iQ calc

|. : 3 IS & "

. 27.7.

. 27.8. Form Controls

27. Class Designer

. 27.9. !

359

. 27.10. ! !

2 Puzzle
-, -, FoxPro for DOS
Puzzle (), "".
: ,
1 15. , , Visual FoxPro .
, ,
. ,
. 27.11.
. 27.12.

. 27.11. "" Puzzle

. 27.12.

II. -

360

, , "
" Form Designer ( ), (81 !),
. .? ,
- , 4 !
( 27.5), ,
.
27.5. Puzzle
***************************** *pn2ZLE**************************
**********************>}. DMITRY SHAPOREV*****************
STARTPUZZLE=CREATEOBJECT("STARTPUZZLE")
STARTPUZZLE.SHOW(1)
DEFINE CLASS STARTPUZZLE AS FORM
HEIGHT = 82
WIDTH = 175
DOCREATE - .T.
AUTOCENTER - ,T.
CAPTION = " "
CLOSABLE = .F.
MAXBUTTON = .F.
MINBUTTON = .F.
NAME = "FORM1"
ADD OBJECT LABEL1 AS LABEL WITH;
AUTOSIZE = .., ;
CAPTION = " ( 4 9)",;
HEIGHT = 17,;
LEFT = 1,;
TOP = 4,;
WIDTH - 172,;
NAME = "LABEL1"
ADD OBJECT TEXT1 AS TEXTBOX WITH;
HEIGHT = 23, ;
LEFT = 37,;
TOP = 24, ;
WIDTH = 100, ;
NAME = "TEXT1"
ADD OBJECT COMMAND1 AS COMMANDBUTTON WITH;
TOP - 51,;
LEFT = 12,;

27. Class Designer


HEIGHT = 27,;
WIDTH = 60, ;
CAPTION = "",;
NAME = "COMMANDl"
ADD OBJECT C0MMAND2 AS COMMANDBUTTON WITH;
TOP = 51, ;
LEFT = 93,;
HEIGHT = 27,;
WIDTH = 60, ;
CAPTION - "",;
NAME - "C0MMAND2"
PROCEDURE TEXT1.ERRORMESSAGE
=MESSAGEBOX(" !","")
ENDPROC
PROCEDURE TEXT1.VALID
IF EMPTY(THIS.VALUE)
RETURN it.
END IF
IF VAL(THIS.VALUE)<4
RETURN .F.
ENDIF
IF VAL(THIS.VALUE)>9
RETURN .F.
ENDIF
ENDPROC
PROCEDURE C0MMAND2.CLICK
PUBLIC NLEVEL
NLEVEL=VAL(THISFORM.TEXT1.VALUE)
**********************
**********************
#DEFINE COUNT_OF_ITEMS
NLEVEL*NLEVEL
LOCAL ARRAY LARAND[COUNT_OF_ITEMS]
LOCAL ARRAY LATEMP[COUNT_OF_ITEMS]
LOCAL I,J, N
RAND(-l)
N=COUNT_OF_ITEMS
FOR 1=1 TO COUNT_OF_ITEMS
LATEMP[I]=1-1
ENDFOR
FOR 1=1 TO COUNT_OF_ITEMS
J=INT(RAND()*N)+1
LARAND[I]=LATEMP[J]

361

=ADEL(LATEMP,J)
N=N-1
ENDFOR
FOR 1=1 TO COUNT_OF_ITEMS
ENDFOR
**********************
**********************
************************************************************************
PUZZLE=CREATEOBJECT("FORM")
PUZZLE.CAPTION="FOXPUZZLE"
DL=30
WT=30
FOR F = l TO NLEVEL
FOR D=l TO NLEVEL
PUZZLE.ADDOBJECT("PZ"+ALLTR(STR(D))+ALLTR(STR(F)), "PUZZLEBUTTON")
M1="PZ"+ALLTR(STR(D))+ALLTR(STR(F))+".VISIBLE"
M2="PZ"+ALLTR(STR(D))+ALLTR(STR(F))+".LEFT"

M3="PZ"+ALLTR(STR(D))+ALLTR(STR(F))+".WIDTH"
M4="PZ"+ALLTR(STR(D))+ALLTR(STR(F))+".TOP"
M5="PZ"+ALLTR(STR(D))+ALLTR(STR(F))+".CAPTION"
PUZZLE.&M4=(F)*WT
PUZZLE.&M2=DL*(D-1)
PUZZLE.&M1=.T.
PUZZLE.&M3=DL
PUZZLE.WIDTH=DL*D
PUZZLE.HEIGHT=WT*(F+2)
ENDFOR
ENDFOR
1=0
FOR R = l TO NLEVEL
FOR K=l TO NLEVEL
M5="PZ"+ALLTR(STR(R))+ALLTR(STR(K))+".CAPTION"
1=1+1
PUZZLE.&M5=ALLTR(STR(LARAND(I)))
ENDFOR
ENDFOR
PUZZLE.AUTOCENTER=.T.
PUZZLE.SHOW(1)
ENDPROC

27. Class Designer

363

PROCEDURE COMMANDl.CLICK
THISFORM.RELEASE()
ENDPROC
ENDDEFINE
* ENDDEFINE: PUZZLE
***********************************************************************
DEFINE CLASS PUZZLEBUTTON AS COMMANDBUTTON
HEIGHT = 2 7
WIDTH = 84
CAPTION = ""
NAME = "PUZZLEBUTTON"
PROCEDURE CLICK
THISNAME=THIS.CAPTION
DIGIT_PART=INT(VAL(RIGHT(THIS.NAME,2)))
IF
TYPE("THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART+1))+".NAME")="C"
NEXTNAME="THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART+1))+".CAPTION"
IF &NEXTNAME="0"
THIS.CAPTION=&NEXTNAME
&NEXTNAME=THISNAME
ENDIF
ENDIF
************************************************************************
IF TYPE("THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART1))+".NAME")="C"
NEXTNAME="THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART-1))+".CAPTION"
IF &NEXTNAME="0"
THIS.CAPTION=&NEXTNAME
&NEXTNAME=THISNAME
ENDIF
ENDIF
********************
IF
TYPE("THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART+10))+".NAME")="C"
NEXTNAME="THISF0RM."+"PZ"+ALLTR(STR(DIGIT_PART+10))+".CAPTION"
IF &NEXTNAME="0"
THIS.CAPTION=&NEXTNAME
&NEXTNAME=THISNAME
ENDIF
ENDIF

364

II. -

********************
IF TYPE("THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART-10))+".NAME")="C"
NEXTNAME="THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART-10))+".CAPTION"
IF &NEXTNAME="0"
THIS.CAPTION=&NEXTNAME
&NEXTNAME=THISNAME
ENDIF
ENDIF
ENDPROC
ENDDEFINE

. ,
. .
" 1" ,
( 27.6).
27.6. 1
STARTPUZZLE=CREATEOBJECT("STARTPUZZLE")
STARTPUZZLE.SHOW(1)
DEFINE CLASS STARTPUZZLE AS FORM
HEIGHT = 82
WIDTH = 175
DOCREATE = .T.
AUTOCENTER = .T.
CAPTION = " "
CLOSABLE - .P.
MAXBUTTON = ,F.
MINBUTTON = .F.
NAME = "FORM1"
ADD OBJECT LABEL1 AS LABEL WITH;
AUTOSIZE = .T.,;
CAPTION = " ( 4 9 ) " , ;
HEIGHT = 17,;
LEFT = 1,;
TOP = 4, ;
WIDTH = 172,;
NAME = "LABEL1"
ADD OBJECT TEXT1 AS TEXTBOX WITH;
HEIGHT = 23,;

27. Class Designer


LEFT = 37,;
TOP - 24, f
WIDTH = 100,;
NAME = "TEXT1"
ADD OBJECT COMMAND1 AS COMMANDBUTTON WITH;
TOP = 51,;
LEFT = 12,;
HEIGHT - 27, ;
WIDTH = 60, ;
CAPTION = "",;
NAME = "COMMAND1"
ADD OBJECT COMMAND2 AS COMMANDBUTTON WITH;
TOP = 51, ;
LEFT = 93,;
HEIGHT = 27,;
WIDTH = 60,;
CAPTION = "",;
NAME - "COMMAND2"
PROCEDURE TEXT1.ERRORMESSAGE
=MESSAGEBOX(" !","")
ENDPROC

PROCEDURE TEXT1.VALID
IF EMPTY(THIS.VALUE)
RETURN .F.
ENDIF
IF VAL(THIS.VALUE)<4
RETURN .F.
ENDIF
IF VAL(THIS.VALUE)>9
RETURN .F.
ENDIF
ENDPROC
PROCEDURE COMMAND2.CLICK
PUBLIC NLEVEL && - ,
NLEVEL=VAL(THIS FORM.1.VALUE)

ENDDEFINE

365

366

II. -

" 2" , ,
( 27.7).
NLEVEL.
27.7. 2
;

#DEFINE COUNT_OF_ITEMS
NLEVEL*NLEVEL
LOCAL ARRAY LARAND[COUNT_OF_ITEMS]
LOCAL ARRAY LATEMP[COUNT_OF_ITEMS]
LOCAL I , J , N
RAND(-l)
N=COUNT_OF_ITEMS
FOR 1=1 TO COUNT_OF_ITEMS
LATEMP[I]=1-1
ENDFOR
FOR 1=1 TO COUNT_OF_ITEMS
J=INT(RAND()*N)+1
LARAND[I]=LATEMP[J]
=ADEL(LATEMP, J)
N=N-1
ENDFOR
FOR 1=1 TO COUNT_OF_ITEMS
ENDFOR

" 3" ,

( 27.8).
27.8. 3
PUZZLE=CREATEOBJECT("FORM")
PUZZLE.CAPTION="FOXPUZZLE"
DL=30
WT=30
FOR F=l TO NLEVEL
FOR D=l TO NLEVEL
PUZZLE.ADDOBJECT("PZ"+ALLTR(STR(D))+ALLTR(STR(F)) , "PUZZLEBUTTON")
M2="PZ"+ALLTR(STR(D) ) +ALLTR(STR(F) J +".LEFT"
M1="PZ"+ALLTR(STR(D))+ALLTR(STR(F))+".VISIBLE"
M3="PZ"+ALLTR(STR(D))+ALLTR(STR(F))+".WIDTH"
M4="PZ"+ALLTR(STR(D))+ALLTR(STR(F))+".TOP"
M5="PZ"+ALLTR(STR(D) )+ALLTR(STR(F) )+".CAPTION"

27. Class Designer

367

PUZZLE.&M4=(F)*WT
PUZZLE.&M2=DL*(D-1)
PUZZLE.&M1=.T.
PUZZLE.&M3=DL
PUZZLE.WIDTH=DL*D
PUZZLE.HEIGHT=WT*(F+2)
ENDFOR
ENDFOR
1=0
FOR R * l TO NLEVEL
FOR K=l TO NLEVEL
M5=-"PZ"+ALLTR (STR(R))+ALLTR(STR(K))+".CAPTION"
1=1+1
PUZZLE.&M5=ALLTR(STR(LARAND(I)))
ENDFOR
ENDFOR
PUZZLE.AUTOCENTER=.T.
PUZZLE.SHOW(1)
ENDPROC
PROCEDURE COMMAND1.CLICK
THISFORM.RELEASE()
ENDPROC
ENDDEFINE

" 4"
, , .
27.9.
27.9. 4
DEFINE CLASS PUZZLEBUTTON AS COMMANDBUTTON
HEIGHT = 27
WIDTH = 84
CAPTION =

""

NAME = "PUZZLEBUTTON"
PROCEDURE CLICK
THISNAME=THIS.CAPTION
DIGIT_PART=INT(VAL(RIGHT(THIS.NAME,2)))
I F TYPE("THISFORM."+"PZ"+ALLTR(STR(DIGITJPART+1))+".NAME")="C"
NEXTNAME="THISFORM."+"PZ"+ALLTR(STR(DIGIT PART+1))+".CAPTION"

368

II. -

IF &NEXTNAME="0"
THIS.CAPTION=&NEXTNAME
&NEXTNAME=THISNAME
ENDIF
ENDIF
*********************************************************************
,

IF
TYPE("THISF0P^."V PZ"+ALLTR(STR(DIGITJ>ART-1))V\NAME")="C"
NEXTNAME="THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART-1))+".CAPTION"
IF &NEXTNAME="0"
THIS.CAPTION=&NEXTNAME
&NEXTNAME=THISNAME
ENDIF
ENDIF
**************
IF TYPE("THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART+10))+".NAME")="C"
NEXTNAME="THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART+10))+".CAPTION"
IF &NEXTNAME="0"
THIS.CAPTION=&NEXTNAME
&NEXTNAME=THISNAME
ENDIF
ENDIF
***************
IF TYPE("THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART-10))+".NAME")="C"
NEXTNAME="THISFORM."+"PZ"+ALLTR(STR(DIGIT_PART-10))+". CAPTION"
IF &NEXTNAME="0"
THIS.CAPTION=&NEXTNAME
&NEXTNAME=THISNAME
ENDIF
ENDIF
ENDPROC
ENDDEFINE

click,
. :
TYPE , , ,
"" ?
, . "0",
. .
, , ,
-
. -

27. Class Designer

369

?
, . . ,
, .


Class Designer
. ,

. , "":
. , ? ( ,
Visual FoxPro).
.
1. Classes ()
New ().
2. , -
, (. 27.13).

. 27.13. C o n t a i n e r

3. Class Designer
( ),
.
Form Controls (
), Class Designer ( )
container, shape (. 27.14).
4. , , . .,
init container (
ColorButton):
THIS.SHAPE1.WIDTH=THIS.WIDTH-2
THIS.SHAPE1.HEIGHT=THIS.HEIGHT-2

? shape
"" "" .

II. -

370

. 27.14. Class Designer

5. click shape:
THIS.LEFT=THIS..LEFT+2
THIS.TOP=THIS..TOP+2
WAIT "" TIMEOUT 0 . 1
THIS.LEFT=THIS..LEFT-2
THIS.TOP=THIS..TOP+2

Left ,
, ""
. "" ,
.
WAIT "" TIMEOUT O . I ? ,
,
! WAIT
, TIMEOUT. .
, WAIT ,
FoxPro "Press any key to conti-

27. Class Designer

371

nue..." ( ). ,
.
. 27.15.

. 27.15.

? . , ...
, ,
.
.
- ...
.

.
1.

Navigator

CommandGroup

(. 27.16).
2. ,
( 27.10).
27.10.
""
GO TOP
__SCREEN.ACTIVEFORM.REFRESH()
""
IF EOF()
=MESSAGEBOX(" ", " ")
ELSE
SKIP
_SCREEN.ACTIVEFORM.REFRESH()
ENDDIF

372

II. -

""
IF BOFO
=MESSAGEBOX(" " , " ")
ELSE
SKIP-1
_SCREEN.ACTIVEFORM.REFRESH()
ENDIF
""
GO BOTTOM
SCREEN.ACTIVEFORM.REFRESH()

. 27.16.
27.11.
27.11. N a v i g a t o r
***************************** ********* *****************************
* CLASS:
* PARENTCLASS:
* BASECLASS:
*

NAVIGATOR (C:\CALC\MYLIB.VCX)
COMMANDGROUP
COMMANDGROUP

27. Class Designer


DEFINE CLASS NAVIGATOR AS COMMANDGROUP
BUTTONCOUNT = 4
VALUE = 1
HEIGHT

=36

WIDTH = 289
NAME = "NAVIGATOR"
COMMAND1.AUTOSIZE =

.T.

COMMANDl.TOP = 5
COMMAND1.LEFT = 5
COMMAND1.HEIGHT = 25
COMMANDl.WIDTH = 54
COMMANDl.FONTSIZE = 8
COMMANDl.CAPTION = ""
COMMAND1.NAME = "COMMANDl"
COMMAND2.AUTOSIZE =

.T.

COMMAND2.TOP = 5
COMMAND2.LEFT = 58
COMMAND2.HEIGHT = 2 5
COMMAND2.WIDTH

=75

COMMAND2.FONTSIZE = 8
COMMAND2.CAPTION =

""

COMMAND2.NAME "COMMAND2"
COMMAND3.AUTOSIZE =

..

COMMAND3.TOP = 5
COMMAND3.LEFT = 132
COMMAND3.HEIGHT = 25
COMMAND3.WIDTH

=81

COMMAND3.FONTSIZE = 8
COMMAND3.CAPTION = ""
COMMAND3.NAME = "COMMAND3"
COMMAND4.AUTOSIZE -

.T.

COMMAND4.TOP = 5
COMMAND4.LEFT = 212
COMMAND4.HEIGHT = 25
COMMAND4.WIDTH

=71

COMMAND4.FONTSIZE = 8
COMMAND4.CAPTION = ""
COMMAND4.NAME = "COMMAND4"

PROCEDURE COMMANDl.CLICK
GO TOP
_SCREEN. ACTIVE FORM. REFRESH ()
ENDPROC
PROCEDURE COMMAND2.CLICK

373

374

II. -
IF EOF() = .T.
=MESSAGEBOX(" ",

" ")

ELSE
SKIP
_SCREEN.ACTIVEFORM.REFRESH()
ENDIF
ENDPROC
PROCEDURE COMMAND3.CLICK
IF BOF()
=MESSAGEBOX(" ", " ")
ELSE
SKIP-1
_SCREEN.ACTIVEFORM.REFRESH()
ENDIF
ENDPROC
PROCEDURE COMMAND4.CLICK
GO BOTTOM
_SCREEN.ACTIVEFORM.REFRESH()
ENDPROC
ENDDEFINE
*
* ENDDEFINE: NAVIGATOR


.
: .
1. Class Designer ( )
Container "" TextBox
(. 27.17).
2. I n i t :
THIS.TEXT1.WIDTH=THIS.WIDTH-3
THIS.TEXT1.HEIGHT=THIS.HEIGHT-3
THIS.TEXT1.FONTSIZE=THIS .TEXTl.HEIGHT/1.6

, , . 27.18.
27.12.
2 7 . 1 2 . ShadowTextBox

*--

CLASS:

*-- PARENTCLASS:
* - - BASECLASS:

SHADOWTEXTBOX
CONTAINER
CONTAINER

(C:\CALC\MYLIB.VCX)

27. Class Designer


DEFINE CLASS SHADOWTEXTBOX AS CONTAINER
WIDTH = 438
HEIGHT =36
BACKCOLOR - RGB(128,128,228)
NAME = "SHADOWTEXTBOX"
ADD OBJECT TEXTl AS TEXTBOX WITH;
HEIGHT = 23,;
LEFT - 0, ;
TOP = 0, ;
WIDTH = 336, ;
NAME = "TEXTl"
PROCEDURE INIT
THIS.TEXTl.WIDTH=THIS.WIDTH-3
THIS.TEXTl.HEIGHT=THIS.HEIGHT-3
THIS.TEXTl.FONTSIZE=THIS.TEXTl.HEIGHT/1.6
ENDPROC
ENDDEFINE
*
* ENDDEFINE: SHADOWTEXTBOX
*************************************************************

. 27.17.

375

376

II. -

. 27.18. ,

: ProgressBar. ,
, , ProgressBar . .
?
1. .
(Label). . 27.19.

. 27.19. m y p r o g r e s s

27. Class Designer

377

2. . init
"" :
THIS.LABEL1.LEFT=THIS.WIDTH/2-THIS.LABEL1.WIDTH/2
THIS.LABEL1.TOP=THIS.HEIGHT/2-THIS.LABEL1.HEIGHT/2
THIS.CONTAINER1.WIDTH=0
THIS.CONTAINER1.HEIGHT=THIS.HEIGHT

3. .
,
- (, ,
), ,
. click :
SCAN
THISFORM.MYPR0GRESS1.CONTAINER1.WIDTH=(THISFORM.MYPROGRESS1.WIDTH/;
RECCOUNT (j ) *RECNO ()
THISFORM.MYPROGRESS1.LABELl.CAPTION=STR(RECNO()/RECCOUNT()*100)+"%"
WAIT WINDOW " "+ ALLTR(STR(RECNO())) NOWAIT
ENDSCAN

. 27.20.

. 27.20. P r o g r e s s B a r

II. -

378

, , 27.13.
27.13. MyProgress

********************************************************************
*-- CLASS:
* PARENTCLASS:
* BASECLASS:
*

MYPROGRESS (C:\CALC\MYLIB.VCX)
CONTAINER
CONTAINER

DEFINE CLASS MYPROGRESS AS CONTAINER


WIDTH = 4 0 2
HEIGHT =40
BACKSTYLE m 0
BORDERWIDTH = 2
SPECIALEFFECT = 1
NAME = "MYPROGRESS"
ADD OBJECT CONTAINERl AS CONTAINER WITH;
TOP - 2,;
LEFT = 0,;
WIDTH - 61, ;
HEIGHT = 37,;
BORDERWIDTH = 2 , ;
SPECIALEFFECT = 0, ;
BACKCOLOR - RGB(0,255,255),;
NAME = "CONTAINERl"
ADD OBJECT LABEL1 AS LABEL WITH;
AUTOSIZE = .T.,;
FONTBOLD - .T.,;
BACKSTYLE = 0 , ;
CAPTION = "LABEL1",;
HEIGHT = 17,;
LEFT = 120, ;
TOP = 12, ;
WIDTH = 40, ;
NAME = "LABEL1"
PROCEDURE INIT
THIS.LABEL1.LEFT=THIS.WIDTH/2-THIS.LABELl.WIDTH/2
THIS.LABELl.TOP=THIS.HEIGHT/2-THIS.LABELl.HEIGHT/2
THIS.CONTAINERl.WIDTH=0
THIS.CONTAINERl.HEIGHT=THIS.HEIGHT
ENDPROC

27. Class Designer

379

PROCEDURE LABEL1.INIT
THIS.CAPTION="0%"
ENDPROC
ENDDEFINE
* ENDDEFINE: MYPROGRESS
********************************************************************

, , ,
.
- , ""
. .

28


. ,
,
Timer. Timer
. o6 interval .
Timer.
Timer . ,
, ,
.
Form (. 28.1).

. 28.1.

.
. Timer
: interval 2000 (
), Timer : THISFORM. RELEASE (. 28.2).
28.1.

28.

. 28.2.

28.1.
*-- CLASS:
* PARENTCLASS:
*~ BASECLASS:

SPLASH (C:\0LDF0X\MYL1B.VCX)
FORM
FORM

DEFINE CLASS SPLASH AS FORM


HEIGHT = 2 8 6
WIDTH =379
SHOVWINDOW - 2
DOCREATE = .T.
AUTOCENTER = .T.
PICTURE = "..\DOCUMENTS AND SETTINGS\FLOWERS,
CAPTION = "FORM2"
CONTROLBOX = .F.
TITLEBAR = 0
NAME = "SPLASH"
ADD OBJECT TIMER1 AS TIMER WITH;
TOP = 24.;

381

382

II. -

LEFT = 252, ;
HEIGHT = 23,;
WIDTH = 23,;
INTERVAL = 2000,;
NAME = "TIMER1"
ADD OBJECT IMAGE1 AS IMAGE WITH;
PICTURE = "..\PROGRAM FILES\MICROSOFT VISUAL
^STUDIO\VFP98\FOX.BMP", ;
STRETCH = 1,;
HEIGHT - 48,;
LEFT = 300,;
TOP = 72,;
WIDTH - 84,;
NAME = "IMAGE1"
ADD OBJECT LABEL2 AS LABEL WITH;
AUTOSIZE = .T.,;
FONTBOLD = .T.,;
FONTSIZE = 22, ;
BACKSTYLE = 0, ;
CAPTION - "THE OLD FOX HOTEL",;
HEIGHT = 37, ;
LEFT = 65,;
TOP = 81,;
WIDTH = 251,;
FORECOLOR = RGB(255,255, 255) , ;
NAME = "LABEL2"
ADD OBJECT IMAGE2 AS IMAGE WITH;
PICTURE = "..\PROGRAM FILES\MICROSOFT VISUAL
4>STUDIO\VFP98\FOX.BMP",;
STRETCH = 1,;
HEIGHT = 48,;
LEFT = 0,;
TOP = 72,;
WIDTH = 84,;
NAME "IMAGE2"
PROCEDURE TIMER1.TIMER
THISFORM.RELEASE()
ENDPROC
ENDDEFINE
*
* ENDDEFINE: SPLASH

,
? -

28.

383

. "" .
"" (. 28.3).

. 28.3. ""

: Label ( caption
) Timer,
Timer :
WITH THIS.PARENT
IF .LABELl.LEFT < .WIDTH
.LABEL1.LEFT = .LABELl.LEFT + 1
ELSE
.LABELl.LEFT = -.LABEL1.WIDTH
ENDIF
ENDWITH

- , ? PARENT. :
PARENT ,
. .
(
interval)
.
28.2.
28.2. ""
* PARENTCLASS:
CONTAINER
* BASECLASS:
CONTAINER
DEFINE CLASS RUNNING_STRING AS CONTAINER
WIDTH = 647
HEIGHT = 2 1
NAME = "MYCLASS"
ADD OBJECT LABELl AS LABEL WITH;
CAPTION = "LABELl",;
HEIGHT = 17,;
LEFT = 120,;
TOP = 4, ;
WIDTH = 4 0, ;
NAME = "LABELl"

II. -

384

ADD OBJECT TIMER1 AS TIMER WITH;


TOP = 4, ;
LEFT = 288, ;
HEIGHT = 23,;
WIDTH = 23, ;
NAME = "TIMER1"
PROCEDURE TIMER1.TIMER
WITH THIS.PARENT
IF .LABEL1.LEFT < .WIDTH
.LABEL1.LEFT = .LABEL1.LEFT + 1
ELSE
.LABEL1.LEFT = -.LABELl.WIDTH
END IF
ENDWITH
ENDPROC
ENDDEFINE
* ENDDEFINE: RUNNING_STRING

- (
...).
.
,
, . 28.4.

. 28.4.

28.3.
I 28.3.
i

*-- CLASS:
* PARENTCLASS:
* BASECLASS:

SWATCH (C:\OLDFOX\MYLIB.VCX)
FORM
FORM

DEFINE CLASS SWATCH AS FORM


TOP = 21
LEFT = 77
HEIGHT = 7 7
WIDTH = 258

28.
D0CREATE - ..
B0RDERSTYLE =
CAPTION = "FORM1"
TITLEBAR =
BACKCOLOR = RGB(0,0,0)
HOUR =
MINUTES =
SEC =
NAME = "F0RM1"
ADD OBJECT TIMERl AS TIMER WITH;
TOP = 48,;
LEFT = 120,;
HEIGHT = 23, ;
WIDTH = 23,;
INTERVAL = 1000,;
NAME = "TIMERl"
ADD OBJECT LABEL1 AS LABEL WITH;
AUTOSIZE = .T.,;
FONTITALIC = .T.,;
FONTSIZE - 28,;
ALIGNMENT = 2,;
CAPTION = "",;
HEIGHT 46,;
LEFT = 125, ;
TOP = 2, ;
WIDTH = 2,;
FORECOLOR = RGB(255,255, 255) , ;
BACKCOLOR = RGB(0,0,0),;
NAME = "LABELl"
ADD OBJECT CCMMANDl AS COMMANDBUTTON WITH;
TOP = 48,;
LEFT = 4,;
HEIGHT = 27,;
WIDTH = 60,;
CAPTION = "",;
NAME = "COMMAND1"
ADD OBJECT COMMAND2 AS COMMANDBUTTON WITH;
TOP = 48,;
LEFT = 68,;
HEIGHT = 27,;
WIDTH = 57,;
CAPTION - "",;
NAME = "CCMMAND2"

385

386

II. -
ADD OBJECT COMMAND3 AS CQMMANDBUTTON WITH;
TOP = 48,;
LEFT = 130, ;
HEIGHT = 27,;
WIDTH = 57, ;
CAPTION = "",;
NAME = "COMMAND3"

ADD OBJECT COMMAND4 AS COMMANDBUTTON WITH;


TOP = 48, ;
LEFT = 192,;
HEIGHT = 27,;
WIDTH = 57,;
CAPTION = "",;
NAME = "COMMAND4"
PROCEDURE INIT
PUBLIC MINUTES,HR,NSECONDS
MINUTES=0
HR=0
NSECONDS=0
ENDPROC
PROCEDURE TIMER1.TIMER
NSECONDS=NSECONDS+l
IF NSECONDS=60
NSECONDS=0
MINUTES=MINUTES+1
THISFORM.LABEL1.CAPTION=ALLTR(STR(HR))+":"+ALLTR(STR(MINUTES))+;
":"+ALLTR(STR(NSECONDS))
ENDIF
****************+*********

THISFORM.LABEL1.CAPTION=ALLTR(STR(HR))+":"+ALLTR(STR(MINUTES))+;
":"+ALLTR(STR(NSECONDS))
IF MINUTES=60
MINUTES=0
HR=HR+1
THISFORM.LABEL1.CAPTION=ALLTR(STR(HR))+":"+ALLTR(STR(MINUTES))+;
":"+ALLTR(STR(NSECONDS))
ENDIF
******************************
IF HR=24
HR=0
NSECONDS=0
MINUTES=0

28.

387

THISFORM. LABEL1.CAPTI0N==ALLTR(STR(HR))+":"+ALLTR(STR(MINUTES))+;
":"+ALLTR(STR(NSECONDS))
END IF
ENDPROC
PROCEDURE COMMAND1.CLICK
THISFORM.TIMER1.INTERVAL=0
ENDPROC
PROCEDURE COMMAND2.CLICK
THISFORM.TIMER1.INTERVAL=1000
ENDPROC
PROCEDURE COMMAND3.CLICK
THISFORM. TIMER1. INTERVALS
THISFORM.LABEL1.CAPTION="0:0:0"
MINUTES=0
HR=0
NSECONDS=0
ENDPROC
PROCEDURE COMMAND4.CLICK
THISFORM.RELEASE()
ENDPROC
ENDDEFINE
*
* ENDDEFINE: SWATCH

Timer. ,
- .
Grid. ,
Grid.
Timer:
THISFORM.GRID.REFRESH

29


Form, Visual FoxPro.
,
. "" MessageBox.
, . , . 29.1.

. 29.1. Form
. 29.2.

. 29.2. Form
29.1.
29.1. MyMessageBox
*-- CLASS:
* PARENTCLASS:
* BASECLASS:

MYMESSAGEBOX (C:\OLDFOX\MYLIB.VCX)
FORM
FORM

29. 389
DEFINE CLASS MYMESSAGEBOX AS FORM
HEIGHT - 40
WIDTH - 155
DOCREATE - .T.
AUTOCENTER - .T.
CAPTION - " ?"
CLOSABLE - .P.
MAXBUTTON - .F.
MINBUTTON - .F.
ICON = "..\PROGRAM FILES\MICROSOFT VISUAL
4>STUDIO\COMMON\GRAPHICS\ICONS\MISC\QUESTION.ICO"
WINDOWTYPE = 1
BACKCOLOR = RGB(255,255,255)
NAME = "MYMESSAGEBOX"
ADD OBJECT SHADOWBUTTON1 AS SHADOWBUTTON WITH;
TOP = 6, ;
LEFT - 3,;
WIDTH = 69, ;
HEIGHT = 30, ;
NAME = "SHADOWBUTTON1",;
COMMAND1.CAPTION = "",;
COMMANDl.NAME = "COMMAND1"
ADD OBJECT SHADOWBUTTON2 AS SHADOWBUTTON WITH;
TOP = 6, ;
LEFT * 80,;
WIDTH - 69, ;
HEIGHT = 30, ;
NAME - "SHADOWBUTTON2",;
COMMAND1.CAPTION = "",;
COMMAND1.NAME = "COMMANDl"
PROCEDURE SHADOWBUTTONl.COMMANDl.CLICK
CLOSE ALL
CLEAR EVENTS
QUIT
ENDPROC
PROCEDURE SHADOWBUTTON2.COMMANDl.CLICK
THISFORM.RELEASE()
ENDPROC
ENDDEFINE
* ENDDEFINE: MYMESSAGEBOX

, , MessageBox
CommanddButton, a

390

II. -

- shadowButton? ,
...
, ,
MessageBox ( 29.2).
29.2. ShadowButton
DEFINE CLASS SHADOWBUTTON AS CONTAINER
WIDTH = 86
HEIGHT = 30
BACKCOLOR = RGB(0,0,0)
NAME = "SHADOWBUTTON"
ADD OBJECT COMMANDl AS COMMANDBUTTON WITH;
TOP = 0,;
LEFT - 0,;
HEIGHT - 27,;
WIDTH = 84,;
CAPTION = "COMMANDl",;
NAME = "COMMAND1"
PROCEDURE INIT
THIS.COMMAND1.WIDTH=THIS.WIDTH-2
THIS.COMMAND1.HEIGHT=THIS.HEIGHT-2
THIS.COMMANDl.FONTSIZE=THIS.COMMANDl.HEIGHT/4.5
ENDPROC
ENDDEFINE

,

.
. .
. 29.3.
:
Firstheight ;
Firstwidth ;
Nkofh ;
Nkofw ;
Amas[i,i]
;
Nkolm ;

29.

391

Nb1,Nb2
Fontsize ( );
Ndelta Fontsize.

. 29.3.

? ,
. 29.4.
"" Recurs.
29.3.

. 29.4.

392

II. -

29.3. Recurs
LPARAMETERS OOBJ, LP
LOCAL NTOTMEM,I,AMEMS[1],1
Ml - 7
WITH OOBJ
IF THISFORM.NAME # .NAME OR THISFORM.BASECLASS # .BASECLASS
IF TYPE("OOBJ.TOP") - "N" OR TYPE("OOBJ.HEIGHT") - "N";
OR TYPE("OOBJ.LEFT") - "N" OR TYPE("OOBJ.WIDTH") = "N";
OR TYPE("OOBJ.FONTSIZE") - "N"
THISFORM.NKOLM = THISFORM.NKOLM + 1
IF

!LP

DIMENSION THISFORM.AMAS[THISFORM.NKOLM,Ml]
IF TYPE("OOBJ.TOP") = "N"
THISFORM.AMAS[THISFORM.NKOLM,1] =COBJ.TOP
ENDIF
IF TYPE("OOBJ.HEIGHT") = "N"
THISFORM.AMAS[THISFORM.NKOLM,2] = OOBJ.HEIGHT
ENDIF
IF TYPE("OOBJ.LEFT") = "N"
THISFORM.AMAS[THISFORM.NKOLM,3] = OOBJ.LEFT
ENDIF
IF TYPE("OOBJ.WIDTH") = "N"
THISFORM.AMAS[THISFORM.NKOLM,4] = OOBJ.WIDTH
ENDIF
IF TYPE("OOBJ.HEADERHEIGHT") = "N"
THISFORM.AMAS[THISFORM.NKOLM,5] =OOBJ.HEADERHEIGHT
ENDIF
IF TYPE("OOBJ.ROWHEIGHT") = "N"
THISFORM.AMAS[THISFORM.NKOLM, 6] = OOBJ.ROWHEIGHT
ENDIF
IF TYPE("OOBJ.FONTSIZE") = "N"
THISFORM.AMAS[THISFORM.NKOLM,7] =OOBJ.FONTSIZE
ENDIF
ELSE
IF TYPE("OOBJ.TOP") = "N"
OOBJ.TOP = THISFORM.AMAS[THISFORM.NKOLM,1]*THISFORM.NKOFH
ENDIF
IF TYPE("OOBJ.HEIGHT") = "N"
OOBJ.HEIGHT = THISFORM.AMAS[THISFORM.NKOLM,2]*THISFORM.NKOFH
ENDIF
I F TYPE("OOBJ.LEFT") = " N "

OOBJ.LEFT = THISFORM.AMAS[THISFORM.NKOLM,3]*THISFORM.NKOFW
ENDIF

29.

393

IF TYPEC'OOBJ.FONTSIZE") = "N"
IF (THISF0RM.AMAS[THISF0RM.'NK0LM,7]*THISTORM.NK0FH)-THISF0RM.NDELTA > 4
OOBJ.FONTSIZE = (THISFORM.AMAS[THISFORM.NKOLM,7]*THISFORM.NKOFH)THISFORM.NDELTA
ELSE
OOBJ.FONTSIZE = 4
THISFORM.NDELTA = THISFORM.NDELTA - 1
ENDIF
ENDIF
IF TYPE("OOBJ.WIDTH") = "N"
IF (OOBJ.BASECLASS ="LABEL" AND !.WORDWRAP);
OR OOBJ.BASECLASS ="CHECKBOX"
IF (TXTWIDTH(OOBJ.CAPTION,OOBJ.FONTNAME,OOBJ.FONTSIZE))*;
FONTMETRIC(6,OOBJ.FONTNAME,OOBJ.FONTSIZE) > OOBJ.WIDTH
THISFORM.NB1 = 1
THISFORM.NB2 = 0
ENDIF
IF (TXTWIDTH(OOBJ.CAPTION,OOBJ.FONTNAME,OOBJ.FONTSIZE+1)) *;
FONTMETRIC(6,OOBJ.FONTNAME,OOBJ.FONTSIZE+1) > OOBJ.WIDTH
THISFORM.NB2 = 0
ENDIF
ENDIF
OOBJ.WIDTH = THISFORM.AMAS[THISFORM.NKOLM,4]*THISFORM.NKOFW
ENDIF
IF TYPEC'OOBJ.HEADERHEIGHT") = "N"
OOBJ.HEADERHEIGHT = THISFORM.AMAS[THISFORM.NKOLM,5]*THISFORM.NKOFH
ENDIF
IF TYPE("OOBJ.ROWHEIGHT") = "N"
OOBJ.ROWHEIGHT = THISFORM.AMAS[THISFORM.NKOLM,6]*THISFORM.NKOFH
ENDIF
ENDIF
ENDIF
ENDIF
NTOTMEM = AMEMBERS(AMEMS,OOBJ,2)
FOR I = 1 TO M.NTOTMEM
OOBJ = EVAL("."+AMEMS[M.I])
IF TYPE("."+AMEMS[M.I]) = "0"
THISFORM.RECURS(OOBJ, LP)
ENDIF
ENDFOR
ENDWITH

New Method ( )
Form (),

394

(I. -

Add ().
Properties.
Default ( )

.
init :
THISFORM.FIRSTHEIGHT=THISFORM.HEIGHT
THISFORM.FIRSTWIDTH=THISFORM.WIDTH
THISFORM.NKOLM = 0
THISFORM.NDELTA = 0
THISFORM.RECURS (THISFORM, .F.)
Resize:
THISFORM.NKOFH = THISFORM.HEIGHT/THISFORM.FIRSTHEIGHT
THISFORM.NKOFW = THISFORM.WIDTH/THISFORM.FIRSTWIDTH
THISFORM.NKOLM = 0
THISFORM.NB1 = 0
THISFORM.NB2 = 1
THISFORM.RECURS(THISFORM, .T.)
IF (THISFORM.NB2 > 0 AND THISFORM.NDELTA > 0);
OR (THISFORM.NB1 > 0)
THISFORM.NDELTA = THISFORM.NDELTA + THISFORM.NB1
THISFORM.NDELTA = THISFORM.NDELTA - THISFORM.NB2
ENDIF

! ,
?
Save As Class ( ) File
() . 29.5.

. 29.5. Save As Class

29.

395

Save As Class ( )
, .
, ,
. 29.6, 29.7.

. 29.6.

. 29.7.

, . -
?
Visual FoxPro. Options ()
Tools () . 29.8.

396

II. -

. 29.8. Options

Forms ()
Template classes () Form (),
Form Template ( ) (. 29.8).
, Class Name
( ) .

.

. 29.9. Form Template

30


TooiBar ( )
. ,
, , ,
, .
. 30.1.

. 30.1.

398

II. -

? 30.1.
30.1.
DEFINE CLASS MY_NAVIGATOR AS TOOLBAR
CAPTION = ""
HEIGHT = 4 0
LEFT = 0
TOP = 0
WIDTH = 136
NAME = "MY_NAVIGATOR"
ADD OBJECT COMMANDl AS COMMANDBUTTON WITH;
TOP = 5,;
LEFT - 5,;
HEIGHT - 31,;
WIDTH = 34,;
PICTURE = "..\PROGRAM FILES\MICROSOFT VISUAL
->STUDIO\COMMON\GRAPHICS\ICONS\ARROWS\ARW06UP. ICO", ;
CAPTION = "",;
TOOLTIPTEXT = " ",;
NAME - "COMMANDl"
ADD OBJECT COMMAND2 AS COMMANDBUTTON WITH;
TOP = 5,;
LEFT - 38,;
HEIGHT = 31,;
WIDTH - 32,;
PICTURE = "..\PROGRAM FILES\MICROSOFT VISUAL
^STUDIO\COMMON\GRAPHICS\ICONS\ARROWS\ARW06RT.ICO",;
CAPTION = "",;
TOOLTIPTEXT = " ",;
NAME = "COMMAND2"
ADD OBJECT COMMAND4 AS COMMANDBUTTON WITH;
TOP - 5,;
LEFT - 69,;
HEIGHT = 31,;
WIDTH = 34,;
PICTURE = "..\PROGRAM FILES\MICROSOFT VISUAL
4>STUDIO\C(M4ON\GRAPHICS\ICONS\ARROWS\ARW06DN. ICO", ;
CAPTION = "",;
TOOLTIPTEXT = " ",;
NAME = "COMMAND4"

30.

399

ADD OBJECT COMMAND3 AS COMMANDBUTTON WITH;


TOP - 5,;
LEFT = 102, ;
HEIGHT = 31,;
WIDTH = 29, ;
PICTURE = "..\PROGRAM FILES\MICROSOFT VISUAL
"bSTUDIO\COMMON\GRAPHICS\ICONS\ARROWS\ARW06LT.ICO", ;
CAPTION = "",;
TOOLTIPTEXT = " ",;
NAME - "COMMAND3"
PROCEDURE COMMAND1.CLICK
IF !BOF()
GO TOP
_SCREEN.ACTIVEFORM.REFRESH()
ENDIF
ENDPROC
PROCEDURE COMMAND2.CLICK
IF !EOF()
SKIP
_SCREEN.ACTIVEFORM.REFRESH()
ENDIF
ENDPROC
PROCEDURE COMMAND4.CLICK
IF !EOF()
GO BOTTOM
_SCREEN.ACTIVEFORM.REFRESH()
ENDIF
ENDPROC
PROCEDURE COMMAND3.CLICK
IF !BOF()
SKIP -1
_SCREEN.ACTIVEFORM.REFRESH()
ENDIF
ENDPROC
ENDDEFINE


. 30.2.
,
, Visual FoxPro,
.

400

II. -

. 30.2.

3 1


,
.

Class Browser
Visual FoxPro ,
: , ,
. Class Browser (
). : Tools
() Class Browser ( )
: DO (BROWSER) .
, . 31.1.

. 31.1. Class Browser

402

II. -

,
. 31.1.
31.1. Class Browser

Class Browser ( )
. 31.2.
. 31.2.

31.

403

. 31.2.
31.2. Class Browser

Descriptions ()


Class
Browser

Always on Top
( )

, Class Browser

Auto Expand
( )

Parent Class Toolbar


( )

Restore Defaults (
)

Class Browser

Hierarchical ()

Protected ()

Hidden ()

Empty ()

404

II. -
31.2 ()

Modify ()

()

Rename ()

Redefine ()

Remove ()

View ()

Container Icon ()

Select Parent Class ()

New Window ( )

Class Browser

New Component Gallery


( )

Refresh ()

Help ()

Class Browser



Class
Info ( ) (. 31.3).
Class.
: Class () Members ().
Class () ()
. , : Toolbar
icon ( )
Form Controls, Container icon
( ) Class Browser. He
, ,
,
, "

31.

405

" . 187
, ...
Members () . 31.4.

. 31.3. Class Info, Class

. 31.4. CJass Info, Members

406

II. -

,
. Name () ,
Visibility () : Public (),
Protected () Hidden (). No Init
init .
Modify () Edit Property/Method
( ) (. 31.5),
,
( New Property New Method). Remove (
), .

. 31.5. Edit Property/Method

Name () ,
, () ( , , ). Access Assign , -
. Visibility .

32


Visual FoxPro
,
, ... ! " "?
, , , ,
.
, .
-. -
. ? .
.
( !).
,
Visual FoxPro.
. Visual FoxPro
,
.
"" vex, ,
"", Foundation Classes (
). ""
- ? . 32.1.
32.1. Visual FoxPro

About Dialog

_dialogs.vcx


About

ActiveX Calendar

_datetime.vcx

Application
Registry

Registry.vcx

, Win
dows

408

//. -
32.1 ()

Array Handler

jjtility.vcx

Cancel Button

_miscbtns.vcx

Cancel (),

Clock

_datetime.vcx

C o n f l i c t Catcher

_dataqwery.vcx

Cookies Class

Jntenet.vcx

FoxISAPI

Cross Tab

_utility.vcx

Data E d i t Button

Wizbtns.vcx

.
Top, Previous, Next, Bottom,
Find, Print, Add, Delete, Edit, Save (
, , ,
, , , , ,
, )

Data Navigation
Buttons

_datanav.vcx

(Top, Previous, Next,


Bottom) (, ,
, )

Data Session
Manager

_app.vcx

Data V a l i d a t i o n

_datanav.vcx

Data Navigation
Object

Jable.vcx



()

_dbf3html

Jnternet.vcx

HTML

D i s t i n c t Values
Combo

_dataqwery.vcx

(ComboBox)

Error Object

_app.vcx

F i e l d Mover

_app.vcx

,

. (

Grid)

F i l e Version

_utility.vcx

32.

Visual

FoxPro

409

32.1 ()

F i l t e r Dialog Box
Button

Jable.vcx

,
Filter ()

F i l t e r Dialog Box

Jable.vcx

Filter ()

Find Button

Jable.vcx

Find Dialog Box

Jable.vcx

Find Object

Jable.vcx

Find (Find Next)


Buttons

_utility.vcx

Find () Find Next (


)

Font Combobox

Jormat.vcx

Font Size Combobox

Jormat.vcx

Format Toolbar

Jormat.vcx

FRX-HTML

Jnternet.vcx

VFP (
frx) HTML

G e t f i l e and
Directory

_controls.vcx

Goto Dialog Box


Button

Jable2.vcx

,
Goto

Goto Dialog Box

Jable.vcx

Graph by Record

_utility.vcx

Graph Object

_autgraph.vcx

Graph Wizard (
())

Help Button

jniscbth.vcx

, ,
HelpContextld

Hyperlink Button

Jiyperlink.vcx

, Web-

Hyperlink Image

Jiyperlink.vcx

Hyperlink Label

Jiyperlink.vcx

, Web-

Web-

410

II. -
32.1 ()

Item Locator

_dialogs.vcx

I N I Access

Registry.vcx


Windows
INI-

Keywords Dialog Box

_dialogs.vcx

Launch Button

jnsicbtn.vcx

.
RUN

Locate Button

Jable2.vcx

,
,
Locate

Lookup Combobox

_dataquery.vcx

ComboBox,

M a i l Merge Object

Mailmerge.vcx

, Mail Merge
Wizard ( )
Word

Messagebox Handler

_dialogs.vcx

MESSAGEBOX ()

Mover

_movers.vcx

MouseOver E f f e c t s

_ui.vcx

Navigator Shortcut
Menu

_table2.vcx

Navigation Toolbar

_table2.vcx

Object State

_app.vcx

ODBC R e g i s t r y

Registry.vcx

ODBC
Windows

O f f l i n e Switch

_dataquery.vcx

,
Online- Offline-

OK Button

_miscbtn,vcx

32. Visual FoxPro

411
32.1 ()

Output Object

_reports.vcx

Output Controls

_reports.vcx

Output Dialog Box

_reports.vcx

Password Dialog Box

_dialogs.vcx

Pivot Table

_pivtable.vcx

Pivot Table Wizard


Excel

Preview Report

_miscbtn.vcx

QBF

_dataquery.vcx

R e g i s t r y Access

Registry, vex


Windows

Resize Object

_controls.vcx

RTF Controls

_format.vcx


RTF

Run Form Button

_miscbtn.vcx

SCX-HTML

_innternet.vcx

FRX
HTML

Sendmail Button

_miscbtn.vcx

S h e l l Execute

_environ.vcx

Shortcut Menu Class

_menu.vcx

Simple E d i t Buttons

Wizbtns.vcx

Add, Delete, Edit,


Dublicate, Save, Cancel (,
, , ,
, )

Simple Picture
Navigation Buttons

_table.vcx

Next (
) Previous ()

412

II. -
32.1 ()

Simple Navigation
Buttons

.table, vex-

Next ()
Previous ()

Sort Dialog Box


Buttons

Jable2.vcx

Sort Object

Jable2.vcx

Sort Selector

_table2.vcx

Sort Mover

_movers.vcx

Sound Player

jnutimedia.vcx

Splash Screen

_dialogs.vcx

SQL Pass Through

_dataquery.vcx


SQL Path Through

Stop Watch

_datetime.vcx

String Library

_utility.vcx

Super Mover

_movers.vcx

.
Move, Remove, MoveAII, RemoveAII (, ,
, )

System Toolbar

_app.vcx

Table Mover

_movers.vcx

Text Preview

Thermometer

_controls.vcx

Trace Aware Timer

_app.vcx

32. Visual FoxPro

413
32.1 ()

Type

_utility.vcx

URL Combo

_intemet.vcx

URL O p e r a t i o n
D i a l o g Box

_internet.vcx

VCR B u t t o n s

_table.vcx

VCR P i c t u r e s
Navigation Buttons

_table.vcx

Video

_multimedia.vcx

Web Browser C o n t r o l

_webview.vcx


Internet Explorer

Window

_ui.vcx

Library

Player

Handler

,
: " ? ?" ,
.
, ?
,
.


(Component Gallery)
,
, , , . .
, . . , ,

( ) .
:
Component Gallery ( ) Tools
() DO (GALLERY) .
. 33.1.

. 33.1. Component Gallery

33. (Component Gallery)

415

, . ,
, , ,
, .

. 33.1.
33.1.

Catalogs

VFP Main

Favorites

Visual FoxPro

Visual FoxPro,
, , . .,

Data

Foundation Classes

Help

Templates

(Wizard)

Tools

My Base Classes

Visual FoxPro

ActiveX


ActiveX

World Wide Web

Web-, Visual
FoxPro

Multimedia

(, ,
),

Samples

416

II. -

Component Gallery
. 33.2.
33.2.

. 33.2. Open

33. (Component Gallery)

417

. 33.3. Component Gallery Options, Standard

Standard ()
(. 33.3). Standard ()
. 33.3.
33.3. Standard

Global defaults ( )
Enable item renaming
( )

FFC Builder Lock ( )

Drag and drop to desktop (


)


.
(, )

Advanced editing enabled


(
)



(Type, Scripts,
Views, Comments) (, ,
, )

II. -

418

33.3 ()

Catalog default behavior ( )


Open file as new view ( )

,
,
,
,

Add file to current view ( )

,
,
,
,

Item default behavior ( )


Modify item file ( )

Run item file ( )

. 33.4. Component Gallery Options, Catalogs

Catalogs ()
(. 33.4).
, New ().

33. (Component Gallery)

419

. 33.5. View Type


View Type ( ) . 33.5
,
. (. . 33.7),
Dynamic Views (
) . 33.6.

. 33.6. Component Gallery Options, Dynamic Views

420

II. -

. 33.7. Edit View


.
. ,
, ,
Foundation Classes ( ), Buttons
(). OK Button
. DateTime
(/), Clock ()
.
Add to form ( ).
. 33.8.

. 33.8.

, ,
, . , ?
,
,
Drag and Drop ( ).
,
.
, -? ,
-.

33. (Component Gallery)

421

1. Dialogs ( )
Splash Screen.
Create Form ( ).
2. ,
,
. 33.9.

. 33.9.




, .
1. (Catalogs)
New Application ( ).
2. Enter Project Name ( )
(. 33.10). , ,
(Application Builder).

422

II.

. 33.10. Enter Project Name

!
, .
Applications () Templates () (. 33.11).

. 33.11.


, , .
, ( , )
, , ,
( ) , ,
. . , ,
Visual FoxPro. ? ,
, ,
...
Visual FoxPro , , ,
,
. "" ,
FoxPro.
:
http://www.microsoft.com/rus/ Microsoft .
http://msdn.microsoft.com/vfoxpro/default.asp Microsoft Visual FoxPro.
:
www.newsletter.narod.ru/foxtaIk/FoxTalk.htm "FoxTalk".
:
www.firststeps.ru " " . ., ,
.
www.infocity.kiev.ua "
" .
www.universalthread.com Michel Fournier, Nick Neklioudov, Evan Delay,
Gerald Santerre, Claudio Lassala, MartHn SalHas.
:
www.dbrad32.narod.ru .
www.wet.narod.ru .

424

www.Foxpopuli.narod.ru .
www.clickexpIorer.narod.ru .
www.vfpdev.narod.ru .
www.nsvisual.com/fox2 .
www.foxuser.by (nm) (boom).ru .
www.skc.narod.ru .
www.urfin.boom.ru .
www.foxtools.newmail.ru .
www.dushes.hotbox.ru .
www.sumarokov.nm.ru .
www.vfp.narod.ru .
:
http://talk.mail.ru/forum/fido7.ru.foxpro FPD.
http://talk.mail.ru/forum/fido7.ru.visual.foxpro VFP.
http://ljuda_m.chat.ru/foxolb_07_02.rar
FoxPro Alex Kise.
,
. :

;
,
;
.
, , ,
, .
!

foxbook@list.ru


Visual FoxPro
, Visual FoxPro,
Options () Options
(/) Tools () (. 1.1).

. 1.1. Options


. 1.2.

428

. 1.2. Options

,
, . 1.1.
1.1. Options

Controls ( )

OLE

Data ()

Debug ()

Field Mapping ()

,

Data Environment ( ),
Database Designer ( )

File Locations
( )

Forms ()

General ( )

Projects ()

Visual FoxPro

429
1.1 ()

Regional
( )

, ,

Remote Data ( )

Syntax Coloring (
)

View ()


, ,

.
Controls ( ) (. 1.3)
, ActiveX (
).
Add (), Remove ().

. 1.3. Options, Controls

Data () (. .4)
, . 1.2.

430

. 1.4. Options, Data

1.2. Data

Open exclusive
( )

,
.

,
(
)

Show field names


( )

SUM,

DISPLAY, AVERAGE, L I S T ,

.
SET HEADING
Prompt for code page
(
)

,
. ,
FoxPro for DOS
Code Page.
SET CPDIALOG

Ignore deleted records


( )

,
"" . ,
DELETE ,
.
,

. SET DELETED

Visual FoxPro

431
1.2 ()

Rushmore optimization
( Rushmore)

,
, Rushmore.

. SET O P T I M I Z E

Unique records in indexes


( )

SET UNIQUE.


, ,

Collation sequence
( )



. SET COLLATE

Record counter interval


( )



, PACK
RE INDEX. SET ODOMETR.

1
32 787,

, . .

Memo block size
( -)

SET BLOCKS IZE


Memo-

Browse refresh interval


(
)

,
( ) Browse

. SET REFRESH

Table refresh interval


( )

,
( ) (
Browse)

SET NEAR on
( )


. ,

.

,
.
SET NEAR

SET EXACT on
( )

.

,
. . , .
SET EXACT

432

1.2 ()

SET ANSI on
( ANSI)


,
.
,
.
SET ANSI

( )
Automatic file locking
(
)

SET LOCK

Multiple record locks


( )

SET MULTILOCKS

Debug () (. 1.5)
(. 1.3).

. 1.5. Options, Debug

Visual FoxPro

433

1.3. Debug

Environment ()

.
Debug Frame ( )
Visual
FoxPro Debugger ( Visual FoxPro).
FoxPro Frame
Visual
FoxPro

Display Timer Events


( )

Specify Window
( )

,
,
. .

. 1.6. Options, Field Mapping

Field Mapping () (. 1.6)


.
? : ,
,

434

. , , Logical
, .
. , "" Visual FoxPro.
(Database options) . 1.4.
1.4. Database options

Drag and drop field caption


(" "
)



Caption

Copy field comment


( )

Copy field input mask


( )

Copy field format


( )

, - ,
Modify ()
Modify Field Mapping ( )
(. 1.7).

. 1.7. Modify Field Mapping


. ,
? File Locations ( ) (. 1.8) -

Visual FoxPro

435

,
(. 1.5).

. 1.8. Options, File Locations


1.5. Visual FoxPro

( )

ActiveDoc Launcher


, Run
Active Doc (
) Tools ()

Runactd.prg

Builders


(Builder)

Builder.app

Class Browser


Class Browser

Browser.app

Component Gallery


Component Gallery

Galery.app

Converter


,
,
FoxPro

Converter.app

436

1.5 ()

Coverage Profiler

Default Directory

,
Visual FoxPro

Default Include File

Documenting Wizard

Expression Wizard

HTML Generator


,

HTML

Help File

Menu Builder

Resource File

.
FOXUSER.DBF-
,
,
, . .

Samples Directory


Visual FoxPro

Search Path

,
,

Spelling Checker

Startup Program


,
Visual FoxPro

( )
Coverage.

Beautify.app

GetbtmJ.app

Vfp6strt.app

Visual FoxPro

437
1.5 ()

Temporary Files

Wizards

( )

Forms () (. .9)
. . .6.

. 1.9. Options, Forms


1.6. Forms

Grid lines ( )

Horizontal spacing
( )


( )

Vertical spacing
( )


( )

438

1.6 ()

Snap to grid ( )

Show position ( )

Tab ordering ( )

, I

. : Interactive
() By list ( ).
Interactive (. 1.10)


<Srft>
.
By list (. 1.11)

Scale units ( )


.
:

Maximum design area


( )

Template classes
( )

Builder lock
( )

Prompt to save changes before


running form (
)

Genera] ( *) (. 1.12) , < , . .


,
, WJirning sound ( )
(. 1.7).

dBase
compatibility ( dBase). , Visual
FoxPro ,
FoxPro (, FoxPro for DOS). ,
, . 1.8, -.

Visual FoxPro

. 1.10.

. 1.11.

439

440

. 1.12. Options, General


1.7. Warning sound

Off ()

Default ( )

(512 ) (2 )

Play ()

1.8.

RANGE

ON

OFF

GET

SAY

SAY

CHR

CHR ()

Visual FoxPro

441
1.8 ()

SAY

ON

OFF

PICTURE

PICTURE

ACTIVATE SCREEN



0,0

ACTIVATE WINDOW


0,0

APPEND MEMO


txt

DECLARE



DIMENSION

FSIZE

GO/GOTO (
SET TALK ON)

INKEY()

<Shift>
<Shift>+<Home>
26,
<Ctrl>+<Left>
1

<Shift>
<Shift>+<Home>
1,
<Ctrl>+<Left>
26

LASTKEY()

LIKEO

MENU POPUP

CLEAR GETS

GETS

,
,

,
,

INKEY()

442

1.8 ()

ON

OFF

PLAY MACRO


<Alt>+<F10>
,
AZ,
F1 F9
<Alt>

READ

<F_sc>

V A L I D

RUN



24 .

3


.

2

SELECT ()

SET COLOR TO


COLOR OF SCHEME

SET BORDER

SET FIELDS

SET MEMOWIDTH

SET MESSAGE


SET
STATUS ON

SET PRINTER TO


prt

STORE

SUM




SET DECIMALS TO

Visual FoxPro

443
1.8 ()

ON

OFF

SYS(2001,"COLOR")

,
SET
COLOR


SET
COLOR TO

TRANSFORM

USE

VFP

,

VFP

,

,

Use Visual FoxPro color palette (


Visual FoxPro),
.
, .
SET PALETTE.
Confirm file replacement ( ) ,
.
SET SAFETY.
Browse IME Control ( IME)
. IME
Input Method Editor ( ).
General ( ) ,
:
Cancel programs on escape (
<Esc>). SET ESCAPE;
Log compilations errors ( )

.
err;
SET DEVELOPMENT ( )
,
. ,
.
Navigation keys ( )
: Windows Compatible MS-DOS Compatible (,

444

Windows DOS).
SET KEYCOMP.
Fill new records with current values (
)
. SET CARRY.
Enter or tab to exit fields ( <Enter>
<Tab> ),
, <Enter> <>.

. 1.13. Options, Projects

Projects () (. 1.12)
. Project double-click action (,
) :
Run selected file ( )

;
Modify selected file ( )

. ,
.

Visual FoxPro

445

Prompt for Wizards ( )


"",
.
Display user-defined container icons ( ,
)
.
Source control options (
) (. 1.9). Microsoft Visual
SourceSafe (VSS),
Active source control provider (
).
1.9. Source control options

Automatically add new projects to source


control (

)

Check out files upon modify (


)


Microsoft
Visual SourceSafe

Add files to source control upon add


(

)


Microsoft
Visual SourceSafe

Remove files from source control upon


removal from project (

)

,
, .

Microsoft Visual SourceSafe

Display dialog box for shortcut menu


commands (
)


Microsoft Visual
SourceSafe

Text generation ( ) ,

Microsoft Visual SourceSafe VFP.
Project class ( ) ,
.
Regional () (. 1.14) ,
, , .
"" Use System Settings ( -

446

). ?

. , . .

. 1.14. Options, Regional

1.10. Regional

Date Format ( )

Date Separator ( )

Century ()

12-Hour, 24-Hour
(12 , 24 )

12- 24-

Seconds ()

Currency Format
( )

,

:

Visual

FoxPro

447

1.10 ()

Currency Symbol
( )


. SET CURRENCY TO

1000 Separator
( )

Decimal Separator
( )

Decimal Digits
( )


.
0 18.
SET DECIMALS TO

Week Starts on
( )

,
. ? ,
"" -...

First Week of Year


( )

: Contains Jan 1
( 1 ), First 4-Day Week (
4-) First Full Week (
)

Remote Data ( ) (. 1.15) ,



(. 1.11).
? ,
FoxPro.
1.11. Remote Data

Share connection
( )

Fetch memo
( -)

-
,
-.

Criteria ()

SQL.
: Key Fields Only
( ), Key and update Fields (
), Keys and Modified Fields
( ), Key and
TimeStamp ( )

448

1
1.11 ()

Method ( )

SQL Update (
)
SQL- update,
(SQL Delete + SQL Insert
) ,

Records to fetch at a time


( )

Maximum records to fetch


(
)

Use memo for fields >=


( memo
)


.

Memo

Records to batch update


(
)

,
SQL

Asynchronous execution
( )


,
SQL, a

Display warnings
( )

,
,
SQL

Batch processing
( )

Automatic transactions
(
)

, SQL
Visual FoxPro (
)

Show login
( )


.

: Always
(), Never (), Only When Neces
sary ( )

Connection timeout
( )

( ),

Visual FoxPro

449
1.11 ()

Idle timeout
( )

( ),
,
.
0 ( ),

Query timeout
(
)

,
.
,

Wait time ( )

,
,
SQL

. 1.15. Options, Remote Data

Syntax Coloring (
(. 1.16)
.
15 3. 1002

450

. 1.16. Options, Syntax Coloring

, "" ,
Area ():
Comments ;
Keywords ;
Literals ;
Normal ;
Operators ;
Strings ;
Variables .

Font style ( ):
Automatic ;
Normal ;
Bold ;
Italic ;
Bold italic .
Foreground ( ) Background (
) .

Visual FoxPro

451

. 1.7. Options, View

View () (. 1.16) ,
(. 1.12).
1.12. View

Status bar ( )

,

.
,

Clock ()

Command results
( )

System messages
( )

Recently used project list


(
)

File ()

452

1
1.12 ()

Open last project on startup


(
)

Visual FoxPro

? , ,
,
.
Set As Default ( ),
, . .
.



,
Visual FoxPro
.

. 2.1.
2.1. ""

""

File
()

New ()

<Ctrl>+<N>

Open ()

<Ctrl>+<0>

Save ()

<Ctrl>+<S>

Print ()

<Ctrl>+<P>

Undo ()

<Ctrl>+<Z>

Redo ()

<Ctrl>+<R>

Cut ()

<Ctrl>+<X>

()

<Ctrl>+<C>

Paste ()

<Ctrl>+<V>

Select All ( )

<Ctrl>+<A>

Find ()

<Ctrl>+<F>

Find Again ( )

<Ctrl>+<G>

Replace ()

<Ctrl>+<L>

Do ()

<Ctrl>+<D>

Resume ()

<Ctrl>+<M>

Do
( )

<Ctrl>+<E>

Edit
()

Program
()

454

2.1 ()

""

Window ()

Cycle ()

<Ctrl>+<F1>

Command Window ( )

<Ctrl>+<F2>

Format ()
EditBox, TextBox, Spinner . 2.2.
2.2. Format

SET DATE

Date BRITISH

TextBox


( )

TextBox

input Mask ( )
EditBox, TextBox, Spinner . 2.3.
2.3. input Mask


( SET CURRENCY)

""
""

SET DATE,

455

. 2.4.

2.4. SET DATE


SET DATE TO . . .

AMERICAN

//
..
//
--
//
..
//
//
--
//
//
//

ANSI
BRITISH
ITALIAN
FRENCH
GERMAN
JAPAN
TAIWAN
USA
MDY
DMY
YMD

. 2.5.
2.5.

Visual FoxPro 3.0 (DBF)

FoxPro for Windows 2.x (DBF)

FOX2X

FoxPro for
Windows 2.x

FoxBase+ (DBF)

FOXPLUS

FoxBase+
dBase IV

dBase IV (DBF)
Delimited Text
Microsoft Excel 5.0 (XLS)

XL5

Microsoft
Excel 5.0

Microsoft Excel 2.0, 3.0, 4.0


(XLS)

XLS

Microsoft
Excel 2.0, 3.0, 4.0

Lotus 1-2-3 2.x (WK1)

WK1

Lotus 1 -2-3 2.x

Lotus 1-2-3 1 -A (WKS)

WKS

Lotus 1 -2-3 1 -

456

2
2.5 ()

Symphony 1.10 (WR1)

WR1

Symphony 1.10

Symphony 1.01 (WRK)

WRK

Symphony 1.01

MultiPlan 4.01 (MOD)

MOD

Multiplan 4.01

Data Interchange Format (DIF)

DIF

,

VisCalc

System Data Format (SDF)

SDF

Symbolic Link Format

SYLK

,
Multiplan


MessageBox
, MessageBox,
. , , MessageBox
, . ,
:
MessageBox


, , , , .
, , , :
, , .
. 2.62.9.
2.6. ,

Cancel ()

Abort, Retry, Ignore (, , )

Yes, No, Cancel (, , )

Yes, No (, )

Retry, Cancel (, )


2.7. ,

16

Stop

32

48

64

(1)

2.8. ,

256

512

2.8. , MESSAGEBOX

Cancel ()

Abort ()

Retry ()

ignore ()

Yes ()

No ()

. 2.1. MessageBox

457

458

:
IF MESSAGEBOX(" ?",; 1+32+256,
" ")=1
QUIT
ENDIF

. 2.1.


,
, .


, , , DBF-,
USE
(. ). :
USE main.sex
BROWSE

? :
"Error loading file record number 5 main <or one of its membersX Methods
c:\oldfox\mine.scx is not an object file".
:
USE main.sex EXCL

, (record
number 5) Memo- objeode.
, mit
:
LOCAL I,WINDOWNAME,RETVAL
RETVAL=..
1=0
WINDOWNAME=WCHILD("", 0)
DO WHILE NOT EMPTY(WINDOWNAME)
IF WINDOWNAME=UPPER(THIS.NAME)
I=I+1

460
IF I>1
RETVAL=.F.
EXIT
ENDIF
END I F
WINDOWNAME=WCHILD("",1)
ENDDO
RETURN RETVAL

. 3.1.

?
Form | Edit Property/Method ( | /
). New Property (
). New Property ,
amassivfio], <Enter>.
:
FOR 1 = 1 10
THISFORM.AMASSIV[l] = I
ENDFOR

461


:
FOR EACH OFORM IN _VFP.FORMS
OFORM.RELEASE
ENDFOR

Grid

.
1. i n i t Grid :
SELECT XXXXXXXXXX

THISFORM.NRECNO = 1
IF RECNO()#0
THIS.SETALLC'DYNAMICBACKCOLOR", "IIF(RECNO() = THISFORM.NRECNO,
^RGB (255, 255,0), RGB (255, 255, 255) ) ", "COLUMN")
ENDIF
AfterRowColChange
THISFORM.NRECNO = RECNOO
THIS.REFRESH

2. nrecno = l.
:
1. i n i t Grid :
THIS.TAG = STR(RECNOO)
THIS.SETALL("DYNAMICBACKCOLOR",;
" I I F ( S T R (RECNOO ) ==THIS.TAG, RGB ( 1 9 2 , 1 9 2 , 1 9 2 ) , ; i
RGB(255,255,255))","COLUMN")
2. AfterRowColChange G r i d :
LPARAMETERS NCOLINDEX
THIS.TAG = STR(RECNOO)
THIS.REFRESH ()


Grid Grid Builder
Grid Builder ( ) ,
Grid .
, , Grid

462

coiumncount .
, Grid Form Designer ( ),
Edit ().

<Delete>. , Edit,
, Grid coiumncount
.

"" Grid
init :
THISF0RM.GRID1.SETALL("DYNAMICBACKCOLOR", "IIF(MOD(RECNO;
(), 2)=0, RGB(255,255,255), RGB(234,234,234))", "COLUMN")
THISFORM.GRID1.SETALL("DYNAMICFORECOLOR", "IIF(MOD(RECNO;
(), 2)=0, RGB(0,0,0), RGB(255,0,0))", "COLUMN")

TextBox
:
* getfocus
THIS.FORECOLOR - RGB(0,0,0)
THIS.BACKCOLOR = RGB(255,255,128)
* lostfocus
THIS.FORECOLOR = RGB( 0, 0, 0)
THIS.BACKCOLOR = RGB(255,255,255)

...

ListBox ComboBox
ListBox ,
, Requery,
Refresh.


ComboBox ListBox
ListBox ComboBox,
coiumnwidth. , ComboBox,
, , 50:
THISFORM.COMBOBOX1.COLUMNWIDTHS - "0,0,50"

463

ComboBox
ComboBox,
(COMBOBOXDOWNCLICK),
:
icForm , ComboBox;
loCombo ComboBox.
:
ComboBoxDownClick(Thisform.name,

Thisform.combo1)

FUNCTION COMBOBOXDOWNCLICK
LPARAMETERS LCFORM, LOCOMBO
LOCAL XCOOR, YCOOR, LCNAME
XCOOR = MCOL(LCFORM)
YCOOR = MROW(LCFORM)
MOUSE CLICK AT OBJTOCLIENT(LOCOMBO,1) + 2 , ;
OBJTOCLIENT(LOCOMBO,2)+OBJTOCLIENT(LOCOMBO,3) -

2 ;

WINDOW (LCFORM);

PIXELS
MOUSE AT YCOOR, XCOOR WINDOW (LCFORM)
RETURN

ListBox
ListBox (
),
:
LISTBOX.ITEMTIPS = ..
FORM.SHOWTIPS = ..

ComboBox DropDown
,
comboBox DropDown
, valid
:
IF

!(THIS.DISPLAYVALUE = THIS.VALUE)
THIS.ADDITEM(THIS.DISPLAYVALUE)

464
THIS.VALUE -|
THIS.LISTITEM(THIS.NEWITEMID,THIS.BOUNDCOLUMN)
ENDIF

HOBbie ComboBox ListBox?

, ListBox ComboBox,

:
THIS.ADDITEMO
THIS.ADDLISTITEM(,
THIS.ADDLISTITEM(,

THIS.NEWITEMID,2)
THIS.NEWITEMID,3)

THIS.ADDITEMO
THIS.LISTITEM(THIS.NEWITEMID,2) =
THIS.LISTITEM(THIS.NEWITEMID, 3) =
I n c r e m e n t a l S e a r c h = . T . ListBox

ComboBox,
.
, ,
_DBLCLICK.
.

Visual FoxPro
, Visual FoxPro Windows:
RUN /N C:\WINDOWS\SYSTEM\CALC.EXE

Windows. ,
: , :
ACTIVATE WINDOW CALCULATOR

? !
, (\<)
(\-) .
(\|), , (. 3.2).
. ..

465

. 3.2. ""

. ..



FoxPro? ,
, , ,

466

, .
View () General options
( ) Append ()
Location () mymenu.mpr
config.fpw
FoxPro:
COMMAND = DO m y m e n u . m p r

FoxPro
.


(Toolbar).
/
HIDE WINDOW /SHOW WINDOW,
#DEFINE . . . :
#DEFINE TB_FORMDESIGNER_LOC
#DEFINE TB_STANDARD_LOC
#DEFINE TB_LAYOUT_LOC
#DEFINE TB_QUERY_LOC
#DEFINE TB_VIEWDESIGNER_LOC
#DEFINE TB_COLORPALETTE_LOC
#DEFINE TB_FORMCONTROLS_LOC
#DEFINE TB_DATADESIGNER_LOC
#DEFINE TB_REPODESIGNER_LOC
#DEFINE TB_REPOCONTROLS_LOC
#DEFINE TB_PRINTPREVIEW_LOC
#DEFINE WIN_COMMAND_LOC

"Form Designer"
"Standard"
"Layout"
"Query Designer"
"View Designer"
"Color Palette"
"Form Controls"
"Database Designer"
"Report Designer"
"Report Controls"
"Print Preview"
"Command"




SYS(2007," ")

:
lcheck

SYS(2007,ALLTRIM(mylogin)+ALLTRIM(mypassword))

" "
: , ...
.

Вам также может понравиться