The plus sing works fine
1+1=2+2=4+5=9
The minus sign works fine
The divide sign works fine
The * or multiply sign fails
Any help would be appreciated.
Thanks
Charlie Crimmel
xbasic code is below
'Date Created: 11-May-2010 06:59:09 AM
'Last Updated: 14-May-2010 05:15:15 PM
'Created By : charlie
'Updated By : charlie
trace.clear()
dim global base as C
dim global base1 as C
dim global result as C
var->base = ""
var->base1 = ""
var->result = ""
ui_modeless_dlg_box("vn",<<%dlg%
{xmargin=2}
{ymargin=1}
{nocaption}
{font=a,10,b}
{color=white on white}
{font=a,25,b}
[.70 base];
{font=a,28,b}
{style}
$Button {
font:Arial,15,b;
border-shape:SMALL-rounded;
line-style:single;
line-width:1;
line-color:light blue;
fill-style:Gradient Horizontal Top;
fill-color:Pale blue;fill-accent-color:white;
}
$Button:hover,$Button:focused {
font:Arial,18,B;
border-shape:small-rounded;
line-style:single;
line-width:1;
line-color:blue;
fill-style:Gradient horizontal;
fill-color:Green;
fill-accent-color:White;}
}
$frame {
fill-style:Gradient horizontal;
fill-color:White;
fill-accent-color:light Blue;
}
{endstyle};
{color=black on white}
<15,5 1!1><15,5 2!2><15,5 3!3> <15,5+!+>;
<15,5 4!4><15,5 5!5><15,5 6!6> <15,5-!->;
<15,5 7!7><15,5 8!8><15,5 9!9> <15,5*!*>;
<15,5 .!.><15,5 0!0>
{font=a,15,b}
<15,5 Clear!clear> <15,5/!/>;
{font=a,15,b}
<15,5 OK!OK><15,5Cancel!Cancel><15,5 Reset!reset> <15,5=!>;
%dlg%,<<%code%
if a_dlg_button="clear" then
var->base = ""
var->base1 = ""
end if
if a_dlg_button="reset" then
var->base = ""
var->base1 = ""
end if
if a_dlg_button="Cancel" then
var->base = ""
var->base1 = ""
ui_modeless_dlg_close("VN")
end if
if a_dlg_button="OK" then
var->base = ""
var->base1 = ""
ui_modeless_dlg_close("VN")
end if
if a_dlg_button="." then
'Update value in existing variable 'base' to '=Var->base+"."
base = convert_type(a5_eval_expression("=Var->base+\".\""),"C")
trace.WriteLn("Pressed Number .")
end if
if a_dlg_button="1" then
'Update value in existing variable 'base' to '=Var->base+"1"
base = convert_type(a5_eval_expression("=Var->base+\"1\""),"C")
trace.WriteLn("Pressed Number 1")
end if
if a_dlg_button="2" then
'Update value in existing variable 'base' to '=Var->base+"2"
base = convert_type(a5_eval_expression("=Var->base+\"2\""),"C")
trace.WriteLn("Pressed Number 2")
end if
if a_dlg_button="3" then
'Update value in existing variable 'base' to '=Var->base+"3"
base = convert_type(a5_eval_expression("=Var->base+\"3\""),"C")
trace.WriteLn("Pressed Number 3")
end if
if a_dlg_button="4" then
'Update value in existing variable 'base' to '=Var->base+"4"
base = convert_type(a5_eval_expression("=Var->base+\"4\""),"C")
trace.WriteLn("Pressed Number 4")
end if
if a_dlg_button="5" then
'Update value in existing variable 'base' to '=Var->base+"5"
base = convert_type(a5_eval_expression("=Var->base+\"5\""),"C")
trace.WriteLn("Pressed Number 5")
end if
if a_dlg_button="6" then
'Update value in existing variable 'base' to '=Var->base+"6"
base = convert_type(a5_eval_expression("=Var->base+\"6\""),"C")
trace.WriteLn("Pressed Number 6")
end if
if a_dlg_button="7" then
'Update value in existing variable 'base' to '=Var->base+"7"
base = convert_type(a5_eval_expression("=Var->base+\"7\""),"C")
trace.WriteLn("Pressed Number 7")
end if
if a_dlg_button="8" then
'Update value in existing variable 'base' to '=Var->base+"8"
base = convert_type(a5_eval_expression("=Var->base+\"8\""),"C")
trace.WriteLn("Pressed Number 8")
end if
if a_dlg_button="9" then
'Update value in existing variable 'base' to '=Var->base+"9"
base = convert_type(a5_eval_expression("=Var->base+\"9\""),"C")
trace.WriteLn("Pressed Number 9")
end if
if a_dlg_button="0" then
'Update value in existing variable 'base' to '=Var->base+"0"
base = convert_type(a5_eval_expression("=Var->base+\"0\""),"C")
trace.WriteLn("Pressed Number 0")
end if
if a_dlg_button="+" then
base1 = convert_type(a5_eval_expression("=Var->base"),"C")
'Update value in existing variable 'result' to '1
result = "1"
'Clear fields 'Base' in current form.
Base = ""
trace.WriteLn("Pressed Number +")
end if
if a_dlg_button="-" then
'Update value in existing variable 'base1' to '=Var->base
base1 = convert_type(a5_eval_expression("=Var->base"),"C")
'Update value in existing variable 'result' to '2
result = "2"
'Clear fields 'Base' in current form.
Base = ""
trace.WriteLn("Pressed Number -")
end if
if a_dlg_button="*" then
base1 = convert_type(a5_eval_expression("=Var->base"),"C")
'Update value in existing variable 'result' to '3
result = "3"
'Clear fields 'Base' in current form.
Base = ""
trace.WriteLn("Pressed Number *")
end if
if a_dlg_button="/" then
'Update value in existing variable 'base1' to '=Var->base
base1 = convert_type(a5_eval_expression("=Var->base"),"C")
'Update value in existing variable 'result' to '4
result = "4"
'Clear fields 'Base' in current form.
Base = ""
trace.WriteLn("Pressed Number /")
end if
if a_dlg_button="=" then
'Conditional code follows. Executes only if the condition expression is True.
IF Var->result = "1" THEN
'Update value in existing variable 'base' to '=str(val(Var->base1)+val(base),10,2)
base = convert_type(a5_eval_expression("=str(val(Var->base1)+val(base),10,2)"),"C")
END IF
'Conditional code follows. Executes only if the condition expression is True.
IF Var->result = "2" THEN
'Update value in existing variable 'base' to '=str(val(Var->base1)-val(base),10,2)
base = convert_type(a5_eval_expression("=str(val(Var->base1)-val(base),10,2)"),"C")
END IF
'Conditional code follows. Executes only if the condition expression is True.
IF Var->result = "3" THEN
'Update value in existing variable 'base' to '=str(val(Var->base1)*val(base),10,2)
base = convert_type(a5_eval_expression("=str(val(Var->base1)*val(base),10,2)"),"C")
END IF
'Conditional code follows. Executes only if the condition expression is True.
IF Var->result = "4" THEN
'Update value in existing variable 'base' to '=str(val(Var->base1)/val(base),10,2)
base = convert_type(a5_eval_expression("=str(val(Var->base1)/val(base),10,2)"),"C")
END IF
trace.WriteLn("Pressed Number =")
end if
%code%)
1+1=2+2=4+5=9
The minus sign works fine
The divide sign works fine
The * or multiply sign fails
Any help would be appreciated.
Thanks
Charlie Crimmel
xbasic code is below
'Date Created: 11-May-2010 06:59:09 AM
'Last Updated: 14-May-2010 05:15:15 PM
'Created By : charlie
'Updated By : charlie
trace.clear()
dim global base as C
dim global base1 as C
dim global result as C
var->base = ""
var->base1 = ""
var->result = ""
ui_modeless_dlg_box("vn",<<%dlg%
{xmargin=2}
{ymargin=1}
{nocaption}
{font=a,10,b}
{color=white on white}
{font=a,25,b}
[.70 base];
{font=a,28,b}
{style}
$Button {
font:Arial,15,b;
border-shape:SMALL-rounded;
line-style:single;
line-width:1;
line-color:light blue;
fill-style:Gradient Horizontal Top;
fill-color:Pale blue;fill-accent-color:white;
}
$Button:hover,$Button:focused {
font:Arial,18,B;
border-shape:small-rounded;
line-style:single;
line-width:1;
line-color:blue;
fill-style:Gradient horizontal;
fill-color:Green;
fill-accent-color:White;}
}
$frame {
fill-style:Gradient horizontal;
fill-color:White;
fill-accent-color:light Blue;
}
{endstyle};
{color=black on white}
<15,5 1!1><15,5 2!2><15,5 3!3> <15,5+!+>;
<15,5 4!4><15,5 5!5><15,5 6!6> <15,5-!->;
<15,5 7!7><15,5 8!8><15,5 9!9> <15,5*!*>;
<15,5 .!.><15,5 0!0>
{font=a,15,b}
<15,5 Clear!clear> <15,5/!/>;
{font=a,15,b}
<15,5 OK!OK><15,5Cancel!Cancel><15,5 Reset!reset> <15,5=!>;
%dlg%,<<%code%
if a_dlg_button="clear" then
var->base = ""
var->base1 = ""
end if
if a_dlg_button="reset" then
var->base = ""
var->base1 = ""
end if
if a_dlg_button="Cancel" then
var->base = ""
var->base1 = ""
ui_modeless_dlg_close("VN")
end if
if a_dlg_button="OK" then
var->base = ""
var->base1 = ""
ui_modeless_dlg_close("VN")
end if
if a_dlg_button="." then
'Update value in existing variable 'base' to '=Var->base+"."
base = convert_type(a5_eval_expression("=Var->base+\".\""),"C")
trace.WriteLn("Pressed Number .")
end if
if a_dlg_button="1" then
'Update value in existing variable 'base' to '=Var->base+"1"
base = convert_type(a5_eval_expression("=Var->base+\"1\""),"C")
trace.WriteLn("Pressed Number 1")
end if
if a_dlg_button="2" then
'Update value in existing variable 'base' to '=Var->base+"2"
base = convert_type(a5_eval_expression("=Var->base+\"2\""),"C")
trace.WriteLn("Pressed Number 2")
end if
if a_dlg_button="3" then
'Update value in existing variable 'base' to '=Var->base+"3"
base = convert_type(a5_eval_expression("=Var->base+\"3\""),"C")
trace.WriteLn("Pressed Number 3")
end if
if a_dlg_button="4" then
'Update value in existing variable 'base' to '=Var->base+"4"
base = convert_type(a5_eval_expression("=Var->base+\"4\""),"C")
trace.WriteLn("Pressed Number 4")
end if
if a_dlg_button="5" then
'Update value in existing variable 'base' to '=Var->base+"5"
base = convert_type(a5_eval_expression("=Var->base+\"5\""),"C")
trace.WriteLn("Pressed Number 5")
end if
if a_dlg_button="6" then
'Update value in existing variable 'base' to '=Var->base+"6"
base = convert_type(a5_eval_expression("=Var->base+\"6\""),"C")
trace.WriteLn("Pressed Number 6")
end if
if a_dlg_button="7" then
'Update value in existing variable 'base' to '=Var->base+"7"
base = convert_type(a5_eval_expression("=Var->base+\"7\""),"C")
trace.WriteLn("Pressed Number 7")
end if
if a_dlg_button="8" then
'Update value in existing variable 'base' to '=Var->base+"8"
base = convert_type(a5_eval_expression("=Var->base+\"8\""),"C")
trace.WriteLn("Pressed Number 8")
end if
if a_dlg_button="9" then
'Update value in existing variable 'base' to '=Var->base+"9"
base = convert_type(a5_eval_expression("=Var->base+\"9\""),"C")
trace.WriteLn("Pressed Number 9")
end if
if a_dlg_button="0" then
'Update value in existing variable 'base' to '=Var->base+"0"
base = convert_type(a5_eval_expression("=Var->base+\"0\""),"C")
trace.WriteLn("Pressed Number 0")
end if
if a_dlg_button="+" then
base1 = convert_type(a5_eval_expression("=Var->base"),"C")
'Update value in existing variable 'result' to '1
result = "1"
'Clear fields 'Base' in current form.
Base = ""
trace.WriteLn("Pressed Number +")
end if
if a_dlg_button="-" then
'Update value in existing variable 'base1' to '=Var->base
base1 = convert_type(a5_eval_expression("=Var->base"),"C")
'Update value in existing variable 'result' to '2
result = "2"
'Clear fields 'Base' in current form.
Base = ""
trace.WriteLn("Pressed Number -")
end if
if a_dlg_button="*" then
base1 = convert_type(a5_eval_expression("=Var->base"),"C")
'Update value in existing variable 'result' to '3
result = "3"
'Clear fields 'Base' in current form.
Base = ""
trace.WriteLn("Pressed Number *")
end if
if a_dlg_button="/" then
'Update value in existing variable 'base1' to '=Var->base
base1 = convert_type(a5_eval_expression("=Var->base"),"C")
'Update value in existing variable 'result' to '4
result = "4"
'Clear fields 'Base' in current form.
Base = ""
trace.WriteLn("Pressed Number /")
end if
if a_dlg_button="=" then
'Conditional code follows. Executes only if the condition expression is True.
IF Var->result = "1" THEN
'Update value in existing variable 'base' to '=str(val(Var->base1)+val(base),10,2)
base = convert_type(a5_eval_expression("=str(val(Var->base1)+val(base),10,2)"),"C")
END IF
'Conditional code follows. Executes only if the condition expression is True.
IF Var->result = "2" THEN
'Update value in existing variable 'base' to '=str(val(Var->base1)-val(base),10,2)
base = convert_type(a5_eval_expression("=str(val(Var->base1)-val(base),10,2)"),"C")
END IF
'Conditional code follows. Executes only if the condition expression is True.
IF Var->result = "3" THEN
'Update value in existing variable 'base' to '=str(val(Var->base1)*val(base),10,2)
base = convert_type(a5_eval_expression("=str(val(Var->base1)*val(base),10,2)"),"C")
END IF
'Conditional code follows. Executes only if the condition expression is True.
IF Var->result = "4" THEN
'Update value in existing variable 'base' to '=str(val(Var->base1)/val(base),10,2)
base = convert_type(a5_eval_expression("=str(val(Var->base1)/val(base),10,2)"),"C")
END IF
trace.WriteLn("Pressed Number =")
end if
%code%)
Comment