Dynamic Array (remove, push methods)



Dynamic Array (remove method)
Smart pascal source code
var a : array of Float; procedure ShowData; begin for var f in a do WriteLn(IntToStr(Length(a))+' : '+FloatToStr(f)); end; begin a.Remove(0.5); ShowData; // 0 : a.Add(1.5); a.Remove(0.5); ShowData; // 1 : 1.5 a.Remove(1.5); ShowData; // 0 : a.Add(1.0, 2.0); a.Remove(1.0, 1); ShowData; // 2 : 1 // 2 : 2 a.Remove(1.0, 0); ShowData; // 1 : 2