byref parameter bug?
issueid=500 18-01-2016 20:54
Number of reported issues by dcromley: 12
byref parameter bug?
The 2 function parameters get mixed up?

It's been awhile since I've been here. TB is still my language of choice for the desktop. I follow the forum sometimes -- you guys are way above me, but I still use TB.

I am Windows 10; thinAir shows I hope this little script show the bug. At least I hope it's a bug and not a stupid mistake on my part :)

  Uses "console"
  Dim i1 As Long, z1 As Single  
  z1 = 7
  For i1 = 1 To 3
    PrintL "A", z1, "shows 2 as expected (except first time is 7)"
    sub1(5, z1)
    PrintL "D", z1, "shows 2 as expected"
  Next i1

Sub sub1(single1 As Single, ByRef single2 As Single) As Single
  PrintL "B", single2, "shows 5 ??"  
  single2 = 2
  PrintL "C", single2, "shows 2 as expected"
End Sub
Issue Details
Issue Number 500
Project thinBasic
Category Core engine (thinCore.dll)
Status Fixed
Priority 5 - Medium
Affected Version 1.9.16.x
Fixed Version 1.9.16.x
Milestone (none)
Users able to reproduce bug 1
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)

19-01-2016 10:11
thinBasic author
I'm checking.
Thanks for reporting

19-01-2016 23:37
thinBasic author
I think I've fixed.
Will be release in next thinBasic

20-01-2016 20:28
As always, you [all] are very responsive.

21-01-2016 00:06
thinBasic author
We try :)
Just release thinBasic version with this fix inside.

Thanks for reporting!


+ Reply