Hi, I was wondering whether this use of SetEnv() / GetEnv() is safe or not:
Graphics 800,600,32,2 SeedRnd MilliSecs() SetBuffer BackBuffer() ;variables Global scrw = GraphicsWidth() Global scrh = GraphicsHeight() Global age = 10 Type bug Field x,y,n$,c End Type ;setup ;main loop While Not KeyHit(1) Cls Color 255,255,255 Rect 100,100,scrw-200,scrh-200,0 For b.bug = Each bug Color b\c,127+Sin(b\x*10)*127,127+Sin(b\y*10)*127 Rect b\x-20,b\y-20,41,41,0 Color 255,255,255 Text b\x,b\y,b\n$,1,1 b\x=b\x+Rnd(-5,5) b\y=b\y+Rnd(-5,5) If b\x<120 Then b\x=120 If b\y<120 Then b\y=120 If b\x>scrw-120 Then b\x=scrw-120 If b\y>scrh-120 Then b\y=scrh-120 Next Locate 0,0 Print "<Insert> to Make bug" Print "<Delete> To kill bug" If KeyHit(210) Then FlushKeys():makebug(Input("Make Name : ")):FlushKeys() If KeyHit(211) Then FlushKeys():killbug(Input("Kill Name : ")):FlushKeys() Flip Wend End ;functions Function makebug(name$) If name$<>"" And Object.bug(GetEnv("bug_"+name$))=Null b.bug = New bug b\x = Rnd(100,scrw-100) b\y = Rnd(100,scrh-100) b\n$ = name$ b\c = Rnd(0,255) SetEnv "bug_"+name$,Handle(b) EndIf End Function Function killbug(name$) b.bug = Object.bug(GetEnv("bug_"+name$)) If b.bug <> Null Delete b EndIf End Functionthanks