Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:23 26 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Pointer to the conversation about the LINE bug

Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4038
Posted: 09:58am 28 Feb 2024
Copy link to clipboard 
Print this post

Hi folks,

Apologies but can someone point me at the original conversation/thread describing the LINE / integer array bug that Peter has just fixed. I need to copy Peter's fix into MMB4L but want a test program first.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 10:54am 28 Feb 2024
Copy link to clipboard 
Print this post

hi Tom,
   you are probably looking for this posting:
https://www.thebackshed.com/forum/ViewTopic.php?TID=16657&P=4#218184

it starts on page 4 of the thread titled "PicoMite USB betas"


cheers,
rob   :-)
Edited 2024-02-28 20:56 by robert.rozee
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4038
Posted: 11:07am 28 Feb 2024
Copy link to clipboard 
Print this post

Thanks Rob.
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 11:43am 28 Feb 2024
Copy link to clipboard 
Print this post

Tom

You probably won't see the problem. I introduced it in 5.08 when I was doing the big tidy up of parsing arrays used as parameters in drawing statements. Actually, I can't see what the bug was in my code. The fix was just to revert the function getargaddress  to a previous working version
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4038
Posted: 12:05pm 28 Feb 2024
Copy link to clipboard 
Print this post

  matherp said  Tom

You probably won't see the problem. I introduced it in 5.08 when I was doing the big tidy up of parsing arrays used as parameters in drawing statements. Actually, I can't see what the bug was in my code. The fix was just to revert the function getargaddress  to a previous working version


Thanks Peter, but I only copied the implementation of LINE from the PicoMite two days ago so I suspect the issue is present.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 12:15pm 28 Feb 2024
Copy link to clipboard 
Print this post

This is a quick way to test it
  Quote  A minimal command line version.
> dim x%(3)=(30,90,90,30), y%(3)=(30,30,90,90)
> Line x%(0),y%(0),x%(1),y%(1)
>

Draws 3 sides of a square but the 4th finishes at (0,0)


Edit.
Just found an odd thing. It only happens if "%" is used.
Dim Integer ... works properly.
Edited 2024-02-28 22:26 by phil99
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4038
Posted: 06:51pm 02 Mar 2024
Copy link to clipboard 
Print this post

  matherp said  Actually, I can't see what the bug was in my code. The fix was just to revert the function getargaddress  to a previous working version


In the un-reverted code where the integer and float arrays were using the same path you were skipping a potential "!" at the end of a variable name but not a potential "%" character, change this:

do {
   p++;
} while (isnamechar(*p));
if (*p == '!') p++;
if (*p == '(') {
   p++;
   skipspace(p);
   if (*p != ')') {  // array element
       *n = 1;
       return;
   }
}


to this:

do {
   p++;
} while (isnamechar(*p));
if (*p == '!' || *p == '%') p++;  // <--------- changed line
if (*p == '(') {
   p++;
   skipspace(p);
   if (*p != ')') {  // array element
       *n = 1;
       return;
   }
}


  phil99 said  Just found an odd thing. It only happens if "%" is used.


As it happens, not an odd thing, the whole problem is that Peter's refactoring introduced a bug where the potential "%" is not skipped.

Best wishes,

Tom
Edited 2024-03-03 04:52 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 07:04pm 02 Mar 2024
Copy link to clipboard 
Print this post

  Quote  change this:

  Quote  to this:

thanks
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024