Board index » delphi » Why "Invalid variable reference" (Helpcommand)

Why "Invalid variable reference" (Helpcommand)

I've now spent HOURS on this... help??? PLEASE?? (What you see below
is only the core of the variuos things I've been through...)

This is all Delphi ver 1.

I wanted to add help file support to one of my programs.

Wrote the .hlp file. Works fine.

Wrote a TINY app: One button, with OnClick:

application.helpcommand(help_contents,0);

That worked. (Of course, I had to set the application's help file
first... I understand that. Used the IDE)

Added the same line to a button OnClick in the application I want to
give help capablilities to, and got:

Err122: Invalid variable reference.

The program is not complex. Single unit and form. Nothing "clever"
going on. No variables with conflicting names.

Maybe related????:
In my search for The Answer, I came across code that suggested I could
add the following... (again, I've pared this down to the central
issues....)

procedure <something>;

var p:pchar;

begin
p:=strnew(''); // that's just two apostrophies, one after the other...
i.e. a null string
strdispose(p);
end;

THIS won't compile either (not that it is enough to do anything useful
if it did!). The error this time is 'Type mismatch' at p:=strnew('');

AM I CRAZY, or is DELPHI????

Frustrated!

Tom

--
http://www.arunet.co.uk/tkboyd/offers.htm
Freeware, shareware for IBM type pcs. Ideas for parents, teachers

 

Re:Why "Invalid variable reference" (Helpcommand)


ARRGGHHH!!! (Gnashings of teeth abound!!!)

I "cured" my problem. What I had to do was delete the *.dsk, *.opt,
*.res and *.dcu files from the project folder. Doing so had no
(discovered so far!!!) untoward effects, and doing so fixed whatever
was wrong and my code compiled happily.

Any thoughts from anyone about the wisdom of doing such deletes or
about how to know when they are needed?

(The system put some (all?) of them back, but, it seems, in okay
versions.)

Hope this saves soemone else the frustration I had.

On Mon, 19 Jun 2000 12:22:20 GMT, 100665.1...@compuserve.com (TK Boyd)
wrote:

Quote
>I've now spent HOURS on this... help??? PLEASE?? (What you see below
>is only the core of the variuos things I've been through...)

>This is all Delphi ver 1.

>I wanted to add help file support to one of my programs.

>Wrote the .hlp file. Works fine.

>Wrote a TINY app: One button, with OnClick:

>application.helpcommand(help_contents,0);

>That worked. (Of course, I had to set the application's help file
>first... I understand that. Used the IDE)

>Added the same line to a button OnClick in the application I want to
>give help capablilities to, and got:

>Err122: Invalid variable reference.

>The program is not complex. Single unit and form. Nothing "clever"
>going on. No variables with conflicting names.

>Maybe related????:
>In my search for The Answer, I came across code that suggested I could
>add the following... (again, I've pared this down to the central
>issues....)

>procedure <something>;

>var p:pchar;

>begin
>p:=strnew(''); // that's just two apostrophies, one after the other...
>i.e. a null string
>strdispose(p);
>end;

>THIS won't compile either (not that it is enough to do anything useful
>if it did!). The error this time is 'Type mismatch' at p:=strnew('');

>AM I CRAZY, or is DELPHI????

>Frustrated!

>Tom

>--
>http://www.arunet.co.uk/tkboyd/offers.htm
>Freeware, shareware for IBM type pcs. Ideas for parents, teachers

--
http://www.arunet.co.uk/tkboyd/offers.htm
Freeware, shareware for IBM type pcs. Ideas for parents, teachers

Other Threads