Thread: strlen + #e
View Single Post
  #14  
Old 01-26-2004, 08:58 PM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by R0bin
setstring tword2,;
setstring tword,Blahblah;
for (i=0;i<strlen(#s(tword));i++) {
setstring tword2,#s(tword2)#e(i,1,#s(tword));
}

Still gives BlahblahB, dunno why.
Wtf, a script did something similar to me before. After experimenting with it a minute ago... I think I know what does it. The script was being ran through the second you put it in a level and clicked "Close" on the script dialog. It set the first two strings, ignored the loop, and set the string inside of the for loop. Since i hadn't been set to anything yet, it was set as 0, so it set "tword2" as B initially. ...but that wouldn't explain why it stayed there even after you clicked "Play", since it should have unset tword2 before running through the loop. Weird.

Ok... nor does that explain why the B is on the END of your string...
OH, wait, did you use the debugger to view the string, or did you press F4 and look at the flag list? If you used F4, it might have re-parsed through the script and did what I said at the beginning. That would explain the B at the end rather than the beginning.

Yeah, I just tested out that theory. That's exactly what it seems to be doing. Obviously a bug, as it shouldn't be going inside of a loop when it sets initial strings. Well, it's a bit awkward that it would even set strings before entering the level anyway...
__________________
Kat

Last edited by -Ramirez-; 01-26-2004 at 09:09 PM..
Reply With Quote