1

I just downloaded the ADSI and it seems to be that it is not compatible with Delphi Embarcadero XE4.

When I try to compile one of the examples, I get this error:

[dcc32 Error] adshlp.pas(128): E2003 Undeclared identifier: 'NULL'

And this is the line:

varArr := NULL;

What's wrong?

Kromster
  • 7,181
  • 7
  • 63
  • 111
outime
  • 135
  • 1
  • 8
  • 7
    Do you have `Variants` in `uses` of the unit? – ain May 24 '13 at 21:18
  • 1
    Problem is at your end. I like answering questions. I would answer this if I could. But the question is broken. If you published enough code then we could answer. If SO is not meeting your expectations, you'll have to look elsewhere for help. – David Heffernan May 24 '13 at 21:43
  • 1
    Indeed, how horrible of us, refusing to do your job for free. A quick google shows NULL is defined in system.variants, so you need to use that. – Tony Hopkinson May 24 '13 at 21:45
  • But how do we even know that's what is needed? We don't know the types of the variables, what units are used and so on. If asker would provide details and ask specific question rather than asking for generic help porting, then we'd be on it. – David Heffernan May 24 '13 at 21:50
  • 2
    @user2321906 Stack Overflow is so popular exactly because here are guys with "this shit" in their attitude, that keep garbage questions and talks suppressed and closed. You don't like this attitude, you want every post be welcomed and praized ? then just ask your requests on that kind of forums. Read startning with "Community standards do not maintain themselves: They're maintained by people actively applying them, visibly, in public." at http://www.catb.org/esr/faqs/smart-questions.html – Arioch 'The May 24 '13 at 22:00
  • @Arioch'The: A tad long, but should be required reading for anybody seeking help. Adding it to the links in my profile :) – Marjan Venema May 25 '13 at 07:52
  • 2
    I don't see why this is 'not a real question'. I'm afraid I have to vote to reopen it... – Andreas Rejbrand May 25 '13 at 13:21

1 Answers1

15

Null used to be declared in the System unit, so it was available globally. In Delphi 6, all Variant-related code moved out of that unit and into the new Variants unit. Since Null is a function that returns a Variant, Null was included in the move, so it is no longer available implicitly.

To fix the old code, simply add Variants to your uses clause in any unit that needs it:

uses ..., Variants;
Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467