Define inconsistency

Everything else that doesn't fall into one of the other PB categories.
novablue
Enthusiast
Enthusiast
Posts: 177
Joined: Sun Nov 27, 2016 6:38 am

Define inconsistency

Post by novablue »

Does anyone else find it inconsistent that defining a map, list or array will clear its values but defining a variable does not:

Code: Select all

Define NewList TestList.i()
Define Var.i

AddElement(TestList()) : TestList() = 1 : AddElement(TestList()) : TestList() = 2 : AddElement(TestList()) : TestList() = 3
Var = 123

ForEach TestList() 
    Debug TestList()
Next
Debug Var

Debug "-------------"

Define NewList TestList.i()
Define Var.i

ForEach TestList() ; Now Empty
    Debug TestList()
Next
Debug Var ; Still there
User avatar
mk-soft
Always Here
Always Here
Posts: 6248
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Define inconsistency

Post by mk-soft »

Actually, there is the function ClearList.
That NewList works and thus creates a new list is new to me. It says so. New-List

It is also good that the variables are not overwritten.

It doesn't bother me at all.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply