disquette
08-28-2008, 03:37 AM
Hi all,
I really can't figure out what I'm doing wrong in a
simple javascript block. I want to parse the letters of a word one by one,
modify each letter, then output the modified set of letters.
... <snip> ...
lower = "hi"
for (i=0;i<=strLen-1;i++)
currChar = lower.charCodeAt(i);
{
resultChar = currChar + 1;
strOutput = String.fromCharCode(resultChar);
totOutput = totOutput + strOutput;
}
displayMessage (totOutput);
any ideas why totOutput only ever shows the very last modified letter
of the string (in this case "j" is the output, when I'd expect it to
be "ij")?
I really can't figure out what I'm doing wrong in a
simple javascript block. I want to parse the letters of a word one by one,
modify each letter, then output the modified set of letters.
... <snip> ...
lower = "hi"
for (i=0;i<=strLen-1;i++)
currChar = lower.charCodeAt(i);
{
resultChar = currChar + 1;
strOutput = String.fromCharCode(resultChar);
totOutput = totOutput + strOutput;
}
displayMessage (totOutput);
any ideas why totOutput only ever shows the very last modified letter
of the string (in this case "j" is the output, when I'd expect it to
be "ij")?