Const cap = 10
while not terminated do begin UpdateWorld; if self.capacity < cap then PlaySound('C:\Windows\Media\notify.wav'); Sleep(100); end;