The problem is not your code. When I looked through MemKit.z80 a while ago to see if I could optimize anything, one thing I noticed was that the code for dim()rr had a problem. It is currently programmed to read the length of the variable's name instead of the page it's on. I have already pointed this out to Quigibo and hopefully the next Axe release will include an updated MemKit.8xk.