码迷,mamicode.com
首页 > 其他好文 > 详细

VarClear

时间:2015-02-05 18:08:52      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:

 Variant V;
  String mystr;
  if (TVarData(V).VType == varEmpty)
	ListBox1->Items->Add(L"Variants start ???? empty.");
  VarClear(V);
  TVarData(V).VType = varString;
  mystr = L"Here is my ???? string";
  wchar_t* MyBuffer = new wchar_t[mystr.Length() + 1];
  StrCopy(MyBuffer, mystr.c_str());
  TVarData(V).VString = MyBuffer;
  mystr = (wchar_t *)(TVarData(V).VString);
  ListBox1->Items->Add(L"This variant is now a ???? string: " + mystr);
  VarClear(V);
  TVarData(V).VType = varInteger;
  TVarData(V).VInteger = 1234567;
  ListBox1->Items->Add(L"This variant is now an ???? integer: " + IntToStr(TVarData(V).VInteger));

http://docwiki.embarcadero.com/CodeExamples/XE7/en/SystemVarClear_%28C%2B%2B%29

VarClear

标签:

原文地址:http://www.cnblogs.com/cb168/p/4275146.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!