cvarutil.inc 19 KB

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