-
Notifications
You must be signed in to change notification settings - Fork 0
/
clsPrefs.hbc
40 lines (36 loc) · 952 Bytes
/
clsPrefs.hbc
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
<?xml version="1.0" encoding="utf-8"?>
<!-- Peter Holmes Consulting HB++ Class file -->
<Class Version="2.53">
<Name>clsPrefs</Name>
<Segment>main</Segment>
<Extends>Object</Extends>
<Instantiable>True</Instantiable>
<Extendable>True</Extendable>
<Cloneable>False</Cloneable>
<Source xml:space="preserve"><![CDATA[Public goalWeight As Double
Public unit as WeightUnit
Private Sub Object_Serialize(ByRef lCount as Long, ByVal stream As Stream, ByVal eDirection As HbStream, ByVal lSize As Long)
If eDirection=hbStreamRead Then
stream.Read goalWeight
stream.Read unit
Else
stream.Write goalWeight
stream.Write unit
End If
End Sub
Public Sub SavePrefs()
Dim s As New StreamMemory
s.Write Me
App.Preferences(0)=s
End Sub
Public Sub LoadPrefs()
Dim s As StreamMemory
Try
s=App.Preferences(0)
s.Read Me
Catch
goalWeight = 180
unit=lbs
End Catch
End Sub]]></Source>
</Class>