sstrings.inc 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by the Free Pascal development team
  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. {****************************************************************************
  12. subroutines for string handling
  13. ****************************************************************************}
  14. {$ifndef INTERNSETLENGTH}
  15. procedure SetLength(var s:shortstring;len:StrLenInt);
  16. {$else INTERNSETLENGTH}
  17. procedure fpc_Shortstr_SetLength(var s:shortstring;len:StrLenInt);[Public,Alias : 'FPC_SHORTSTR_SETLENGTH']; {$ifdef hascompilerproc} compilerproc; {$endif}
  18. {$endif INTERNSETLENGTH}
  19. begin
  20. if Len>255 then
  21. Len:=255;
  22. s[0]:=chr(len);
  23. end;
  24. {$ifdef interncopy}
  25. function fpc_shortstr_copy(const s : shortstring;index : StrLenInt;count : StrLenInt): shortstring;compilerproc;
  26. {$else}
  27. function copy(const s : shortstring;index : StrLenInt;count : StrLenInt): shortstring;
  28. {$endif}
  29. begin
  30. if count<0 then
  31. count:=0;
  32. if index>1 then
  33. dec(index)
  34. else
  35. index:=0;
  36. if index>length(s) then
  37. count:=0
  38. else
  39. if count>length(s)-index then
  40. count:=length(s)-index;
  41. {$ifdef interncopy}
  42. fpc_shortstr_Copy[0]:=chr(Count);
  43. Move(s[Index+1],fpc_shortstr_Copy[1],Count);
  44. {$else}
  45. Copy[0]:=chr(Count);
  46. Move(s[Index+1],Copy[1],Count);
  47. {$endif}
  48. end;
  49. procedure delete(var s : shortstring;index : StrLenInt;count : StrLenInt);
  50. begin
  51. if index<=0 then
  52. exit;
  53. if (Index<=Length(s)) and (Count>0) then
  54. begin
  55. if Count>length(s)-Index then
  56. Count:=length(s)-Index+1;
  57. s[0]:=Chr(length(s)-Count);
  58. if Index<=Length(s) then
  59. Move(s[Index+Count],s[Index],Length(s)-Index+1);
  60. end;
  61. end;
  62. procedure insert(const source : shortstring;var s : shortstring;index : StrLenInt);
  63. var
  64. cut,srclen,indexlen : longint;
  65. begin
  66. if index<1 then
  67. index:=1;
  68. if index>length(s) then
  69. index:=length(s)+1;
  70. indexlen:=Length(s)-Index+1;
  71. srclen:=length(Source);
  72. if length(source)+length(s)>=sizeof(s) then
  73. begin
  74. cut:=length(source)+length(s)-sizeof(s)+1;
  75. if cut>indexlen then
  76. begin
  77. dec(srclen,cut-indexlen);
  78. indexlen:=0;
  79. end
  80. else
  81. dec(indexlen,cut);
  82. end;
  83. move(s[Index],s[Index+srclen],indexlen);
  84. move(Source[1],s[Index],srclen);
  85. s[0]:=chr(index+srclen+indexlen-1);
  86. end;
  87. procedure insert(source : Char;var s : shortstring;index : StrLenInt);
  88. var
  89. indexlen : longint;
  90. begin
  91. if index<1 then
  92. index:=1;
  93. if index>length(s) then
  94. index:=length(s)+1;
  95. indexlen:=Length(s)-Index+1;
  96. if (length(s)+1=sizeof(s)) and (indexlen>0) then
  97. dec(indexlen);
  98. move(s[Index],s[Index+1],indexlen);
  99. s[Index]:=Source;
  100. s[0]:=chr(index+indexlen);
  101. end;
  102. function pos(const substr : shortstring;const s : shortstring):StrLenInt;
  103. var
  104. i,MaxLen : StrLenInt;
  105. pc : pchar;
  106. begin
  107. Pos:=0;
  108. if Length(SubStr)>0 then
  109. begin
  110. MaxLen:=Length(s)-Length(SubStr);
  111. i:=0;
  112. pc:=@s[1];
  113. while (i<=MaxLen) do
  114. begin
  115. inc(i);
  116. if (SubStr[1]=pc^) and
  117. (CompareChar(Substr[1],pc^,Length(SubStr))=0) then
  118. begin
  119. Pos:=i;
  120. exit;
  121. end;
  122. inc(pc);
  123. end;
  124. end;
  125. end;
  126. {Faster when looking for a single char...}
  127. function pos(c:char;const s:shortstring):StrLenInt;
  128. var
  129. i : StrLenInt;
  130. pc : pchar;
  131. begin
  132. pc:=@s[1];
  133. for i:=1 to length(s) do
  134. begin
  135. if pc^=c then
  136. begin
  137. pos:=i;
  138. exit;
  139. end;
  140. inc(pc);
  141. end;
  142. pos:=0;
  143. end;
  144. {$ifdef interncopy}
  145. function fpc_char_copy(c:char;index : StrLenInt;count : StrLenInt): shortstring;compilerproc;
  146. begin
  147. if (index=1) and (Count>0) then
  148. fpc_char_Copy:=c
  149. else
  150. fpc_char_Copy:='';
  151. end;
  152. {$else}
  153. function copy(c:char;index : StrLenInt;count : StrLenInt): shortstring;
  154. begin
  155. if (index=1) and (Count>0) then
  156. Copy:=c
  157. else
  158. Copy:='';
  159. end;
  160. {$endif}
  161. function pos(const substr : shortstring;c:char): StrLenInt;
  162. begin
  163. if (length(substr)=1) and (substr[1]=c) then
  164. Pos:=1
  165. else
  166. Pos:=0;
  167. end;
  168. {$ifdef IBM_CHAR_SET}
  169. const
  170. UpCaseTbl : shortstring[7]=#154#142#153#144#128#143#165;
  171. LoCaseTbl : shortstring[7]=#129#132#148#130#135#134#164;
  172. {$endif}
  173. function upcase(c : char) : char;
  174. {$IFDEF IBM_CHAR_SET}
  175. var
  176. i : longint;
  177. {$ENDIF}
  178. begin
  179. if (c in ['a'..'z']) then
  180. upcase:=char(byte(c)-32)
  181. else
  182. {$IFDEF IBM_CHAR_SET}
  183. begin
  184. i:=Pos(c,LoCaseTbl);
  185. if i>0 then
  186. upcase:=UpCaseTbl[i]
  187. else
  188. upcase:=c;
  189. end;
  190. {$ELSE}
  191. upcase:=c;
  192. {$ENDIF}
  193. end;
  194. function upcase(const s : shortstring) : shortstring;
  195. var
  196. i : longint;
  197. begin
  198. upcase[0]:=s[0];
  199. for i := 1 to length (s) do
  200. upcase[i] := upcase (s[i]);
  201. end;
  202. function lowercase(c : char) : char;overload;
  203. {$IFDEF IBM_CHAR_SET}
  204. var
  205. i : longint;
  206. {$ENDIF}
  207. begin
  208. if (c in ['A'..'Z']) then
  209. lowercase:=char(byte(c)+32)
  210. else
  211. {$IFDEF IBM_CHAR_SET}
  212. begin
  213. i:=Pos(c,UpCaseTbl);
  214. if i>0 then
  215. lowercase:=LoCaseTbl[i]
  216. else
  217. lowercase:=c;
  218. end;
  219. {$ELSE}
  220. lowercase:=c;
  221. {$ENDIF}
  222. end;
  223. function lowercase(const s : shortstring) : shortstring; overload;
  224. var
  225. i : longint;
  226. begin
  227. lowercase [0]:=s[0];
  228. for i:=1 to length(s) do
  229. lowercase[i]:=lowercase (s[i]);
  230. end;
  231. const
  232. HexTbl : array[0..15] of char='0123456789ABCDEF';
  233. function hexstr(val : longint;cnt : byte) : shortstring;
  234. var
  235. i : longint;
  236. begin
  237. hexstr[0]:=char(cnt);
  238. for i:=cnt downto 1 do
  239. begin
  240. hexstr[i]:=hextbl[val and $f];
  241. val:=val shr 4;
  242. end;
  243. end;
  244. function octstr(val : longint;cnt : byte) : shortstring;
  245. var
  246. i : longint;
  247. begin
  248. octstr[0]:=char(cnt);
  249. for i:=cnt downto 1 do
  250. begin
  251. octstr[i]:=hextbl[val and 7];
  252. val:=val shr 3;
  253. end;
  254. end;
  255. function binstr(val : longint;cnt : byte) : shortstring;
  256. var
  257. i : longint;
  258. begin
  259. binstr[0]:=char(cnt);
  260. for i:=cnt downto 1 do
  261. begin
  262. binstr[i]:=char(48+val and 1);
  263. val:=val shr 1;
  264. end;
  265. end;
  266. function hexstr(val : int64;cnt : byte) : shortstring;
  267. var
  268. i : longint;
  269. begin
  270. hexstr[0]:=char(cnt);
  271. for i:=cnt downto 1 do
  272. begin
  273. hexstr[i]:=hextbl[val and $f];
  274. val:=val shr 4;
  275. end;
  276. end;
  277. function octstr(val : int64;cnt : byte) : shortstring;
  278. var
  279. i : longint;
  280. begin
  281. octstr[0]:=char(cnt);
  282. for i:=cnt downto 1 do
  283. begin
  284. octstr[i]:=hextbl[val and 7];
  285. val:=val shr 3;
  286. end;
  287. end;
  288. function binstr(val : int64;cnt : byte) : shortstring;
  289. var
  290. i : longint;
  291. begin
  292. binstr[0]:=char(cnt);
  293. for i:=cnt downto 1 do
  294. begin
  295. binstr[i]:=char(48+val and 1);
  296. val:=val shr 1;
  297. end;
  298. end;
  299. function space (b : byte): shortstring;
  300. begin
  301. space[0] := chr(b);
  302. FillChar (Space[1],b,' ');
  303. end;
  304. {*****************************************************************************
  305. Str() Helpers
  306. *****************************************************************************}
  307. procedure fpc_shortstr_longint(v : longint;len : longint;var s : shortstring);[public,alias:'FPC_SHORTSTR_LONGINT']; {$ifdef hascompilerproc} compilerproc; {$endif}
  308. begin
  309. int_str(v,s);
  310. if length(s)<len then
  311. s:=space(len-length(s))+s;
  312. end;
  313. {$ifdef ver1_0}
  314. procedure fpc_shortstr_cardinal(v : longword;len : longint;var s : shortstring);[public,alias:'FPC_SHORTSTR_CARDINAL']; {$ifdef hascompilerproc} compilerproc; {$endif}
  315. {$else}
  316. procedure fpc_shortstr_longword(v : longword;len : longint;var s : shortstring);[public,alias:'FPC_SHORTSTR_LONGWORD']; {$ifdef hascompilerproc} compilerproc; {$endif}
  317. {$endif}
  318. begin
  319. int_str(v,s);
  320. if length(s)<len then
  321. s:=space(len-length(s))+s;
  322. end;
  323. { fpc_shortstr_longint must appear before this file is included, because }
  324. { it's used inside real2str.inc and otherwise the searching via the }
  325. { compilerproc name will fail (JM) }
  326. {$I real2str.inc}
  327. procedure fpc_ShortStr_Float(d : ValReal;len,fr,rt : longint;var s : shortstring);[public,alias:'FPC_SHORTSTR_FLOAT']; {$ifdef hascompilerproc}compilerproc;{$endif hascompilerproc}
  328. begin
  329. str_real(len,fr,d,treal_type(rt),s);
  330. end;
  331. {
  332. Array Of Char Str() helpers
  333. }
  334. procedure fpc_chararray_longint(v : longint;len : longint;var a:array of char);{$ifdef hascompilerproc} compilerproc; {$endif}
  335. var
  336. ss : shortstring;
  337. maxlen : longint;
  338. begin
  339. int_str(v,ss);
  340. if length(ss)<len then
  341. ss:=space(len-length(ss))+ss;
  342. if length(ss)<high(a)+1 then
  343. maxlen:=length(ss)
  344. else
  345. maxlen:=high(a)+1;
  346. move(ss[1],pchar(@a)^,maxlen);
  347. end;
  348. procedure fpc_chararray_longword(v : longword;len : longint;var a : array of char);{$ifdef hascompilerproc} compilerproc; {$endif}
  349. var
  350. ss : shortstring;
  351. maxlen : longint;
  352. begin
  353. int_str(v,ss);
  354. if length(ss)<len then
  355. ss:=space(len-length(ss))+ss;
  356. if length(ss)<high(a)+1 then
  357. maxlen:=length(ss)
  358. else
  359. maxlen:=high(a)+1;
  360. move(ss[1],pchar(@a)^,maxlen);
  361. end;
  362. procedure fpc_chararray_Float(d : ValReal;len,fr,rt : longint;var a : array of char);{$ifdef hascompilerproc}compilerproc;{$endif hascompilerproc}
  363. var
  364. ss : shortstring;
  365. maxlen : longint;
  366. begin
  367. str_real(len,fr,d,treal_type(rt),ss);
  368. if length(ss)<high(a)+1 then
  369. maxlen:=length(ss)
  370. else
  371. maxlen:=high(a)+1;
  372. move(ss[1],pchar(@a)^,maxlen);
  373. end;
  374. {*****************************************************************************
  375. Val() Functions
  376. *****************************************************************************}
  377. Function InitVal(const s:shortstring;var negativ:boolean;var base:byte):ValSInt;
  378. var
  379. Code : Longint;
  380. begin
  381. {Skip Spaces and Tab}
  382. code:=1;
  383. while (code<=length(s)) and (s[code] in [' ',#9]) do
  384. inc(code);
  385. {Sign}
  386. negativ:=false;
  387. case s[code] of
  388. '-' : begin
  389. negativ:=true;
  390. inc(code);
  391. end;
  392. '+' : inc(code);
  393. end;
  394. {Base}
  395. base:=10;
  396. if code<=length(s) then
  397. begin
  398. case s[code] of
  399. '$' : begin
  400. base:=16;
  401. repeat
  402. inc(code);
  403. until (code>=length(s)) or (s[code]<>'0');
  404. end;
  405. '%' : begin
  406. base:=2;
  407. inc(code);
  408. end;
  409. '&' : begin
  410. Base:=8;
  411. repeat
  412. inc(code);
  413. until (code>=length(s)) or (s[code]<>'0');
  414. end;
  415. end;
  416. end;
  417. InitVal:=code;
  418. end;
  419. Function fpc_Val_SInt_ShortStr(DestSize: longint; Const S: ShortString; var Code: ValSInt): ValSInt; [public, alias:'FPC_VAL_SINT_SHORTSTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
  420. var
  421. u, temp, prev, maxPrevValue, maxNewValue: ValUInt;
  422. base : byte;
  423. negative : boolean;
  424. begin
  425. fpc_Val_SInt_ShortStr := 0;
  426. Temp:=0;
  427. Code:=InitVal(s,negative,base);
  428. if Code>length(s) then
  429. exit;
  430. maxPrevValue := ValUInt(MaxUIntValue) div ValUInt(Base);
  431. if (base = 10) then
  432. maxNewValue := MaxSIntValue + ord(negative)
  433. else
  434. maxNewValue := MaxUIntValue;
  435. while Code<=Length(s) do
  436. begin
  437. case s[Code] of
  438. '0'..'9' : u:=Ord(S[Code])-Ord('0');
  439. 'A'..'F' : u:=Ord(S[Code])-(Ord('A')-10);
  440. 'a'..'f' : u:=Ord(S[Code])-(Ord('a')-10);
  441. else
  442. u:=16;
  443. end;
  444. Prev := Temp;
  445. Temp := Temp*ValUInt(base);
  446. If (u >= base) or
  447. (ValUInt(maxNewValue-u) < Temp) or
  448. (prev > maxPrevValue) Then
  449. Begin
  450. fpc_Val_SInt_ShortStr := 0;
  451. Exit
  452. End;
  453. Temp:=Temp+u;
  454. inc(code);
  455. end;
  456. code := 0;
  457. fpc_Val_SInt_ShortStr := ValSInt(Temp);
  458. If Negative Then
  459. fpc_Val_SInt_ShortStr := -fpc_Val_SInt_ShortStr;
  460. If Not(Negative) and (base <> 10) Then
  461. {sign extend the result to allow proper range checking}
  462. Case DestSize of
  463. 1: fpc_Val_SInt_ShortStr := shortint(fpc_Val_SInt_ShortStr);
  464. 2: fpc_Val_SInt_ShortStr := smallint(fpc_Val_SInt_ShortStr);
  465. { Uncomment the folling once full 64bit support is in place
  466. 4: fpc_Val_SInt_ShortStr := longint(fpc_Val_SInt_ShortStr);}
  467. End;
  468. end;
  469. {$ifdef hascompilerproc}
  470. { we need this for fpc_Val_SInt_Ansistr and fpc_Val_SInt_WideStr because }
  471. { we have to pass the DestSize parameter on (JM) }
  472. Function fpc_Val_SInt_ShortStr(DestSize: longint; Const S: ShortString; var Code: ValSInt): ValSInt; [external name 'FPC_VAL_SINT_SHORTSTR'];
  473. {$endif hascompilerproc}
  474. Function fpc_Val_UInt_Shortstr(Const S: ShortString; var Code: ValSInt): ValUInt; [public, alias:'FPC_VAL_UINT_SHORTSTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
  475. var
  476. u, prev : ValUInt;
  477. base : byte;
  478. negative : boolean;
  479. begin
  480. fpc_Val_UInt_Shortstr:=0;
  481. Code:=InitVal(s,negative,base);
  482. If Negative or (Code>length(s)) Then
  483. Exit;
  484. while Code<=Length(s) do
  485. begin
  486. case s[Code] of
  487. '0'..'9' : u:=Ord(S[Code])-Ord('0');
  488. 'A'..'F' : u:=Ord(S[Code])-(Ord('A')-10);
  489. 'a'..'f' : u:=Ord(S[Code])-(Ord('a')-10);
  490. else
  491. u:=16;
  492. end;
  493. prev := fpc_Val_UInt_Shortstr;
  494. If (u>=base) or
  495. (ValUInt(MaxUIntValue-u) div ValUInt(Base)<prev) then
  496. begin
  497. fpc_Val_UInt_Shortstr:=0;
  498. exit;
  499. end;
  500. fpc_Val_UInt_Shortstr:=fpc_Val_UInt_Shortstr*ValUInt(base) + u;
  501. inc(code);
  502. end;
  503. code := 0;
  504. end;
  505. Function fpc_Val_Real_ShortStr(const s : shortstring; var code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_SHORTSTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
  506. var
  507. hd,
  508. esign,sign : valreal;
  509. exponent,i : longint;
  510. flags : byte;
  511. begin
  512. fpc_Val_Real_ShortStr:=0.0;
  513. code:=1;
  514. exponent:=0;
  515. esign:=1;
  516. flags:=0;
  517. sign:=1;
  518. while (code<=length(s)) and (s[code] in [' ',#9]) do
  519. inc(code);
  520. case s[code] of
  521. '+' : inc(code);
  522. '-' : begin
  523. sign:=-1;
  524. inc(code);
  525. end;
  526. end;
  527. while (Code<=Length(s)) and (s[code] in ['0'..'9']) do
  528. begin
  529. { Read integer part }
  530. flags:=flags or 1;
  531. fpc_Val_Real_ShortStr:=fpc_Val_Real_ShortStr*10+(ord(s[code])-ord('0'));
  532. inc(code);
  533. end;
  534. { Decimal ? }
  535. if (s[code]='.') and (length(s)>=code) then
  536. begin
  537. hd:=1.0;
  538. inc(code);
  539. while (s[code] in ['0'..'9']) and (length(s)>=code) do
  540. begin
  541. { Read fractional part. }
  542. flags:=flags or 2;
  543. fpc_Val_Real_ShortStr:=fpc_Val_Real_ShortStr*10+(ord(s[code])-ord('0'));
  544. hd:=hd*10.0;
  545. inc(code);
  546. end;
  547. fpc_Val_Real_ShortStr:=fpc_Val_Real_ShortStr/hd;
  548. end;
  549. { Again, read integer and fractional part}
  550. if flags=0 then
  551. begin
  552. fpc_Val_Real_ShortStr:=0.0;
  553. exit;
  554. end;
  555. { Exponent ? }
  556. if (upcase(s[code])='E') and (length(s)>=code) then
  557. begin
  558. inc(code);
  559. if s[code]='+' then
  560. inc(code)
  561. else
  562. if s[code]='-' then
  563. begin
  564. esign:=-1;
  565. inc(code);
  566. end;
  567. if not(s[code] in ['0'..'9']) or (length(s)<code) then
  568. begin
  569. fpc_Val_Real_ShortStr:=0.0;
  570. exit;
  571. end;
  572. while (s[code] in ['0'..'9']) and (length(s)>=code) do
  573. begin
  574. exponent:=exponent*10;
  575. exponent:=exponent+ord(s[code])-ord('0');
  576. inc(code);
  577. end;
  578. end;
  579. { Calculate Exponent }
  580. {
  581. if esign>0 then
  582. for i:=1 to exponent do
  583. fpc_Val_Real_ShortStr:=Val_Real_ShortStr*10
  584. else
  585. for i:=1 to exponent do
  586. fpc_Val_Real_ShortStr:=Val_Real_ShortStr/10; }
  587. hd:=1.0;
  588. for i:=1 to exponent do
  589. hd:=hd*10.0;
  590. if esign>0 then
  591. fpc_Val_Real_ShortStr:=fpc_Val_Real_ShortStr*hd
  592. else
  593. fpc_Val_Real_ShortStr:=fpc_Val_Real_ShortStr/hd;
  594. { Not all characters are read ? }
  595. if length(s)>=code then
  596. begin
  597. fpc_Val_Real_ShortStr:=0.0;
  598. exit;
  599. end;
  600. { evaluate sign }
  601. fpc_Val_Real_ShortStr:=fpc_Val_Real_ShortStr*sign;
  602. { success ! }
  603. code:=0;
  604. end;
  605. Procedure SetString (Var S : Shortstring; Buf : PChar; Len : Longint);
  606. begin
  607. If Len > High(S) then
  608. Len := High(S);
  609. SetLength(S,Len);
  610. If Buf<>Nil then
  611. begin
  612. Move (Buf[0],S[1],Len);
  613. end;
  614. end;
  615. {
  616. $Log$
  617. Revision 1.27 2003-02-26 20:04:47 jonas
  618. * fixed shortstring version of setstring
  619. Revision 1.26 2002/10/21 19:52:47 jonas
  620. * fixed some buffer overflow errors in SetString (both short and
  621. ansistring versions) (merged)
  622. Revision 1.25 2002/10/19 17:06:50 michael
  623. + Added check for nil buffer to setstring
  624. Revision 1.24 2002/10/02 18:21:51 peter
  625. * Copy() changed to internal function calling compilerprocs
  626. * FPC_SHORTSTR_COPY renamed to FPC_SHORTSTR_ASSIGN because of the
  627. new copy functions
  628. Revision 1.23 2002/09/14 11:20:50 carl
  629. * Delphi compatibility fix (with string routines)
  630. Revision 1.22 2002/09/07 21:19:00 carl
  631. * cardinal -> longword
  632. Revision 1.21 2002/09/07 15:07:46 peter
  633. * old logs removed and tabs fixed
  634. Revision 1.20 2002/09/02 19:24:41 peter
  635. * array of char support for Str()
  636. Revision 1.19 2002/08/06 20:53:38 michael
  637. + Added support for octal strings (using &)
  638. Revision 1.18 2002/01/24 18:27:06 peter
  639. * lowercase() overloaded
  640. }