public static byte Getfreepotslot(byte[] r) { try { for (byte b = 0; b < r.Length; b++) if (r[b] == 0) return b; } catch (Exception ex) { Systems.Debugger.Write(ex); } return 255; }