Board index » delphi » Question on passing pointer to procedure - question.zip (0/1)

Question on passing pointer to procedure - question.zip (0/1)

I have written a program to do huffman compression. However, the
program has problem.
If I use VAR to pass the pointer to procedures listed below, "204
Invalid pointer operation" is reported in "procedure char_dispose"
in Turbo Pascal 6.

procedure char_sort
procedure char_release
procedure char_dispose
procedure node_join
procedure node3_join
procedure tree_release

If I add "break point" to "procedure char_dispose" and run step by
step, no run-time error appears.
If I don't use VAR, no run-time error appears, too.
However, the link between the tree structure is broken.
Would anyone help me to solve this problem ?
Also Would anyone tell me when I should use VAR to pass pointer to
procedure and when I should not ? Thanks

Note : A62.PAS is using VAR to pass pointer to procedure.
       A61.PAS is not.

 

Re:Question on passing pointer to procedure - question.zip (0/1)


In article <36fae938.489...@news.netvigator.com>,

Quote
  d...@chevalier.net wrote:
> I have written a program to do huffman compression. However, the
> program has problem.
> If I use VAR to pass the pointer to procedures listed below, "204
> Invalid pointer operation" is reported in "procedure char_dispose"
> in Turbo Pascal 6.

> procedure char_sort
> procedure char_release
> procedure char_dispose
> procedure node_join
> procedure node3_join
> procedure tree_release

> If I add "break point" to "procedure char_dispose" and run step by
> step, no run-time error appears.
> If I don't use VAR, no run-time error appears, too.
> However, the link between the tree structure is broken.
> Would anyone help me to solve this problem ?
> Also Would anyone tell me when I should use VAR to pass pointer to
> procedure and when I should not ? Thanks

1 - DON'T POST BINARIES TO THESE GROUPS!
2 - comp.lang.pascal is no longer in use - removed from reply

Robert
--
Robert AH Prins
prin...@williscorroon.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

Re:Question on passing pointer to procedure - question.zip (0/1)


d...@chevalier.net D?? ???
<36fae938.489...@news.netvigator.com>...

Quote
> I have written a program to do huffman compression. However, the
> program has problem.
> If I use VAR to pass the pointer to procedures listed below, "204
> Invalid pointer operation" is reported in "procedure char_dispose"
> in Turbo Pascal 6.

> procedure char_sort
> procedure char_release
> procedure char_dispose
> procedure node_join
> procedure node3_join
> procedure tree_release

> If I add "break point" to "procedure char_dispose" and run step by
> step, no run-time error appears.
> If I don't use VAR, no run-time error appears, too.
> However, the link between the tree structure is broken.
> Would anyone help me to solve this problem ?
> Also Would anyone tell me when I should use VAR to pass pointer to
> procedure and when I should not ? Thanks

> Note : A62.PAS is using VAR to pass pointer to procedure.
>        A61.PAS is not.

Re:Question on passing pointer to procedure - question.zip (0/1)


Quote
Robert AH Prins wrote:

> In article <36fae938.489...@news.netvigator.com>,
>   d...@chevalier.net wrote:
> > I have written a program to do huffman compression. However, the
> > program has problem.
> > If I use VAR to pass the pointer to procedures listed below, "204
> > Invalid pointer operation" is reported in "procedure char_dispose"
> > in Turbo Pascal 6.

> > procedure char_sort
> > procedure char_release
> > procedure char_dispose
> > procedure node_join
> > procedure node3_join
> > procedure tree_release

> > If I add "break point" to "procedure char_dispose" and run step by
> > step, no run-time error appears.
> > If I don't use VAR, no run-time error appears, too.
> > However, the link between the tree structure is broken.
> > Would anyone help me to solve this problem ?
> > Also Would anyone tell me when I should use VAR to pass pointer to
> > procedure and when I should not ? Thanks

> 1 - DON'T POST BINARIES TO THESE GROUPS!
> 2 - comp.lang.pascal is no longer in use - removed from reply

> Robert
> --

If you don't know the answer, just say so!

Other Threads