V
Vincent
I have a problem regarding subs; private, regular, public and static ones. A
practical problem. I cannot seem to transform theory into practise. Whenever
I try to find info on this, on help within the program, on online help, in
newsgroups, I find myself giving up – almost. So I write instead. Maybe there
are more people than I also having trouble on this subject …
I understand the difference between “Regular†sub’s and “Private†subs. This
both clear and evident when used. They have different scope – one only works
in a module, the other in the whole project. This becomes very evident, if
not before, when trying to name a sub with the same name – works perfectly
in a Private Sub, not so in a regular one (I know, I know – this is not what
I usually do. I don't use the same name for every sub I have – it was an
example…)
So far so good, it is then the trouble begins. For I can’t seem to
comprehend beyond that … I know there are other kinds of Sub’s. I know there
are “Public†ones and there are “Static†ones. I just can’t seem to make them
work!
I would like to for example place a Public or Static (dunno which, one of
them…) in for example an Autostart macro. In that macro, I would dim a number
of variables: name, special paths to certain directories and so on and so on…
After doing that, I would be able to access these variables from ANY
template. This I cannot to. Whenever I change/rename/create a directory, I
still have to edit each macro - manually. This is both time and labour
consuming. Not to mention – how tedious it is.
There should be something easier “out thereâ€
--
practical problem. I cannot seem to transform theory into practise. Whenever
I try to find info on this, on help within the program, on online help, in
newsgroups, I find myself giving up – almost. So I write instead. Maybe there
are more people than I also having trouble on this subject …
I understand the difference between “Regular†sub’s and “Private†subs. This
both clear and evident when used. They have different scope – one only works
in a module, the other in the whole project. This becomes very evident, if
not before, when trying to name a sub with the same name – works perfectly
in a Private Sub, not so in a regular one (I know, I know – this is not what
I usually do. I don't use the same name for every sub I have – it was an
example…)
So far so good, it is then the trouble begins. For I can’t seem to
comprehend beyond that … I know there are other kinds of Sub’s. I know there
are “Public†ones and there are “Static†ones. I just can’t seem to make them
work!
I would like to for example place a Public or Static (dunno which, one of
them…) in for example an Autostart macro. In that macro, I would dim a number
of variables: name, special paths to certain directories and so on and so on…
After doing that, I would be able to access these variables from ANY
template. This I cannot to. Whenever I change/rename/create a directory, I
still have to edit each macro - manually. This is both time and labour
consuming. Not to mention – how tedious it is.
There should be something easier “out thereâ€
--