objpas.pp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by the Free Pascal development team
  4. This unit makes Free Pascal as much as possible Delphi compatible
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$Mode ObjFpc}
  12. {$I-}
  13. {$ifndef Unix}
  14. {$S-}
  15. {$endif}
  16. unit objpas;
  17. interface
  18. { first, in object pascal, the integer type must be redefined }
  19. const
  20. MaxInt = MaxLongint;
  21. type
  22. Integer = longint;
  23. PInteger = ^Integer;
  24. { Ansistring are the default }
  25. PString = PAnsiString;
  26. { array types }
  27. {$ifdef CPU16}
  28. IntegerArray = array[0..$eff] of Integer;
  29. {$else CPU16}
  30. IntegerArray = array[0..$effffff] of Integer;
  31. {$endif CPU16}
  32. TIntegerArray = IntegerArray;
  33. PIntegerArray = ^IntegerArray;
  34. {$ifdef CPU16}
  35. PointerArray = array [0..16*1024-2] of Pointer;
  36. {$else CPU16}
  37. PointerArray = array [0..512*1024*1024-2] of Pointer;
  38. {$endif CPU16}
  39. TPointerArray = PointerArray;
  40. PPointerArray = ^PointerArray;
  41. TBoundArray = array of integer;
  42. {$ifdef FPC_HAS_FEATURE_CLASSES}
  43. Var
  44. ExceptionClass: TClass; { Exception base class (must actually be Exception, defined in sysutils ) }
  45. {$endif FPC_HAS_FEATURE_CLASSES}
  46. {****************************************************************************
  47. Compatibility routines.
  48. ****************************************************************************}
  49. {$ifdef FPC_HAS_FEATURE_FILEIO}
  50. { Untyped file support }
  51. {$ifdef FPC_UNICODE_RTL}
  52. Procedure AssignFile(out f:File;const Name:UnicodeString);
  53. Procedure AssignFile(out f:File;const Name:RawByteString);
  54. {$else}
  55. Procedure AssignFile(out f:File;const Name:string);
  56. Procedure AssignFile(out f:File;p:pchar);
  57. Procedure AssignFile(out f:File;c:char);
  58. {$endif}
  59. Procedure CloseFile(var f:File);
  60. {$endif FPC_HAS_FEATURE_FILEIO}
  61. {$ifdef FPC_HAS_FEATURE_TEXTIO}
  62. { Text file support }
  63. {$ifdef FPC_UNICODE_RTL}
  64. Procedure AssignFile(out f:Text;const Name:UnicodeString);
  65. Procedure AssignFile(out f:Text;const Name:RawByteString);
  66. {$else}
  67. Procedure AssignFile(out t:Text;const s:string);
  68. Procedure AssignFile(out t:Text;p:pchar);
  69. Procedure AssignFile(out t:Text;c:char);
  70. {$endif}
  71. Procedure CloseFile(Var t:Text);
  72. {$endif FPC_HAS_FEATURE_TEXTIO}
  73. {$ifdef FPC_HAS_FEATURE_FILEIO}
  74. { Typed file supoort }
  75. {$ifdef FPC_UNICODE_RTL}
  76. Procedure AssignFile(out f:TypedFile;const Name:UnicodeString);
  77. Procedure AssignFile(out f:TypedFile;const Name:RawByteString);
  78. {$else}
  79. Procedure AssignFile(out f:TypedFile;const Name:string);
  80. Procedure AssignFile(out f:TypedFile;p:pchar);
  81. Procedure AssignFile(out f:TypedFile;c:char);
  82. {$endif}
  83. {$endif FPC_HAS_FEATURE_FILEIO}
  84. {$if defined(FPC_HAS_FEATURE_COMMANDARGS) }
  85. { ParamStr should return also an ansistring }
  86. Function ParamStr(Param : Integer) : UnicodeString;
  87. {$endif FPC_HAS_FEATURE_COMMANDARGS}
  88. {$if defined(FPC_HAS_FEATURE_FILEIO) and defined(FPC_HAS_FEATURE_ANSISTRINGS) and not defined(FPC_UNICODE_RTL)}
  89. Procedure MkDir(s:ansistring);overload;
  90. Procedure RmDir(s:ansistring);overload;
  91. Procedure ChDir(s:ansistring);overload;
  92. {$endif defined(FPC_HAS_FEATURE_FILEIO) and defined(FPC_HAS_FEATURE_ANSISTRINGS)}
  93. {****************************************************************************
  94. Resource strings.
  95. ****************************************************************************}
  96. {$ifdef FPC_HAS_FEATURE_RESOURCES}
  97. type
  98. TResourceIterator = Function (Name,Value : AnsiString; Hash : Longint; arg:pointer) : AnsiString;
  99. Function Hash(S : AnsiString) : LongWord;
  100. Procedure ResetResourceTables;
  101. Procedure FinalizeResourceTables;
  102. Procedure SetResourceStrings (SetFunction : TResourceIterator;arg:pointer);
  103. Procedure SetUnitResourceStrings (const UnitName:string;SetFunction : TResourceIterator;arg:pointer);
  104. {$ifndef RESSTRSECTIONS}
  105. Function ResourceStringTableCount : Longint;
  106. Function ResourceStringCount(TableIndex : longint) : longint;
  107. Function GetResourceStringName(TableIndex,StringIndex : Longint) : Ansistring;
  108. Function GetResourceStringHash(TableIndex,StringIndex : Longint) : Longint;
  109. Function GetResourceStringDefaultValue(TableIndex,StringIndex : Longint) : AnsiString;
  110. Function GetResourceStringCurrentValue(TableIndex,StringIndex : Longint) : AnsiString;
  111. Function SetResourceStringValue(TableIndex,StringIndex : longint; Value : Ansistring) : Boolean;
  112. {$endif RESSTRSECTIONS}
  113. { Delphi compatibility }
  114. type
  115. PResStringRec=^AnsiString;
  116. TResStringRec=AnsiString;
  117. Function LoadResString(p:PResStringRec):AnsiString;
  118. {$endif FPC_HAS_FEATURE_RESOURCES}
  119. implementation
  120. {****************************************************************************
  121. Compatibility routines.
  122. ****************************************************************************}
  123. {$ifdef FPC_HAS_FEATURE_FILEIO}
  124. {$ifndef FPC_UNICODE_RTL}
  125. Procedure MkDirpchar(s: pchar;len:sizeuint);[IOCheck]; external name 'FPC_SYS_MKDIR';
  126. Procedure ChDirpchar(s: pchar;len:sizeuint);[IOCheck]; external name 'FPC_SYS_CHDIR';
  127. Procedure RmDirpchar(s: pchar;len:sizeuint);[IOCheck]; external name 'FPC_SYS_RMDIR';
  128. {$endif}
  129. { Untyped file support }
  130. {$ifdef FPC_UNICODE_RTL}
  131. Procedure AssignFile(out f:File;const Name:RawBytestring);
  132. begin
  133. System.Assign (F,Name);
  134. end;
  135. Procedure AssignFile(out f:File;const Name:UnicodeString);
  136. begin
  137. System.Assign (F,Name);
  138. end;
  139. {$else}
  140. Procedure AssignFile(out f:File;const Name:string);
  141. begin
  142. System.Assign (F,Name);
  143. end;
  144. Procedure AssignFile(out f:File;p:pchar);
  145. begin
  146. System.Assign (F,P);
  147. end;
  148. Procedure AssignFile(out f:File;c:char);
  149. begin
  150. System.Assign (F,C);
  151. end;
  152. {$endif}
  153. Procedure CloseFile(Var f:File); [IOCheck];
  154. begin
  155. { Catch Runtime error/Exception }
  156. System.Close(f);
  157. end;
  158. {$endif FPC_HAS_FEATURE_FILEIO}
  159. {$ifdef FPC_HAS_FEATURE_TEXTIO}
  160. { Text file support }
  161. {$ifdef FPC_UNICODE_RTL}
  162. Procedure AssignFile(out f:Text;const Name:RawBytestring);
  163. begin
  164. System.Assign (F,Name);
  165. end;
  166. Procedure AssignFile(out f:Text;const Name:UnicodeString);
  167. begin
  168. System.Assign (F,Name);
  169. end;
  170. {$else}
  171. Procedure AssignFile(out t:Text;const s:string);
  172. begin
  173. System.Assign (T,S);
  174. end;
  175. Procedure AssignFile(out t:Text;p:pchar);
  176. begin
  177. System.Assign (T,P);
  178. end;
  179. Procedure AssignFile(out t:Text;c:char);
  180. begin
  181. System.Assign (T,C);
  182. end;
  183. {$endif}
  184. Procedure CloseFile(Var t:Text); [IOCheck];
  185. begin
  186. { Catch Runtime error/Exception }
  187. System.Close(T);
  188. end;
  189. {$endif FPC_HAS_FEATURE_TEXTIO}
  190. {$ifdef FPC_HAS_FEATURE_FILEIO}
  191. { Typed file support }
  192. {$ifdef FPC_UNICODE_RTL}
  193. Procedure AssignFile(out f:TypedFile;const Name:RawBytestring);
  194. begin
  195. System.Assign (F,Name);
  196. end;
  197. Procedure AssignFile(out f:TypedFile;const Name:UnicodeString);
  198. begin
  199. System.Assign (F,Name);
  200. end;
  201. {$else}
  202. Procedure AssignFile(out f:TypedFile;const Name:string);
  203. begin
  204. system.Assign(F,Name);
  205. end;
  206. Procedure AssignFile(out f:TypedFile;p:pchar);
  207. begin
  208. system.Assign (F,p);
  209. end;
  210. Procedure AssignFile(out f:TypedFile;c:char);
  211. begin
  212. system.Assign (F,C);
  213. end;
  214. {$endif}
  215. {$endif FPC_HAS_FEATURE_FILEIO}
  216. {$if defined(FPC_HAS_FEATURE_COMMANDARGS) }
  217. Function ParamStr(Param : Integer) : unicodestring;
  218. Var Len : longint;
  219. s : ansistring;
  220. begin
  221. {
  222. Paramstr(0) should return the name of the binary.
  223. Since this functionality is included in the system unit,
  224. we fetch it from there.
  225. Normally, pathnames are less than 255 chars anyway,
  226. so this will work correct in 99% of all cases.
  227. In time, the system unit should get a GetExeName call.
  228. }
  229. if (Param=0) then
  230. Result:=System.Paramstr(0)
  231. else if (Param>0) and (Param<argc) then
  232. begin
  233. Len:=0;
  234. While Argv[Param][Len]<>#0 do
  235. Inc(len);
  236. SetLength(s,Len);
  237. If Len>0 then
  238. Move(Argv[Param][0],s[1],Len);
  239. result:=s;
  240. end
  241. else
  242. Result:='';
  243. end;
  244. {$endif FPC_HAS_FEATURE_COMMANDARGS}
  245. {$if defined(FPC_HAS_FEATURE_FILEIO) and defined(FPC_HAS_FEATURE_ANSISTRINGS) and not defined(FPC_UNICODE_RTL)}
  246. { xxDirPChar procedures can adjust directory separators in supplied string (at least
  247. Windows implementation does so). Therefore full copy of argument is needed,
  248. just passing by value isn't enough because it won't copy a string literal. }
  249. Procedure MkDir(s:ansistring);[IOCheck];
  250. begin
  251. UniqueString(s);
  252. mkdirpchar(pchar(s),length(s));
  253. end;
  254. Procedure RmDir(s:ansistring);[IOCheck];
  255. begin
  256. UniqueString(s);
  257. RmDirpchar(pchar(s),length(s));
  258. end;
  259. Procedure ChDir(s:ansistring);[IOCheck];
  260. begin
  261. UniqueString(s);
  262. ChDirpchar(pchar(s),length(s));
  263. end;
  264. {$endif defined(FPC_HAS_FEATURE_FILEIO) and defined(FPC_HAS_FEATURE_ANSISTRINGS)}
  265. {$ifdef FPC_HAS_FEATURE_RESOURCES}
  266. { ---------------------------------------------------------------------
  267. ResourceString support
  268. ---------------------------------------------------------------------}
  269. Function Hash(S : AnsiString) : LongWord;
  270. Var
  271. thehash,g,I : LongWord;
  272. begin
  273. thehash:=0;
  274. For I:=1 to Length(S) do { 0 terminated }
  275. begin
  276. thehash:=thehash shl 4;
  277. inc(theHash,Ord(S[i]));
  278. g:=thehash and LongWord($f shl 28);
  279. if g<>0 then
  280. begin
  281. thehash:=thehash xor (g shr 24);
  282. thehash:=thehash xor g;
  283. end;
  284. end;
  285. If theHash=0 then
  286. Hash:=$ffffffff
  287. else
  288. Hash:=TheHash;
  289. end;
  290. {$ifdef RESSTRSECTIONS}
  291. Type
  292. PResourceStringRecord = ^TResourceStringRecord;
  293. TResourceStringRecord = Packed Record
  294. Name,
  295. CurrentValue,
  296. DefaultValue : AnsiString;
  297. HashValue : LongWord;
  298. {$ifdef cpu64}
  299. Dummy : LongWord; // alignment
  300. {$endif cpu64}
  301. end;
  302. TResourceStringTableList = Packed Record
  303. Count : ptrint;
  304. Tables : Array[{$ifdef cpu16}Byte{$else cpu16}Word{$endif cpu16}] of record
  305. TableStart,
  306. TableEnd : PResourceStringRecord;
  307. end;
  308. end;
  309. { Support for string constants initialized with resourcestrings }
  310. {$ifdef FPC_HAS_RESSTRINITS}
  311. PResStrInitEntry = ^TResStrInitEntry;
  312. TResStrInitEntry = record
  313. Addr: PPointer;
  314. Data: PResourceStringRecord;
  315. end;
  316. TResStrInitTable = packed record
  317. Count: longint;
  318. Tables: packed array[1..{$ifdef cpu16}8191{$else cpu16}32767{$endif cpu16}] of PResStrInitEntry;
  319. end;
  320. var
  321. ResStrInitTable : TResStrInitTable; external name 'FPC_RESSTRINITTABLES';
  322. procedure UpdateResourceStringRefs;
  323. var
  324. i: Longint;
  325. ptable: PResStrInitEntry;
  326. begin
  327. for i:=1 to ResStrInitTable.Count do
  328. begin
  329. ptable:=ResStrInitTable.Tables[i];
  330. while Assigned(ptable^.Addr) do
  331. begin
  332. AnsiString(ptable^.Addr^):=ptable^.Data^.CurrentValue;
  333. Inc(ptable);
  334. end;
  335. end;
  336. end;
  337. {$endif FPC_HAS_RESSTRINITS}
  338. Var
  339. ResourceStringTable : TResourceStringTableList; External Name 'FPC_RESOURCESTRINGTABLES';
  340. Procedure SetResourceStrings (SetFunction : TResourceIterator;arg:pointer);
  341. Var
  342. ResStr : PResourceStringRecord;
  343. i : Longint;
  344. s : AnsiString;
  345. begin
  346. With ResourceStringTable do
  347. begin
  348. For i:=0 to Count-1 do
  349. begin
  350. ResStr:=Tables[I].TableStart;
  351. { Skip first entry (name of the Unit) }
  352. inc(ResStr);
  353. while ResStr<Tables[I].TableEnd do
  354. begin
  355. s:=SetFunction(ResStr^.Name,ResStr^.DefaultValue,Longint(ResStr^.HashValue),arg);
  356. if s<>'' then
  357. ResStr^.CurrentValue:=s;
  358. inc(ResStr);
  359. end;
  360. end;
  361. end;
  362. {$ifdef FPC_HAS_RESSTRINITS}
  363. UpdateResourceStringRefs;
  364. {$endif FPC_HAS_RESSTRINITS}
  365. end;
  366. Procedure SetUnitResourceStrings (const UnitName:string;SetFunction : TResourceIterator;arg:pointer);
  367. Var
  368. ResStr : PResourceStringRecord;
  369. i : Longint;
  370. s,
  371. UpUnitName : AnsiString;
  372. begin
  373. With ResourceStringTable do
  374. begin
  375. UpUnitName:=UpCase(UnitName);
  376. For i:=0 to Count-1 do
  377. begin
  378. ResStr:=Tables[I].TableStart;
  379. { Check name of the Unit }
  380. if ResStr^.Name<>UpUnitName then
  381. continue;
  382. inc(ResStr);
  383. while ResStr<Tables[I].TableEnd do
  384. begin
  385. s:=SetFunction(ResStr^.Name,ResStr^.DefaultValue,Longint(ResStr^.HashValue),arg);
  386. if s<>'' then
  387. ResStr^.CurrentValue:=s;
  388. inc(ResStr);
  389. end;
  390. end;
  391. end;
  392. {$ifdef FPC_HAS_RESSTRINITS}
  393. { Resourcestrings of one unit may be referenced from other units,
  394. so updating everything is the only option. }
  395. UpdateResourceStringRefs;
  396. {$endif FPC_HAS_RESSTRINITS}
  397. end;
  398. Procedure ResetResourceTables;
  399. Var
  400. ResStr : PResourceStringRecord;
  401. i : Longint;
  402. begin
  403. With ResourceStringTable do
  404. begin
  405. For i:=0 to Count-1 do
  406. begin
  407. ResStr:=Tables[I].TableStart;
  408. { Skip first entry (name of the Unit) }
  409. inc(ResStr);
  410. while ResStr<Tables[I].TableEnd do
  411. begin
  412. ResStr^.CurrentValue:=ResStr^.DefaultValue;
  413. inc(ResStr);
  414. end;
  415. end;
  416. end;
  417. end;
  418. Procedure FinalizeResourceTables;
  419. Var
  420. ResStr : PResourceStringRecord;
  421. i : Longint;
  422. begin
  423. With ResourceStringTable do
  424. begin
  425. For i:=0 to Count-1 do
  426. begin
  427. ResStr:=Tables[I].TableStart;
  428. { Skip first entry (name of the Unit) }
  429. inc(ResStr);
  430. while ResStr<Tables[I].TableEnd do
  431. begin
  432. ResStr^.CurrentValue:='';
  433. inc(ResStr);
  434. end;
  435. end;
  436. end;
  437. end;
  438. {$else RESSTRSECTIONS}
  439. Type
  440. PResourceStringRecord = ^TResourceStringRecord;
  441. TResourceStringRecord = Packed Record
  442. DefaultValue,
  443. CurrentValue : AnsiString;
  444. HashValue : LongWord;
  445. Name : AnsiString;
  446. end;
  447. TResourceStringTable = Packed Record
  448. Count : longint;
  449. Resrec : Array[Word] of TResourceStringRecord;
  450. end;
  451. PResourceStringTable = ^TResourceStringTable;
  452. TResourceTableList = Packed Record
  453. Count : longint;
  454. Tables : Array[Word] of PResourceStringTable;
  455. end;
  456. Var
  457. ResourceStringTable : TResourceTablelist; External Name 'FPC_RESOURCESTRINGTABLES';
  458. Function GetResourceString(Const TheTable: TResourceStringTable;Index : longint) : AnsiString;[Public,Alias : 'FPC_GETRESOURCESTRING'];
  459. begin
  460. If (Index>=0) and (Index<TheTAble.Count) then
  461. Result:=TheTable.ResRec[Index].CurrentValue
  462. else
  463. Result:='';
  464. end;
  465. Procedure SetResourceStrings (SetFunction : TResourceIterator;arg:pointer);
  466. Var I,J : longint;
  467. begin
  468. With ResourceStringTable do
  469. For I:=0 to Count-1 do
  470. With Tables[I]^ do
  471. For J:=0 to Count-1 do
  472. With ResRec[J] do
  473. CurrentValue:=SetFunction(Name,DefaultValue,Longint(HashValue),arg);
  474. end;
  475. Procedure SetUnitResourceStrings (const UnitName:string;SetFunction : TResourceIterator;arg:pointer);
  476. begin
  477. SetResourceStrings (SetFunction,arg);
  478. end;
  479. Procedure ResetResourceTables;
  480. Var I,J : longint;
  481. begin
  482. With ResourceStringTable do
  483. For I:=0 to Count-1 do
  484. With Tables[I]^ do
  485. For J:=0 to Count-1 do
  486. With ResRec[J] do
  487. CurrentValue:=DefaultValue;
  488. end;
  489. Procedure FinalizeResourceTables;
  490. Var I,J : longint;
  491. begin
  492. With ResourceStringTable do
  493. For I:=0 to Count-1 do
  494. With Tables[I]^ do
  495. For J:=0 to Count-1 do
  496. With ResRec[J] do
  497. CurrentValue:='';
  498. end;
  499. Function ResourceStringTableCount : Longint;
  500. begin
  501. Result:=ResourceStringTable.Count;
  502. end;
  503. Function CheckTableIndex (Index: longint) : Boolean;
  504. begin
  505. Result:=(Index<ResourceStringTable.Count) and (Index>=0)
  506. end;
  507. Function CheckStringIndex (TableIndex,Index: longint) : Boolean;
  508. begin
  509. Result:=(TableIndex<ResourceStringTable.Count) and (TableIndex>=0) and
  510. (Index<ResourceStringTable.Tables[TableIndex]^.Count) and (Index>=0)
  511. end;
  512. Function ResourceStringCount(TableIndex : longint) : longint;
  513. begin
  514. If not CheckTableIndex(TableIndex) then
  515. Result:=-1
  516. else
  517. Result:=ResourceStringTable.Tables[TableIndex]^.Count;
  518. end;
  519. Function GetResourceStringName(TableIndex,StringIndex : Longint) : Ansistring;
  520. begin
  521. If not CheckStringIndex(Tableindex,StringIndex) then
  522. Result:=''
  523. else
  524. result:=ResourceStringTable.Tables[TableIndex]^.ResRec[StringIndex].Name;
  525. end;
  526. Function GetResourceStringHash(TableIndex,StringIndex : Longint) : Longint;
  527. begin
  528. If not CheckStringIndex(Tableindex,StringIndex) then
  529. Result:=0
  530. else
  531. result:=ResourceStringTable.Tables[TableIndex]^.ResRec[StringIndex].HashValue;
  532. end;
  533. Function GetResourceStringDefaultValue(TableIndex,StringIndex : Longint) : AnsiString;
  534. begin
  535. If not CheckStringIndex(Tableindex,StringIndex) then
  536. Result:=''
  537. else
  538. result:=ResourceStringTable.Tables[TableIndex]^.ResRec[StringIndex].DefaultValue;
  539. end;
  540. Function GetResourceStringCurrentValue(TableIndex,StringIndex : Longint) : AnsiString;
  541. begin
  542. If not CheckStringIndex(Tableindex,StringIndex) then
  543. Result:=''
  544. else
  545. result:=ResourceStringTable.Tables[TableIndex]^.ResRec[StringIndex].CurrentValue;
  546. end;
  547. Function SetResourceStringValue(TableIndex,StringIndex : longint; Value : Ansistring) : Boolean;
  548. begin
  549. Result:=CheckStringIndex(Tableindex,StringIndex);
  550. If Result then
  551. ResourceStringTable.Tables[TableIndex]^.ResRec[StringIndex].CurrentValue:=Value;
  552. end;
  553. {$endif RESSTRSECTIONS}
  554. Function LoadResString(p:PResStringRec):AnsiString;
  555. begin
  556. Result:=p^;
  557. end;
  558. {$endif FPC_HAS_FEATURE_RESOURCES}
  559. {$ifdef FPC_HAS_FEATURE_RESOURCES}
  560. Initialization
  561. { ResetResourceTables;}
  562. finalization
  563. FinalizeResourceTables;
  564. {$endif FPC_HAS_FEATURE_RESOURCES}
  565. end.