Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Fri Apr 04, 2003 3:03 pm Post subject: Retrieving the current fieldseperator |
|
|
Hi all,
I've thought about a way to retrieve the current fieldseperator, which can be handy when parsing, for example, HTML files. Just go to the GetFieldsep subroutine, and the %%Fieldsep variable will hold the current fieldseperator.
Know bug(s):
If you use a fieldseperator of the ASCII value 33 or lower, it won't recognize it, because when you parse it, it will be deleted...
Code: | Option Fieldsep,|
Gosub GetFieldsep
Info The current fieldseperator is %%Fieldsep.
Exit
:GetFieldsep
%%Fieldsep = 1
repeat
%%Justatempetorialvariable = %%Justatempetorialvariable@chr(%%Fieldsep)
%%Fieldsep = @succ(%%Fieldsep)
until @equal(%%Fieldsep,256)
parse "%%Justatempetorialvariable",%%Justatempetorialvariable
%%Fieldsep = @chr(@fadd(@len(%%Justatempetorialvariable),33))
exit |
|
|