Open GoogleCodeExporter opened 9 years ago
Hi Janet, I can confirm this bug. Thanks for taking the time to report it, and
with
clear steps to reproduce. I don't have a workaround at this time.
Original comment by map...@gmail.com
on 6 Nov 2008 at 6:46
Original comment by map...@gmail.com
on 29 Jan 2009 at 9:30
I have a fix for this problem. Do I just post it here?
Original comment by janet.j....@gmail.com
on 13 Feb 2009 at 2:05
Yes please! If it's large you can email it to me, maphew@gmail.com
Original comment by map...@gmail.com
on 18 Feb 2009 at 7:41
The problem arises in `DSMapBookUIPrj` in the code for `frmSelectPages`
Line 97 sets a String variable, `sExp to CStr(dScale) & " " & cmbScale.Text & "
" &
txtScale.Text` , so we have, as an example “2000 = 10000”. Line 98 then
attempts to
evaluate this statement :
{{{
If sExp Then
}}}
and of course it fails, because the string expression cannot be evaluated as
such.
Unfortunately VB6 has no Evaluate or EVAL statement which could be used to
rectify
the problem. So there are two ways to do this:
1. Do a CASE statement on the operator eg:
{{{
SELECT CASE cmbScale.Text
CASE “=”
IF dScale = CInt(txtScale.text) then
pPage.EnablePage = True
pNode.Image = 5
END IF
CASE “<”
IF dScale < CInt(txtScale.text) then
pPage.EnablePage = True
pNode.Image = 5
END IF
}}}
etc etc
2. Bring in the ability to do an eval statement by adding the Microsoft
Script
Control 1.0 ((msscript.ocx) as a Reference in the project. I already had it
listed in
VB6 in Project->References and just had to check it on. There is information
on the
Microsoft Downloads Page about how to get it, but I imagine you will already
have it
somewhere in your system.
The code is then simply:
{{{
96: dScale = m_pMapSeries.Page(lLoop).PageScale
97: sExp = ScriptControl1.Eval(CStr(dScale) & " " & cmbScale.Text & " " &
txtScale.Text
98: If sExp Then
}}}
with only line 97 changing. This is the way I did it, and it works perfectly.
I must be the only person using this, as I could find no other complaints about
the
problem. I currently have 475 maps to print, and need to change a couple of
items on
some of the maps with a bigger scale before they are printed, consequently this
has
really been of great use to me.
If any of this doesn’t make sense, let me know and I will be happy to
elucidate.
Regards,
Janet
Original comment by map...@gmail.com
on 3 Mar 2009 at 6:32
Original issue reported on code.google.com by
janet.j....@gmail.com
on 2 Nov 2008 at 6:13