SWAP does not work for UDT, silently ignored
issueid=564 10-11-2019 16:01
Super Moderator
Number of reported issues by Petr Schreiber: 162
SWAP does not work for UDT, silently ignored

Hi Eros,

I noticed SWAP does not trigger any runtime error, but it also does nothing for UDT.

If we don't want to support this scenario, I think RunTimeError should be triggered.

TYPE Point2D
  x AS SINGLE
  y AS SINGLE
END TYPE

dim a as Point2D
dim b as Point2D
a.x = 1
b.x = 2

SWAP a, b

msgbox 0, a.x ' unchanged
msgbox 0, b.x ' unchanged

Petr
Issue Details
Issue Number 564
Project thinBasic
Category Core engine (thinCore.dll)
Status Confirmed
Priority 1 - Highest
Affected Version 1.10.0
Fixed Version (none)
Milestone (none)
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)




11-11-2019 22:10
Member
meanwhile, I think workaround is Memory_Swap
https://www.thinbasic.com/community/...highlight=type

+ Reply