Re: Simulating VB Nothing variant in Delphi
- From: "Steve Zimmelman" <skz@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 23 Jun 2006 07:51:37 -0500
Mike is correct. Use UnAssigned when using COM and OleVariants.
********************
From Delphi Help:********************
In the code fragment shown below, the statement that assigns Unassigned to the
MSWord variable causes the OLE Automation Object that was created to interface
with Word to be released.
var
MSWord: Variant;
begin
...
MSWord := CreateOleObject('Word.Basic');
...
MSWord := Unassigned;
...
end;
********************
In VB it would be [Set MSWord = Nothing].
-Steve-
"Ian Hinson" <pparagon@xxxxxxxxxxxxxx> wrote in message
news:4499d7fb@xxxxxxxxxxxxxxxxxxxxxxxxx
"Mike Shkolnik" <mshkolnik2002@xxxxxxx> wrote in message
news:4499a17d@xxxxxxxxxxxxxxxxxxxxxxxxx
UnAssigned in Delphi is the same as Nothing in VB
cat.ActiveConnection := UnAssigned;
Have to disagree on that, sorry.
The Unassigned function returns a variant with VType varEmpty,
whereas the Nothing variant in VBA is a variant with VType varDispatch.
.
- Follow-Ups:
- Re: Simulating VB Nothing variant in Delphi
- From: Viatcheslav V. Vassiliev
- Re: Simulating VB Nothing variant in Delphi
- References:
- Simulating VB Nothing variant in Delphi
- From: Ian Hinson
- Re: Simulating VB Nothing variant in Delphi
- From: Mike Shkolnik
- Re: Simulating VB Nothing variant in Delphi
- From: Ian Hinson
- Simulating VB Nothing variant in Delphi
- Prev by Date: ProgressBar and ADO Dataset
- Next by Date: Re: Connection Failure
- Previous by thread: Re: Simulating VB Nothing variant in Delphi
- Next by thread: Re: Simulating VB Nothing variant in Delphi
- Index(es):
Relevant Pages
|