Page 1 of 1

Deleting characters from a string?

Posted: Fri Feb 11, 2011 12:45 am
by dburdan
I am trying to remove the first 5 characters from a string as I bring it into the program. I have yet to accomplish this. What I have so far:

Code: Select all

   put URL("file:" & specialFolderPath("documents") & "/GameData.hs") into LocalHighScore #This part works fine
   replace char 1 to 5 with empty in LocalHighScore
   put base64decode(LocalHighScore) into LocalHighScore
   answer LocalHighScore #Just here to see if it works
It doesn't delete any characters. I have tried many different methods and looked in the dictionary with no luck.

Thanks in advance Klaus :D

Re: Deleting characters from a string?

Posted: Fri Feb 11, 2011 1:10 am
by doc
Try this:

Code: Select all

delete char 1 to 5 in LocalHighScore
-Doc-

Re: Deleting characters from a string?

Posted: Fri Feb 11, 2011 1:31 am
by dburdan
doc wrote:Try this:

Code: Select all

delete char 1 to 5 in LocalHighScore
-Doc-
THANKS!!!

Re: Deleting characters from a string?

Posted: Fri Feb 11, 2011 11:43 am
by Klaus
Oh, I am a bit lat, but looks like I have to earn the "Thanks" now :D

Yep, you need to supply in your scripts WHERE you want to replace something!

Computers are deaf, dumb and blind!
So what is obvious to us is greek to the machine :D :D :D


Best

Klaus