Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: rrc1962 on December 21, 2011, 09:26:02 PM
-
This is an odd problem. In the code below, I get the error message "Error line 64 - Internal Error - <Dialog>". Line 64 is.....
button = Dialog( Dlg1 )
See code segment below. I developed a really cool screenset using a number of these dialog functions. I developed it on my laptop running Win7 and it all works perfectly. When I run the same code on XP, I get the above error.
Has anyone seen this before? Is there something from microsoft that I need to install to make the Dialog function work in XP?
Thanks.
Begin Dialog UserDialog1 20,40,240,110,"Enter Circle Parameters", .enable
OKButton 190,20,40,14
CancelButton 190,40,40,14
text 10,10,40,10, "Width"
text 10,25,40,10, "Height"
text 10,40,40,10, "Kerf Width"
text 10,55,40,10, "Feed Rate"
text 10,70,40,10, "Num Points"
text 10,85,40,10, "Inner Offset"
textBox 50,10,30,10, x1,.width
textBox 50,25,30,10, x2,.height
textBox 50,40,30,10, x3,.kerf
textBox 50,55,30,10, x4,.feed
textBox 50,70,30,10, x5,.points
textBox 50,85,30,10, x6,.offset
GroupBox 95,10,80,45, "Kerf Compensation", .groupBox1
OptionGroup .grp1
OptionButton 105,20,54,10,"None"
OptionButton 105,30,54,10,"Inside"
OptionButton 105,40,54,10,"Outside"
End Dialog
Dim Dlg1 As UserDialog1
Dlg1.width = settings(2)
Dlg1.height = settings(3)
Dlg1.kerf = settings(0)
Dlg1.feed = settings(1)
Dlg1.grp1 = settings(12)
Dlg1.points = settings(13)
Dlg1.offset = settings(14)
button = Dialog( Dlg1 )
opt1 = Dlg1.grp1
nWidth = Dlg1.width
nHeight = Dlg1.height
kerf = Dlg1.kerf
feedRt = dlg1.feed
numSides = Dlg1.points
offset = Dlg1.offset
If button = -1 Then
-
I get the same error running in XP Mode on Windows 7, but it does work on just Windows 7 after removing the "... = settings()" function calls and the "If Button = -1 then" lines.... Error is then on line 26, but it's referring to the same thing. Funy that on Win7 it works OK though.
Nothing, AFAIK, needs to be installed to make this work - the function should be supplied by Enable...
I'm sick today, but if I get some time where I'm feeling OK I will go ever the code and look for errors. I just can't concentrate right now...
-
The cypress man is pretty cr@p but I reckon the syntax of your textboxes is incorrect and should be:
TextBox X, Y, DX, DY, .Field$[, Options]
which means (if I understand what you're trying to do):
textBox 50,10,30,10, .width,0
and then later:
Dlg1.width = settings(2)
Certainly if I mod your code as per...
Begin Dialog UserDialog1 20,40,240,110,"Enter Circle Parameters", .enable
OKButton 190,20,40,14
CancelButton 190,40,40,14
text 10,10,40,10, "Width"
text 10,25,40,10, "Height"
text 10,40,40,10, "Kerf Width"
text 10,55,40,10, "Feed Rate"
text 10,70,40,10, "Num Points"
text 10,85,40,10, "Inner Offset"
textBox 50,10,30,10, .width,0
textBox 50,25,30,10, .height,0
textBox 50,40,30,10, .kerfWidth,0
textBox 50,55,30,10, .feedrate,0
textBox 50,70,30,10, .numPoints,0
textBox 50,85,30,10, .InnerOffset,0
GroupBox 95,10,80,45, "Kerf Compensation", .groupBox1
OptionGroup .grp1
OptionButton 105,20,54,10,"None"
OptionButton 105,30,54,10,"Inside"
OptionButton 105,40,54,10,"Outside"
End Dialog
Dim Dlg1 As UserDialog1
Dlg1.width = 1000
Dlg1.height = 500
Dlg1.kerfWidth = 1
Dlg1.feedrate = 6000
Dlg1.numPoints = 50
Dlg1.innerOffset = 50
button = Dialog( Dlg1 )
then I get this under XP (see attached pic) - is this what you intended?
Not sure why it worked under W7 because I reckon it shouldn't have. Local conditions of course may vary.
Cheers
Ian
-
That did the trick. Thanks for the tip. Weird how this error only happens in XP. It's usually the other way around. XP is usually more stable.
-
I think that's perhaps the point. As well as perhaps being more stable XP seems less forgiving of incorrect syntax. Your code SHOULD have failed on W7 and the fact that it didn't is W7's shortcoming NOT XP's.
-
I see your point...