所以我在寻找一种方法来暂时存储值,以便他们可以在需要时删除将int添加到字符串名称的结尾?
我创造了18串(我可能会对此完全错误的方式,以便纠正我,如果我错了!):INFO1 ,info2,info3等...
我想设置每一个到一个特定的值取决于用户所在的洞,这是我如何描绘它。
hole = 1;
info + hole = current; <--- current is a string with a value already.
hole++;
(所以INFO1 =电流值1)
info + hole = current; <--- current is a new string with a new value similar to the first.
hole++;
(所以INFO2 =电流值2)
如果您需要更多的代码,请让我知道。我决定我会跳过它,并不打扰社区的问题,所以我删除了代码,然后决定不,我真的想要这个功能。如果需要的话,我会很快重写它。
它应该是'info [hole-1] = current',因为字符串数组是零索引的。 –
好赶上,编辑它,谢谢! –
真棒谢谢你! – Rob