Character Placement in a String

id: 750602

category: Help with Scripts

posts: 3

eefie_gang eefie_gang loading
I am helping someone make a save system for their game, but I am having issues with the loading system. I can not figure out how to detect what position a specific character is in the string. let's say I have a save code something like this “816746334,8744.37484553/38594”. so lets say I am trying to get the number in between the comma and the period, I would say to just take specific characters but the issue is that the other numbers can vary in size. like the first number could be anywhere form 3 characters to 40 characters. so my question is how do I detect what position the comma is in the variable string?
BigNate469 BigNate469 loading
set [index v] to [0]
set [output v] to []
repeat until <(letter (index) of [save code]) = [,]>
change [index v] by [1]
end
repeat until <(letter (index) of [save code]) = [.]>
set [output v] to (join [output] (letter (index) of [save code]))
change [index v] by [1]
end
eefie_gang eefie_gang loading