WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: kdmoyers on May 20, 2020, 09:27:34 AM

Title: arcane buglet with maps and pointers to arrays
Post by: kdmoyers on May 20, 2020, 09:27:34 AM
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
Title: Re: arcane buglet with maps and pointers to arrays
Post by: td on May 20, 2020, 09:43:56 AM
Thanks for not posting this right after a release.  It will get looked into.
Title: Re: arcane buglet with maps and pointers to arrays
Post by: td on May 20, 2020, 10:55:08 AM
Easy enough fix.  It will be in the next release. 

Thanks again.
Title: Re: arcane buglet with maps and pointers to arrays
Post by: kdmoyers 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)


Title: Re: arcane buglet with maps and pointers to arrays
Post by: td 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.
Title: Re: arcane buglet with maps and pointers to arrays
Post by: KeithW 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.