sb / smallbasic-editor

Home to the Small Basic editor (beta)
https://smallbasic-publicwebsite-code.azurewebsites.net/
MIT License
101 stars 34 forks source link

Array breaks after Push and Pop #170

Open nonkit opened 3 years ago

nonkit commented 3 years ago

An array will break after Stack.PushValue() and Stack.PopValue(). #119 is a related issue. Sample code is:

e[1] = "one"
e[2] = "two"
e[3] = "three"
DumpE()
Stack.PushValue("local", e)
e = ""
e = Stack.PopValue("local")
DumpE()

Sub DumpE
  If Array.IsArray(e) Then
    For i = 1 To 3
      TextWindow.WriteLine("e[" + i + "]=" + e[i])
    EndFor
  Else
    TextWindow.WriteLine("e = " + e)
  EndIf
EndSub