cvarutil.inc 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2000,2001 by the Free Pascal development team
  4. Interface and OS-dependent part of variant support
  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. Resourcestring
  12. SNoWidestrings = 'No widestrings supported';
  13. SNoInterfaces = 'No interfaces supported';
  14. Procedure NoWidestrings;
  15. begin
  16. Raise Exception.Create(SNoWideStrings);
  17. end;
  18. Procedure NoInterfaces;
  19. begin
  20. Raise Exception.Create(SNoInterfaces);
  21. end;
  22. Procedure VariantTypeMismatch;
  23. begin
  24. Raise EVariantError.CreateCode(VAR_TYPEMISMATCH);
  25. end;
  26. Function ExceptionToVariantError (E : Exception): HResult;
  27. begin
  28. If E is EoutOfMemory then
  29. Result:=VAR_OUTOFMEMORY
  30. else
  31. Result:=VAR_EXCEPTION;
  32. end;
  33. { ---------------------------------------------------------------------
  34. OS-independent functions not present in Windows
  35. ---------------------------------------------------------------------}
  36. Function VariantToSmallInt(Const VargSrc : TVarData) : SmallInt;
  37. var
  38. l : longint;
  39. begin
  40. With VargSrc do
  41. Case (VType and VarTypeMask) of
  42. VarSmallInt: Result:=VSmallInt;
  43. VarShortInt: Result:=VShortInt;
  44. VarInteger : Result:=VInteger;
  45. VarSingle : Result:=Round(VSingle);
  46. VarDouble : Result:=Round(VDouble);
  47. VarCurrency: Result:=Round(VCurrency);
  48. VarDate : Result:=Round(VDate);
  49. VarBoolean : Result:=SmallInt(VBoolean);
  50. VarByte : Result:=VByte;
  51. VarWord : Result:=VWord;
  52. VarLongWord : Result:=VLongWord;
  53. VarInt64 : Result:=VInt64;
  54. VarQword : Result:=VQWord;
  55. VarOleStr :
  56. begin
  57. if not(TryStrToInt(WideCharToString(vOleStr),l)) then
  58. VariantTypeMismatch;
  59. result:=l;
  60. end;
  61. VarString :
  62. begin
  63. if not(TryStrToInt(ansistring(vString),l)) then
  64. VariantTypeMismatch;
  65. result:=l;
  66. end;
  67. else
  68. VariantTypeMismatch;
  69. end;
  70. end;
  71. Function VariantToShortInt(Const VargSrc : TVarData) : ShortInt;
  72. var
  73. l : longint;
  74. begin
  75. With VargSrc do
  76. Case (VType and VarTypeMask) of
  77. VarSmallInt: Result:=VSmallInt;
  78. VarShortInt: Result:=VShortInt;
  79. VarInteger : Result:=VInteger;
  80. VarSingle : Result:=Round(VSingle);
  81. VarDouble : Result:=Round(VDouble);
  82. VarCurrency: Result:=Round(VCurrency);
  83. VarDate : Result:=Round(VDate);
  84. VarBoolean : Result:=SmallInt(VBoolean);
  85. VarByte : Result:=VByte;
  86. VarWord : Result:=VWord;
  87. VarLongWord : Result:=VLongWord;
  88. VarInt64 : Result:=VInt64;
  89. VarQword : Result:=VQWord;
  90. VarOleStr :
  91. begin
  92. if not(TryStrToInt(WideCharToString(vOleStr),l)) then
  93. VariantTypeMismatch;
  94. result:=l;
  95. end;
  96. VarString :
  97. begin
  98. if not(TryStrToInt(ansistring(vString),l)) then
  99. VariantTypeMismatch;
  100. result:=l;
  101. end;
  102. else
  103. VariantTypeMismatch;
  104. end;
  105. end;
  106. Function VariantToLongint(Const VargSrc : TVarData) : Longint;
  107. begin
  108. With VargSrc do
  109. Case (VType and VarTypeMask) of
  110. VarSmallInt: Result:=VSmallInt;
  111. VarShortInt: Result:=VShortInt;
  112. VarInteger : Result:=VInteger;
  113. VarSingle : Result:=Round(VSingle);
  114. VarDouble : Result:=Round(VDouble);
  115. VarCurrency: Result:=Round(VCurrency);
  116. VarDate : Result:=Round(VDate);
  117. VarOleStr :
  118. if not(TryStrToInt(WideCharToString(vOleStr),Result)) then
  119. VariantTypeMismatch;
  120. VarString :
  121. if not(TryStrToInt(ansistring(vString),Result)) then
  122. VariantTypeMismatch;
  123. VarBoolean : Result:=Longint(VBoolean);
  124. VarByte : Result:=VByte;
  125. VarWord : Result:=VWord;
  126. VarLongWord : Result:=VLongWord;
  127. VarInt64 : Result:=VInt64;
  128. VarQword : Result:=VQWord;
  129. else
  130. VariantTypeMismatch;
  131. end;
  132. end;
  133. Function VariantToCardinal(Const VargSrc : TVarData) : Cardinal;
  134. var
  135. l : longint;
  136. begin
  137. With VargSrc do
  138. Case (VType and VarTypeMask) of
  139. VarSmallInt: Result:=VSmallInt;
  140. VarShortInt: Result:=VShortInt;
  141. VarInteger : Result:=VInteger;
  142. VarSingle : Result:=Round(VSingle);
  143. VarDouble : Result:=Round(VDouble);
  144. VarCurrency: Result:=Round(VCurrency);
  145. VarDate : Result:=Round(VDate);
  146. VarOleStr :
  147. begin
  148. if not(TryStrToInt(WideCharToString(vOleStr),l)) then
  149. VariantTypeMismatch;
  150. result:=l;
  151. end;
  152. VarString :
  153. begin
  154. if not(TryStrToInt(ansistring(vString),l)) then
  155. VariantTypeMismatch;
  156. result:=l;
  157. end;
  158. VarBoolean : Result:=Longint(VBoolean);
  159. VarByte : Result:=VByte;
  160. VarWord : Result:=VWord;
  161. VarLongWord : Result:=VLongWord;
  162. VarInt64 : Result:=VInt64;
  163. VarQword : Result:=VQWord;
  164. else
  165. VariantTypeMismatch;
  166. end;
  167. end;
  168. Function VariantToSingle(Const VargSrc : TVarData) : Single;
  169. begin
  170. With VargSrc do
  171. Case (VType and VarTypeMask) of
  172. VarSmallInt: Result:=VSmallInt;
  173. VarShortInt: Result:=VShortInt;
  174. VarInteger : Result:=VInteger;
  175. VarSingle : Result:=VSingle;
  176. VarDouble : Result:=VDouble;
  177. VarCurrency: Result:=VCurrency;
  178. VarDate : Result:=VDate;
  179. VarOleStr :
  180. begin
  181. if not(TryStrToFloat(WideCharToString(vOleStr),Result)) then
  182. VariantTypeMismatch;
  183. end;
  184. VarString :
  185. begin
  186. if not(TryStrToFloat(ansistring(vString),Result)) then
  187. VariantTypeMismatch;
  188. end;
  189. VarBoolean : Result:=Longint(VBoolean);
  190. VarByte : Result:=VByte;
  191. VarWord : Result:=VWord;
  192. VarLongWord : Result:=VLongWord;
  193. VarInt64 : Result:=VInt64;
  194. VarQword : Result:=VQWord;
  195. else
  196. VariantTypeMismatch;
  197. end;
  198. end;
  199. Function VariantToDouble(Const VargSrc : TVarData) : Double;
  200. begin
  201. With VargSrc do
  202. Case (VType and VarTypeMask) of
  203. VarSmallInt: Result:=VSmallInt;
  204. VarShortInt: Result:=VShortInt;
  205. VarInteger : Result:=VInteger;
  206. VarSingle : Result:=VSingle;
  207. VarDouble : Result:=VDouble;
  208. VarCurrency: Result:=VCurrency;
  209. VarDate : Result:=VDate;
  210. VarOleStr :
  211. begin
  212. if not(TryStrToFloat(WideCharToString(vOleStr),Result)) then
  213. VariantTypeMismatch;
  214. end;
  215. VarString :
  216. begin
  217. if not(TryStrToFloat(ansistring(vString),Result)) then
  218. VariantTypeMismatch;
  219. end;
  220. VarBoolean : Result:=Longint(VBoolean);
  221. VarByte : Result:=VByte;
  222. VarWord : Result:=VWord;
  223. VarLongWord : Result:=VLongWord;
  224. VarInt64 : Result:=VInt64;
  225. VarQword : Result:=VQWord;
  226. else
  227. VariantTypeMismatch;
  228. end;
  229. end;
  230. Function VariantToCurrency(Const VargSrc : TVarData) : Currency;
  231. begin
  232. Try
  233. With VargSrc do
  234. Case (VType and VarTypeMask) of
  235. VarSmallInt: Result:=VSmallInt;
  236. VarShortInt: Result:=VShortInt;
  237. VarInteger : Result:=VInteger;
  238. VarSingle : Result:=FloatToCurr(VSingle);
  239. VarDouble : Result:=FloatToCurr(VDouble);
  240. VarCurrency: Result:=VCurrency;
  241. VarDate : Result:=FloatToCurr(VDate);
  242. VarOleStr :
  243. if not(TryStrToCurr(WideCharToString(vOleStr),Result)) then
  244. VariantTypeMismatch;
  245. VarString :
  246. if not(TryStrToCurr(ansistring(vString),Result)) then
  247. VariantTypeMismatch;
  248. VarBoolean : Result:=Longint(VBoolean);
  249. VarByte : Result:=VByte;
  250. VarWord : Result:=VWord;
  251. VarLongWord : Result:=VLongWord;
  252. VarInt64 : Result:=VInt64;
  253. VarQword : Result:=VQWord;
  254. else
  255. VariantTypeMismatch;
  256. end;
  257. except
  258. On EConvertError do
  259. VariantTypeMismatch;
  260. else
  261. Raise;
  262. end;
  263. end;
  264. Function VariantToDate(Const VargSrc : TVarData) : TDateTime;
  265. begin
  266. Try
  267. With VargSrc do
  268. Case (VType and VarTypeMask) of
  269. VarSmallInt: Result:=FloatToDateTime(VSmallInt);
  270. VarShortInt: Result:=FloatToDateTime(VShortInt);
  271. VarInteger : Result:=FloatToDateTime(VInteger);
  272. VarSingle : Result:=FloatToDateTime(VSingle);
  273. VarDouble : Result:=FloatToDateTime(VDouble);
  274. VarCurrency: Result:=FloatToDateTime(VCurrency);
  275. VarDate : Result:=VDate;
  276. VarOleStr : NoWideStrings;
  277. VarBoolean : Result:=FloatToDateTime(Longint(VBoolean));
  278. VarByte : Result:=FloatToDateTime(VByte);
  279. VarWord : Result:=FloatToDateTime(VWord);
  280. VarLongWord : Result:=FloatToDateTime(VLongWord);
  281. VarInt64 : Result:=FloatToDateTime(VInt64);
  282. VarQWord : Result:=FloatToDateTime(VQword);
  283. else
  284. VariantTypeMismatch;
  285. end;
  286. except
  287. On EConvertError do
  288. VariantTypeMismatch;
  289. else
  290. Raise;
  291. end;
  292. end;
  293. Function VariantToBoolean(Const VargSrc : TVarData) : Boolean;
  294. begin
  295. With VargSrc do
  296. Case (VType and VarTypeMask) of
  297. VarSmallInt: Result:=VSmallInt<>0;
  298. VarShortInt: Result:=VShortInt<>0;
  299. VarInteger : Result:=VInteger<>0;
  300. VarSingle : Result:=VSingle<>0;
  301. VarDouble : Result:=VDouble<>0;
  302. VarCurrency: Result:=VCurrency<>0;
  303. VarDate : Result:=VDate<>0;
  304. VarOleStr : NoWideStrings;
  305. VarBoolean : Result:=VBoolean;
  306. VarByte : Result:=VByte<>0;
  307. VarWord : Result:=VWord<>0;
  308. VarLongWord : Result:=VLongWord<>0;
  309. VarInt64 : Result:=Vint64<>0;
  310. VarQword : Result:=VQWord<>0;
  311. else
  312. VariantTypeMismatch;
  313. end;
  314. end;
  315. Function VariantToByte(Const VargSrc : TVarData) : Byte;
  316. var
  317. l : longint;
  318. begin
  319. Try
  320. With VargSrc do
  321. Case (VType and VarTypeMask) of
  322. VarSmallInt: Result:=VSmallInt;
  323. VarShortInt: Result:=VShortInt;
  324. VarInteger : Result:=VInteger;
  325. VarSingle : Result:=Round(VSingle);
  326. VarDouble : Result:=Round(VDouble);
  327. VarCurrency: Result:=Round(VCurrency);
  328. VarDate : Result:=Round(VDate);
  329. VarBoolean : Result:=Longint(VBoolean);
  330. VarByte : Result:=VByte;
  331. VarWord : Result:=VWord;
  332. VarLongWord : Result:=VLongWord;
  333. VarInt64 : Result:=Vint64;
  334. VarQword : Result:=VQWord;
  335. VarOleStr :
  336. begin
  337. if not(TryStrToInt(WideCharToString(vOleStr),l)) then
  338. VariantTypeMismatch;
  339. result:=l;
  340. end;
  341. VarString :
  342. begin
  343. if not(TryStrToInt(ansistring(vString),l)) then
  344. VariantTypeMismatch;
  345. result:=l;
  346. end;
  347. else
  348. VariantTypeMismatch;
  349. end;
  350. except
  351. On EConvertError do
  352. VariantTypeMismatch;
  353. else
  354. Raise;
  355. end;
  356. end;
  357. Function VariantToInt64(Const VargSrc : TVarData) : Int64;
  358. begin
  359. Try
  360. With VargSrc do
  361. Case (VType and VarTypeMask) of
  362. VarSmallInt: Result:=VSmallInt;
  363. VarShortInt: Result:=VShortInt;
  364. VarInteger : Result:=VInteger;
  365. VarSingle : Result:=Trunc(VSingle);
  366. VarDouble : Result:=Trunc(VDouble);
  367. VarCurrency: Result:=Trunc(VCurrency);
  368. VarDate : Result:=Trunc(VDate);
  369. VarBoolean : Result:=Longint(VBoolean);
  370. VarByte : Result:=VByte;
  371. VarWord : Result:=VWord;
  372. VarLongWord : Result:=VLongWord;
  373. VarInt64 : Result:=VInt64;
  374. VarQword : Result:=VQWord;
  375. VarOleStr :
  376. if not(TryStrToInt64(WideCharToString(vOleStr),Result)) then
  377. VariantTypeMismatch;
  378. VarString :
  379. if not(TryStrToInt64(ansistring(vString),Result)) then
  380. VariantTypeMismatch;
  381. else
  382. VariantTypeMismatch;
  383. end;
  384. except
  385. On EConvertError do
  386. VariantTypeMismatch;
  387. else
  388. Raise;
  389. end;
  390. end;
  391. Function VariantToQWord(Const VargSrc : TVarData) : QWord;
  392. var
  393. l : int64;
  394. begin
  395. Try
  396. With VargSrc do
  397. Case (VType and VarTypeMask) of
  398. VarSmallInt: Result:=VSmallint;
  399. VarShortInt: Result:=VShortInt;
  400. VarInteger : Result:=VInteger;
  401. VarSingle : Result:=Trunc(VSingle);
  402. VarDouble : Result:=Trunc(VDouble);
  403. VarCurrency: Result:=Trunc(VCurrency);
  404. VarDate : Result:=Trunc(VDate);
  405. VarBoolean : Result:=Longint(VBoolean);
  406. VarByte : Result:=VByte;
  407. VarWord : Result:=VWord;
  408. VarLongWord : Result:=VLongWord;
  409. VarInt64 : Result:=VInt64;
  410. VarQword : Result:=VQWord;
  411. VarOleStr :
  412. begin
  413. if not(TryStrToInt64(WideCharToString(vOleStr),l)) then
  414. VariantTypeMismatch;
  415. result:=l;
  416. end;
  417. VarString :
  418. begin
  419. if not(TryStrToInt64(ansistring(vString),l)) then
  420. VariantTypeMismatch;
  421. result:=l;
  422. end;
  423. else
  424. VariantTypeMismatch;
  425. end;
  426. except
  427. On EConvertError do
  428. VariantTypeMismatch;
  429. else
  430. Raise;
  431. end;
  432. end;
  433. Function VariantToWideString(Const VargSrc : TVarData) : WideString;
  434. Const
  435. BS : Array[Boolean] of WideString = ('False','True');
  436. begin
  437. Try
  438. With VargSrc do
  439. Case (VType and VarTypeMask) of
  440. VarSmallInt : Result:=IntTostr(VSmallint);
  441. VarShortInt : Result:=IntToStr(VShortInt);
  442. VarInteger : Result:=IntToStr(VInteger);
  443. VarSingle : Result:=FloatToStr(VSingle);
  444. VarDouble : Result:=FloatToStr(VDouble);
  445. VarCurrency : Result:=FloatToStr(VCurrency);
  446. VarDate : Result:=DateTimeToStr(VDate);
  447. VarOleStr : Result:=WideString(Pointer(VOleStr));
  448. VarBoolean : Result:=BS[VBoolean];
  449. VarByte : Result:=IntToStr(VByte);
  450. VarWord : Result:=IntToStr(VWord);
  451. VarLongWord : Result:=IntToStr(VLongWord);
  452. VarInt64 : Result:=IntToStr(VInt64);
  453. VarQword : Result:=IntToStr(VQWord);
  454. else
  455. VariantTypeMismatch;
  456. end;
  457. except
  458. On EConvertError do
  459. VariantTypeMismatch;
  460. else
  461. Raise;
  462. end;
  463. end;
  464. Function VariantToAnsiString(Const VargSrc : TVarData) : AnsiString;
  465. Const
  466. BS : Array[Boolean] of AnsiString = ('False','True');
  467. begin
  468. Try
  469. With VargSrc do
  470. Case (VType and VarTypeMask) of
  471. VarSmallInt : Result:=IntTostr(VSmallint);
  472. VarShortInt : Result:=IntToStr(VShortInt);
  473. VarInteger : Result:=IntToStr(VInteger);
  474. VarSingle : Result:=FloatToStr(VSingle);
  475. VarDouble : Result:=FloatToStr(VDouble);
  476. VarCurrency : Result:=FloatToStr(VCurrency);
  477. VarDate : Result:=DateTimeToStr(VDate);
  478. VarOleStr : Result:=WideCharToString(VOleStr);
  479. VarBoolean : Result:=BS[VBoolean];
  480. VarByte : Result:=IntToStr(VByte);
  481. VarWord : Result:=IntToStr(VWord);
  482. VarLongWord : Result:=IntToStr(VLongWord);
  483. VarInt64 : Result:=IntToStr(VInt64);
  484. VarQword : Result:=IntToStr(VQWord);
  485. VarString : Result:=ansistring(VString);
  486. else
  487. VariantTypeMismatch;
  488. end;
  489. except
  490. On EConvertError do
  491. VariantTypeMismatch;
  492. else
  493. Raise;
  494. end;
  495. end;
  496. Function VariantToShortString(Const VargSrc : TVarData) : ShortString;
  497. Var
  498. S : AnsiString;
  499. begin
  500. S:=VariantToAnsiString(VArgSrc);
  501. Result:=S;
  502. end;
  503. { ---------------------------------------------------------------------
  504. Some debug routines
  505. ---------------------------------------------------------------------}
  506. Procedure DumpVariant(Const VArgSrc : TVarData);
  507. begin
  508. DumpVariant(Output,VArgSrc);
  509. end;
  510. (*
  511. tvardata = packed record
  512. vtype : tvartype;
  513. case integer of
  514. 0:(res1 : word;
  515. case integer of
  516. 0:
  517. (res2,res3 : word;
  518. case word of
  519. varsmallint : (vsmallint : smallint);
  520. varinteger : (vinteger : longint);
  521. varsingle : (vsingle : single);
  522. vardouble : (vdouble : double);
  523. varcurrency : (vcurrency : currency);
  524. vardate : (vdate : tdatetime);
  525. varolestr : (volestr : pwidechar);
  526. vardispatch : (vdispatch : pointer);
  527. varerror : (verror : dword);
  528. varboolean : (vboolean : wordbool);
  529. varunknown : (vunknown : pointer);
  530. // vardecimal : ( : );
  531. varshortint : (vshortint : shortint);
  532. varbyte : (vbyte : byte);
  533. varword : (vword : word);
  534. varlongword : (vlongword : dword);
  535. varint64 : (vint64 : int64);
  536. varqword : (vqword : qword);
  537. varword64 : (vword64 : qword);
  538. varstring : (vstring : pointer);
  539. varany : (vany : pointer);
  540. vararray : (varray : pvararray);
  541. varbyref : (vpointer : pointer);
  542. );
  543. 1:
  544. (vlongs : array[0..2] of longint);
  545. );
  546. 1:(vwords : array[0..6] of word);
  547. 2:(vbytes : array[0..13] of byte);
  548. end;
  549. *)
  550. Const
  551. VarTypeStrings : Array [varEmpty..varqword] of string = (
  552. 'empty', 'null', 'smallint', 'integer', 'single', 'double',
  553. 'currency', 'date', 'olestr', 'dispatch', 'error', 'boolean',
  554. 'variant', 'unknown', 'unknown','decimal', 'shortint', 'byte', 'word',
  555. 'longword', 'int64', 'qword');
  556. Procedure DumpVariant(Var F : Text; Const VArgSrc : TVarData);
  557. Var
  558. W : WideString;
  559. begin
  560. If VArgSrc.vType in [varEmpty..varqword] then
  561. Writeln(F,'Variant has type : ',VarTypeStrings[VArgSrc.vType])
  562. else if (VArgSrc.vType=VarArray) Then
  563. begin
  564. Write(F,'Variant is array.');
  565. exit;
  566. end
  567. else if (VargSrc.vType=VarByRef) then
  568. begin
  569. Writeln(F,'Variant is by reference.');
  570. exit;
  571. end
  572. else
  573. begin
  574. Writeln(F,'Variant has unknown type: ', VargSrc.vType);
  575. Exit;
  576. end;
  577. If VArgSrc.vType<>varEmpty then
  578. With VArgSrc do
  579. begin
  580. Write(F,'Value is: ') ;
  581. Case vtype of
  582. varnull : Write(F,'Null');
  583. varsmallint : Write(F,vsmallint);
  584. varinteger : Write(F,vinteger);
  585. varsingle : Write(F,vsingle);
  586. vardouble : Write(F,vdouble);
  587. varcurrency : Write(F,vcurrency) ;
  588. vardate : Write(F,vdate) ;
  589. varolestr : begin
  590. W:=vOleStr;
  591. Write(F,W) ;
  592. end;
  593. vardispatch : Write(F,'Not suppordted') ;
  594. varerror : Write(F,'Error') ;
  595. varboolean : Write(F,vboolean) ;
  596. varvariant : Write(F,'Unsupported') ;
  597. varunknown : Write(F,'Unsupported') ;
  598. vardecimal : Write(F,'Unsupported') ;
  599. varshortint : Write(F,vshortint) ;
  600. varbyte : Write(F,vbyte) ;
  601. varword : Write(F,vword) ;
  602. varlongword : Write(F,vlongword) ;
  603. varint64 : Write(F,vint64) ;
  604. varqword : Write(F,vqword) ;
  605. end;
  606. Writeln(f);
  607. end;
  608. end;