Post Reply 
[BUG] INPUT -- myriad bugs
09-16-2014, 07:09 PM (This post was last modified: 09-16-2014 08:10 PM by Han.)
Post: #1
[BUG] INPUT -- myriad bugs
Despite specifying a real-type only input variable, the editline insists on inserting single quotes around values. So when a user enters -3 it appears as '-3' on the editline. This of course leads into an invalid input error.

On top of that, the editline is then replaced with the topmost editline from the history -- but not the RPN history, it grabs it from the non-RPN home screen's history.

2 bugs in one... not exactly a bargain :-(

Edit: Looks like it is even worse than I thought.

Code:
EXPORT INEX()
BEGIN
  local xmin,xmax,ymin,ymax,zmin,zmax;
  local zoom,tmode=1,wmode=1;

  input(
    { 
      {xmin,[0],{15,30,0}},
      {xmax,[0],{65,30,0}},
      {ymin,[0],{15,30,1}},
      {ymax,[0],{65,30,1}},
      {zmin,[0],{15,30,2}},
      {zmax,[0],{65,30,2}},
      {zoom,[0],{15,30,4}},
      {tmode,0,{90,10,4}},
      {wmode,0,{90,10,5}}
    },
    "Graph 3D Plot Setup",
    {
      "Xmin=", "Xmax=",
      "Ymin=", "Ymax=",
      "Zmin=", "Zmax=",
      "Zoom=",
      "Transparent?", "Show grid?"
    },
    {
      "Enter the value of left side of the viewing box",
      "Enter the value of right side of the viewing box",
      "Enter the value of back side of the viewing box",
      "Enter the value of front side of the viewing box",
      "Enter the value of bottom side of the viewing box",
      "Enter the value of top side of the viewing box",
      "Enter the zoom factor (must be > 0)",
      "Render surface with transparency?",
      "Show wireframe?"
    });
  return({xmin,xmax,ymin,ymax,zmin,zmax,zoom,tmode,wmode});
END;

Now, enter in the values 3, 4, 5, 6, 7, 8, 9 and leave the two checkboxes checked. The output is: { 1, 1, 5, 6, 7, 8, 9, 0, 0 } -- THIS IS WRONG! Again use 3, 4, 5, 6, 7, 8, 9 and now leave the checkboxes unchecked! -- same output?! So the checkboxes do absolutely nothing!

I started to suspect the an off-by-one error tied to the line number of a field. So I moved tmode and wmode checkboxes to front of the varslist, and this is now the output: { 5, 6, 7, 8, 9, [0], [0], 3, 4} ?! Notice the [0]'s

There is yet ANOTHER bug with INPUT: if a variable is a choosebox type, and is not the last entry in the variables list, then the emulator crashes. If it doesn't crash, then the list is returned as the result, rather than the choice...

Long story short, DON'T USE THE ADVANCED FORM OF INPUT() in firmware 6030!

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
09-17-2014, 01:36 PM
Post: #2
RE: [BUG] INPUT -- myriad bugs
(09-16-2014 07:09 PM)Han Wrote:  Now, enter in the values 3, 4, 5, 6, 7, 8, 9 and leave the two checkboxes checked. The output is: { 1, 1, 5, 6, 7, 8, 9, 0, 0 } -- THIS IS WRONG! Again use 3, 4, 5, 6, 7, 8, 9 and now leave the checkboxes unchecked! -- same output?! So the checkboxes do absolutely nothing!

With firmware 6031 the first example gives the same result. Unchecking the boxes results in

INEX {0, 0, 5, 6, 7, 8, 9, 0, 0} which is closer to correct! Smile

Tom L

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
09-24-2014, 02:32 AM
Post: #3
RE: [BUG] INPUT -- myriad bugs
export in5()
begin
// checkbox mods
local md,d,fcd,fyd,bw;
input({{md,1},{d,1},{fcd,1},{fyd,1},{bw,1}},"turn on variables");
input(md,"momento");
input(d,"trquinho");
input(fcd,"fcd");
input(fyd,"fyd");
input(bw,"bw");
A:=md/(d*(1-0.4*(1.25-sqrt(1.5624-md/(bw*d²*fcd)/0.272)))*fyd);
print();
print("Área de aço = ");
print(A);
end;


SOMEONE CAN HELP ME PLEASE?!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)