-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathStatic.prg
More file actions
31 lines (28 loc) · 704 Bytes
/
Static.prg
File metadata and controls
31 lines (28 loc) · 704 Bytes
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
DEFINE CLASS StaticVariable AS Custom
FUNCTION toString
LPARAMETERS xValue
LOCAL cVarType, cString
cVarType = VARTYPE(xValue)
DO CASE
CASE INLIST(cVarType, 'C', 'M')
cString = xValue
CASE INLIST(cVarType, 'I', 'N', 'F')
cString = STR(xValue)
CASE INLIST(cVarType, 'T')
cString = IIF(EMPTY(xValue), "", TTOC(xValue, 1))
CASE INLIST(cVarType, 'D')
cString = IIF(EMPTY(xValue), "", DTOC(xValue))
OTHERWISE
ERROR 9, "Type " + cVarType + " unsupported."
ENDCASE
RETURN cString
FUNCTION IsNullOrEmpty
LPARAMETERS xValue
LOCAL lReturn
lReturn = ISNULL(xValue)
IF ! lReturn
xValue = This.toString(xValue)
lReturn = EMPTY(xValue)
ENDIF
RETURN lReturn
ENDDEFINE