View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Neal Zimm Neal Zimm is offline
external usenet poster
 
Posts: 345
Default User Public Type, circular dependancy error

Sorry, did not include this with prior post.

I moved the procs involved to different modules and the function ran just
fine, even with the uSx As uSx, but I'll stop using that naming convention.
--
Neal Z


"Dave Peterson" wrote:

First, I would never use:
Dim Long as Long

So I wouldn't use a variable name that matches the type.

Dim myuSx as uSx
myusx = usxmakef(...)
(not usx = usxmakef(...))

And

Public type uRecA
...
myOtheruSx as uSx
End Type

I have no idea whether this will get rid of the problem, but I know it would
lead to less confusion on my part.

Neal Zimm wrote:

Hi,

In a module I have in declarations,
Public Type uSx
var names...
end type

In same module , general code, a function, uSx = uSxMakeF(arg, arg, ....)
All was working well.

I moved the uSx record definition to another module, "above" uRecA, whe
Public Type uRecA
other vars ...
uSx as uSx
end type

I now get circular dependancies compile error pointing at the above function.
uRecA is not involved in the function.

What is the best practice module batting order that will get rid of this
error ??
I had thought that as long as the "user" of public types was below, or in a
module after the Public Type, that I would not get this error.

Me experience had been that in the uRecA example, as long as other public
types that it used were "above" it, the "find it to use it" requirement
would be met.

Thanks,
--
Neal Z


--

Dave Peterson
.