arcane buglet with maps and pointers to arrays

Started by kdmoyers, May 20, 2020, 09:27:34 AM

Previous topic - Next topic

kdmoyers

I actually stumbled on this.  I am strange.

Code (winbatch) Select
a = arrdimension(5,5)
a[0,0] = "tom"

b = mapcreate()
b["fred"] = "fish"

c = ptrglobaldefine(a)
*c[1,1] = "sally"

b[*c[1,1]] = "cat"
message("test",b["sally"])

p = isdefined(*c[1,1])
q = isdefined(*c[2,2])
message(p,q)

; next line should trigger "array element not defined"
b[*c[2,2]] = "bird"

; instead, it turned b into a simple string
message("test",b)

exit
The mind is everything; What you think, you become.

td

Thanks for not posting this right after a release.  It will get looked into.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

Easy enough fix.  It will be in the next release. 

Thanks again.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kdmoyers

Who indexes a map with a pointer to a nonexistent 2-d array element? 
Leave it to me to write bizarre infinite-number-of-monkeys code. (laugh)


The mind is everything; What you think, you become.

td

If you ever have an urge to work long hours for low pay,  you could have a future as a quality assurance engineer.  Back in the day, there was always one guy or gal you locked in a room with a piece of software. You never released software until they got their hands on it. They would invariable emerge with a bug that an army of testers missed.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

KeithW

LOL,

Back in the '90s we had PAM.  She was a sweet young lady.  But after hours and hours of testing we gave her the program to play with and she would cause crashes that we could never replicate. If she could use the program for two or three days back-to-back without it crashing, it was ready for public consumption.

Keith
PS Pam loved her bubble gum, a big 'O wad at that, and her feet would be doing happy dances at 90 MPH, but other than that, she was a pleasure to be around.