PDA

View Full Version : Solved: Locals Window



TrippyTom
07-17-2006, 11:22 AM
Is there a reason I am not seeing my variables in the Locals Window? For some reason, my If/Then statements are passing ok, because they're actually going through the statement instead of skipping it, but it's not showing up in the locals window.

Has anyone seen this happen before?

MOS MASTER
07-18-2006, 03:13 PM
Has anyone seen this happen before?

Yeah sure happens to me all the time! :*)

No serious.. are you stepping through the code while watching?

And if so you don't see the variable you are looking for but perhaps you do see in the locals window the name of the parentobject (the module name (standard name: "+modulex" of the procedure you're in!!)

If so press the + sign to expand that module and look at it's children that are curently loaded in your code.

I presume this was your problem.

This happens when your variables are not declared within the scope of the procedure you're running. But you must have declared them outside of the procedure you're running. Perhaps on top of the module as private or public?

Other things could explain this too or be the cause but then I'd have to see your project to see exactly where that little variable of yours is at! :)

But first look for it in the parent (the name of the module you're in and collapse that) :whistle:

HTH.

TrippyTom
07-18-2006, 04:31 PM
Hi again Moose :)

Yes, in the locals window it does show a + icon ... so I clicked to expand it and voila! There's my variables. The variables are being set right, but it's still ending the process.

I do have some PUBLIC variables declared. (shapesPref as Long, spacePref as Single). These are the variables I was trying to track by stepping through the code with F8. Is this perhaps causing a problem with my if/then statements?


If splitPref = "vertical" Then
If Not shapesPref = "" Then
If Not spacePref = "" Then
SplitShape ActiveWindow.Selection.ShapeRange(1), True, myMacros.shapesPref, (spacePref * 72)
Exit Sub
End If
End If
ElseIf splitPref = "horizontal" Then
If Not shapesPref = "" Then
If Not spacePref = "" Then
SplitShape ActiveWindow.Selection.ShapeRange(1), False, myMacros.shapesPref, (spacePref * 72)
Exit Sub
End If
End If
End If

TrippyTom
07-18-2006, 04:33 PM
oh my god,
I just realized my mistake! :) HAHHAAHAHHAAHAH
:rotlaugh:

I should be checking if they're ZERO (0), not "".
Doh!

MOS MASTER
07-19-2006, 09:18 AM
oh my god,
I just realized my mistake! :) HAHHAAHAHHAAHAH
:rotlaugh:

I should be checking if they're ZERO (0), not "".
Doh!

Excellent Tom.. this is the way it should work!!

You have a problem you try, try again and try some more and you find the answer youreself!

Good job now you fully understand what is happening.
Keep it up! :thumb