Re: Simulating VB Nothing variant in Delphi



UnAssigned in Delphi is the same as Nothing in VB
cat.ActiveConnection := UnAssigned;

--
With best regards, Mike Shkolnik
E-mail: mshkolnik@xxxxxxxxxxxxx
WEB: http://www.scalabium.com

"Ian Hinson" <pparagon@xxxxxxxxxxxxxx> wrote in message
news:44994410$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Often in VB code you see statements like:

Set cmd.ActiveConnection = Nothing
or
Set dbs = Nothing

To simulate Nothing in Delphi use:
var
vntNothing: OLEVariant;
begin
TVarData(vntNothing).VType := varDispatch;
TVarData(vntNothing).VDispatch := Nil;
// then you can do things like..
cat.Set_ActiveConnection(vntNothing);
without getting a data type mismatch.

Ian.




.



Relevant Pages

  • Re: Progressbar color
    ... Delphi tip#138: change a color of standard TProgressbar ... With best regards, Mike Shkolnik ...
    (alt.comp.lang.borland-delphi)
  • Re: No Version Info?
    ... With best regards, Mike Shkolnik ... > I use Delphi 7/WinXP/640mb ram. ... > though the Option is set in Project options to include such ...
    (borland.public.delphi.nativeapi)
  • Re: Tabbed MDI Component
    ... and implemented using standard docking mechanism ... With best regards, Mike Shkolnik ... > doesn't work with Delphi. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Hello... Im a newbie here. This is my introduction.
    ... >> Delphi for many years. ... >> Regards, ... I use Windows XP Home Edition SP2. ... > There are a number of free Modula-2 compilers, ...
    (comp.lang.modula2)
  • Re: RemObjects Software welcomes Mike Orriss as Documentation Manager
    ... > and Delphi became the natural switch when the windows version of the ... > Magazine and several years working for Developer Express writing papers & ... > regards as home). ... > intends to move closer to the coast to a smaller house. ...
    (borland.public.delphi.thirdpartytools.general)