Each time I see our Cobol programmers parsing with abandon, I wish I had a similar facility in MSched.
They have a command that works like this, for example... with a delimited file as in EDI applications...
UNSTRING SPLIT-IN-REC DELIMITED BY ELEMENT-SEPARATOR
INTO LINE-SEG(1) LINE-SEG(2)
LINE-SEG(3) LINE-SEG(4)
LINE-SEG(5) LINE-SEG(6)
LINE-SEG(7) LINE-SEG(7)
This would be a real time saver for parsing files; instead of using Readln/Position/Midstr/Writeln loops, use a line "unstring" command.
Any chance of getting such an enhancement?
Unstring Feature
Moderators: JRL, Dorian (MJT support)
- tony_smith
- Pro Scripter
- Posts: 70
- Joined: Wed May 14, 2003 8:25 pm
- Location: Vancouver BC Canada
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Have you checked out what you can do with Separate> ?
From the Help file:
From the Help file:
Separate>list,delimiter,returnvar
Separate takes a list, a delimiter and returns the elements of the list. The command returns a number of variables, one for each list element, each with the suffix "_n" where n is the index of the element in the list. The variable names are determined by the name given in returnvar. e.g. returnvar_1, returnvar_2, etc. Also returned is the number of elements in the list, in returnvar_count.
Abbreviation : SEP
Example
GetFileList>c:\temp\*.*,files
Separate>files,;,file_names
MessageModal>Num Files: %file_names_count%
Let>k=0
Repeat>k
Let>k=k+1
Message>file_names_%k%
Until>k,file_names_count
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- tony_smith
- Pro Scripter
- Posts: 70
- Joined: Wed May 14, 2003 8:25 pm
- Location: Vancouver BC Canada
Duuuhhh... on me!
Of course! I have been using SEP for years, but only in the file list routine... which I have copied/pasted into many scripts, but I was never really conscious of the what was going on within the two lines (GFL/SEP) It never really came to mind that I should explore SEP.
I have some parse routines that seem to run forever, so I will give SEP a whack when I have a chance... see if I can save some time.
Thanks for pointing this out, Bob
Tony
I have some parse routines that seem to run forever, so I will give SEP a whack when I have a chance... see if I can save some time.
Thanks for pointing this out, Bob

Tony