-
Notifications
You must be signed in to change notification settings - Fork 207
/
memfile.prg
79 lines (64 loc) · 1.53 KB
/
memfile.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
// ; Donated to the public domain by
// Viktor Szakats (vszakats.net/harbour)
MEMVAR m_cLongerNameThen10Chars
#ifdef __HARBOUR__
MEMVAR m_cLongerN
#endif
MEMVAR m_cString
MEMVAR m_nDouble
MEMVAR m_nDoubleH
MEMVAR m_nInt
MEMVAR m_nLong
MEMVAR m_dDate
MEMVAR m_lLogicT
MEMVAR m_lLogicF
MEMVAR m_xStayHer
PROCEDURE Main()
PRIVATE m_cLongerNameThen10Chars := "Long String Name!"
PRIVATE m_cString := "This is a" + Chr( 0 ) + "string to save."
PRIVATE m_nDouble := 100.0000
PRIVATE m_nDoubleH := 5000000000
PRIVATE m_nInt := 35
PRIVATE m_nLong := 3000000
PRIVATE m_dDate := Date()
PRIVATE m_lLogicT := .F.
PRIVATE m_lLogicF := .T.
SAVE TO memfile ALL
SAVE TO memsome ALL LIKE "m_nDouble*"
CLEAR MEMORY
SAVE TO memempt ALL
PRIVATE m_xStayHer := "CONST"
RESTORE FROM memfile ADDITIVE
? m_xStayHer
? m_cLongerN /* Can't restore the part of the name beyond the tenth char */
? m_cString
? m_nDouble
? m_nDoubleH
? m_nInt
? m_nLong
? m_dDate
? m_lLogicF
? m_lLogicT
RESTORE FROM memfile
// ? m_xStayHer
? m_cLongerN /* Can't restore the part of the name beyond the tenth char */
? m_cString
? m_nDouble
? m_nDoubleH
? m_nInt
? m_nLong
? m_dDate
? m_lLogicF
? m_lLogicT
? __MRestore( "memfile", .F., "m_nDouble*", .T. )
? m_nDouble
? m_nDoubleH
? __mvScope( "m_nInt" )
FErase( "memempt.mem" )
FErase( "memfile.mem" )
FErase( "memsome.mem" )
RETURN
#ifndef __HARBOUR__
FUNCTION __mvScope()
RETURN -1
#endif