Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

WAD Looks to Me Like a Bug in @WORD

Jun
563
4
TCC(30.00.22): C:\>echo /%@word["^c",1,word0, ,word2]/
/ /

TCC(30.00.22): C:\>echo /%@word["^c",1,word0,,word2]/
/word2/

The first line contains a space between the two commas; the second one does not. The function fails to recognize an empty field and returns word 2 when I want word 1. This really messed up a script that was processing a CSV file that had some empty fields.
 
As documented, @WORD considers a sequence of consecutive separators as one separator (there are no empty words). @FIELD will give (the empty) field 1.

Code:
v:\> echo **%@field[",",1,word0,,word2]**
****
 
Duh! Thank you, Vince. I have even made use of that difference when I have fields in a tabular text file with a variabale number of multiple spaces between the fields.
 

Similar threads

Back
Top