-
Notifications
You must be signed in to change notification settings - Fork 0
/
CAT_MOD.PRG
executable file
·81 lines (74 loc) · 1.81 KB
/
CAT_MOD.PRG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
hide menu main
hide popup all
if .not. file('&data\catagory.dbf')
do file_error in looks
return .t.
endif
@ 0,1 say"Edit Catagory Title" color r/w
do disk with 1 in looks
define window mod from 1,10 to 15,60 double shadow title" Edit "
move window mod center
do while .t.
clear gets
activate window mod
close all
use &data\catagory shared
store 1 to mchoice
store 0 to tool
@ 1,2 say"Catagory to edit :"
define popup scrollopts FROM 0,0 prompt field cat_name MARGIN SCROLL COLOR SCHEME 11
@ 2,2 GET mchoice POPUP scrollopts SIZE 10, 30
@ 2,34 get tool function'*V Edit;Cancel' size 1,12,1
read cycle
if tool=0 .or. tool=2
deacti window all
clear window all
close all
do ctop in looks
do disk with 0 in looks
return .t.
endif
if tool=1
deacti window mod
if rlock()=.f.
do error with "This record is currently in exclusive use","try this operation later","Error"
loop
endif
cat_nm=cat_name
cat_cd=cat_code
define window cat from 1,10 to 7,60 double shadow title" Edit "
move window cat center
activate window cat
store 0 to tool
@ 1,5 say"Name :"get cat_nm pict'@!' valid name()
@ 3,1 to 3,47 color w/b
@ 4,13 get tool function'*H Change;Cancel' size 1,10,4
read cycle
if tool=2 .or. tool=0
deacti window all
clear window all
close all
do ctop in looks
do disk with 0 in looks
return .t.
exit
endif
if tool=1
set order to cat_code
seek cat_cd
if found()
replace cat_name with cat_nm
else
do error with "The record reference is missing","Network useage error","Error"
endif
use
deacti window cat
loop
endif
endif
enddo
proc name
if empty(cat_nm)
do error with "A name is required to start","the pricing catagory","Error"
return .f.
endif