HoMoReXuaL
2012-07-03 19:47:06
Hello, im working on a bot and this is the code that i am having problems with:
repeat
PlayerName := (PlayerName + textLine[counter]);
counter:= counter+1;
until
textLine[counter] = ':';
it is supposed to get the player's name who has just spoken but as you can see, if there is no colon in a given string it will go out of bounds, which is the error i am receiving. I was wondering if there was any way to check the length of the string like in java you can use string.length , Thanks HoMo
repeat
PlayerName := (PlayerName + textLine[counter]);
counter:= counter+1;
until
textLine[counter] = ':';
it is supposed to get the player's name who has just spoken but as you can see, if there is no colon in a given string it will go out of bounds, which is the error i am receiving. I was wondering if there was any way to check the length of the string like in java you can use string.length , Thanks HoMo