-
Notifications
You must be signed in to change notification settings - Fork 0
/
CODE_NEW.PRG
executable file
·66 lines (64 loc) · 1.32 KB
/
CODE_NEW.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
hide menu main
hide popup all
if .not. file('&data\wrk_code.dbf')
do file_error in looks
return .t.
endif
@ 0,1 say "New Work Code" color r/w
do disk with 1 in looks
set color to g+/b+
define window work from 8,15 to 16,65 double shadow title" New "
move window work center
activate window work
store 0 to cd,tb
cdnm=space(30)
do while .t.
store 0 to tb
clear gets
@ 1,5 say"Code : "get cd pict'99' valid code_check()
@ 3,5 say"Name : "get cdnm valid name()
@ 5,1 to 5,47 color w/b
@ 6,13 get tb function'*H Save;Cancel' size 1,10,4
read cycle
if tb=2 .or. tb=0
close all
clear window all
do ctop in looks
do disk with 0 in looks
return .t.
exit
endif
if tb=1
if cd=0
do error with "The Work Code is not valid","please revise the entry","Error"
loop
endif
use &data\wrk_code shared
appe blank
repl work_code with cd
repl code_name with cdnm
use
store 0 to cd,tb
cdnm=space(30)
loop
endif
enddo
proc code_check
use &data\wrk_code shared
set order to code
seek cd
if found()
do error with "This work code is already in use","please revise the entry","Error"
use
return .f.
else
use
return .t.
endif
proc name
if empty(cdnm)
do error with "A name must be given to activate the code","","Error"
return .f.
else
return .t.
endif