I normally DIM everything, beginning with arrays, right after SUB declarations and TYPE definitions.
Normally you don't need to DIM in a SUB. DIM SHARED if you don't want to have to pass parameters to a SUB.
When using DEFINT or another DEF type, place them before the SUB declarations. If you have a lot of integer variables use DEFINT A-Z to avoid having to declare variables without type suffixes. If not, QB defines them as Single values.