[Javascript] Help with ECMA Scripting
Stephanie Hudson
shudson at tibco.com
Wed Nov 14 15:28:42 CST 2001
Hello everyone,
I'm new to ECMA script and am looking for some help. I'm working with the
StringTokenizer method to parse a string that originated as a comma
delimited file. It's entire content is held in the variable
Inbound_Sequence and the content of this variable is what I'm parsing, based
upon the commas and the carriage return/line feeds at the end of each row.
My question is this:
How can I then load into variables the string I've separated on, before
moving to the next "segment" or token in the string? I know it must be
simple but I don't have an ECMA script reference manual or guide. This
part does what I want and separates based on the commas of the
Inbound_Sequence variable's content. How do I load into a variable after
each one and must I explicitly define a variable for each element?
Here's my script so far:
StrTok = new java.util.StringTokenizer(job.Inbound_Sequence.content, ",
\t\n\r\f");
while (StrTok.hasMoreElements)
{
writeln("Current element is " + StrTok.nextToken);
}
Thanks and regards,
S. Hudson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3944 bytes
Desc: not available
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20011114/8900910f/attachment.bin>
More information about the Javascript
mailing list