Static integer
Hi,
I'd like to use a static integer for counting up images and to run some macro procedures just on the first image in a batch process.
I don't really want to use the "before" macro, since there will be several decisional vars for the whole thing later in the run during these first user queries.
I used to solve it in this way:
public module X
'global var
dim imcounter% '(static imcounter not possible at this place?)
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
public sub a
static imcounter as integer
imcounter = 1
call sub b
end sub' a
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
sub b
select case imcounter
case 1
'do something
else
'don't
end select
end sub 'b
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
end module 'x
However, now the value is not passed to sub b (it's 0)
I tried redim static imcounter% but logic is not accepted.
How to solve?
Is there an internal counter for images during a batch process? (which would be more elegant, probably)
Many thanks
Dan
Best Answer
-
Hello Dan,
You just have to move the declaration out of sub a and use Dim instead of static.
Dim imcounter as integer
Pierre0
Answers
-
Cheers :-)0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions