It behaves the same with in v16r4 also.
Seems like a bug to me!
Pat
On 27 November 2017 at 22:28, Jim Hays via 4D_Tech <[email protected]>
wrote:
> This is just a weird oddity I came across. I can't think of a good reason
> to use this code in a safe way, but here it is. (If anyone can think of a
> legitimate case where you might risk range check errors, etc., I might
> submit a bug report. Maybe there is another reason to use a function to
> return an array index.)
>
>
> // test routine
>
> ARRAY TEXT(aText;4)
> C_LONGINT($index)
> $index:=0
>
> aText{Index_Increment (->$index)}:="one"
> aText{Index_Increment (->$index)}:="two"
> aText{Index_Increment (->$index)}:="three"
> aText{Index_Increment (->$index)}:="four"
>
>
> // Index_Increment is:
>
> C_POINTER($1)
> C_LONGINT($0)
> $1->:=$1->+1
> $0:=$1->
>
>
> In 4D v12, the test routine runs fine.
> in 4D v16R5, the subroutine is called twice each time
>
> Here's a quicker test for fun to see it in action:
>
> ARRAY TEXT(aText;1)
> aText{Num(Request("Enter 1"))}:="Bob's your uncle"
>
>
> Jim
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ: http://lists.4d.com/faqnug.html
> Archive: http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub: mailto:[email protected]
> **********************************************************************
--
*************************************************
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************