Author Topic: arcane buglet with maps and pointers to arrays  (Read 165 times)

kdmoyers

  • Sr. Member
  • ****
  • Posts: 339
arcane buglet with maps and pointers to arrays
« on: May 20, 2020, 09:27:34 am »
I actually stumbled on this.  I am strange.

Code: Winbatch
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

  • Tech Support
  • *****
  • Posts: 3455
    • WinBatch
Re: arcane buglet with maps and pointers to arrays
« Reply #1 on: May 20, 2020, 09:43:56 am »
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

  • Tech Support
  • *****
  • Posts: 3455
    • WinBatch
Re: arcane buglet with maps and pointers to arrays
« Reply #2 on: May 20, 2020, 10:55:08 am »
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

  • Sr. Member
  • ****
  • Posts: 339
Re: arcane buglet with maps and pointers to arrays
« Reply #3 on: May 20, 2020, 11:19:04 am »
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

  • Tech Support
  • *****
  • Posts: 3455
    • WinBatch
Re: arcane buglet with maps and pointers to arrays
« Reply #4 on: May 21, 2020, 09:59:22 am »
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

  • Full Member
  • ***
  • Posts: 147
Re: arcane buglet with maps and pointers to arrays
« Reply #5 on: May 21, 2020, 11:13:32 am »
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.