58 if f <> nil then |
58 if f <> nil then |
59 begin |
59 begin |
60 while not pfsEof(f) do |
60 while not pfsEof(f) do |
61 begin |
61 begin |
62 pfsReadLnA(f, s); |
62 pfsReadLnA(f, s); |
63 if (Length(s) > 0) and (s[0] >= '0') and (s[0] <= '9') then |
63 if (StrLength(s) > 0) and (s[0] >= '0') and (s[0] <= '9') then |
64 begin |
64 begin |
65 TryDo(Length(s) > 6, 'Load locale: empty string', true); |
65 TryDo(StrLength(s) > 6, 'Load locale: empty string', true); |
66 val(s[0]+s[1], a, c); |
66 val(s[0]+s[1], a, c); |
67 TryDo(c = 0, 'Load locale: numbers should be two-digit: ' + s, true); |
67 TryDo(c = 0, 'Load locale: numbers should be two-digit: ' + s, true); |
68 TryDo(s[2] = ':', 'Load locale: ":" expected', true); |
68 TryDo(s[2] = ':', 'Load locale: ":" expected', true); |
69 val(s[3]+s[4], b, c); |
69 val(s[3]+s[4], b, c); |
70 TryDo(c = 0, 'Load locale: numbers should be two-digit' + s, true); |
70 TryDo(c = 0, 'Load locale: numbers should be two-digit' + s, true); |
71 TryDo(s[5] = '=', 'Load locale: "=" expected', true); |
71 TryDo(s[5] = '=', 'Load locale: "=" expected', true); |
72 sc:= StrAlloc(length(s) - 5); |
72 sc:= StrAlloc(StrLength(s) - 5); |
73 StrCopy(sc, @s[6]); |
73 StrCopy(sc, @s[6]); |
74 case a of |
74 case a of |
75 0: if (b >=0) and (b <= ord(High(TAmmoStrId))) then |
75 0: if (b >=0) and (b <= ord(High(TAmmoStrId))) then |
76 trammo[TAmmoStrId(b)]:= sc; |
76 trammo[TAmmoStrId(b)]:= sc; |
77 1: if (b >=0) and (b <= ord(High(TMsgStrId))) then |
77 1: if (b >=0) and (b <= ord(High(TMsgStrId))) then |