A "SafeChars" plugin request...

May 24, 2010
855
0
Northlake, Il
I've been using "SafeChars" for quite a while now, and have been quite happy with it (thank you, Charles! Particularly for the "/E:" parameter) until now. But in the application I am now trying write it is doing something totally unexpected (meaning I didn't expect it to do it and don't have a clue as to why it is doing it; and I just downloaded and installed the latest version of it which is still doing it) that is totally unacceptable in the application that I am attempting to use it for, so much so that I will almost certainly have to write a C++ program (I'm seriously trying to get away from writing C++ programs for relatively simple tasks) to "work around" the issue. So what is the issue? Simple, it really appears that both "@SafeRead" and "@SafeLine" strip leading blanks off of the lines that they read and that literally destroys the data I am trying to process in terms of my intended use for it. (The "@FileRead" and "@Line" functions do not do this.) The reason I really need to use SafeChars (or something similar if it existed) in the first place is because the data I am attempting to process has embedded commas (I am using "UnSafe /E:," to make the embedded commas "safe"; and of course data that is returned by plain old "@FileRead" is literally unusable in many contexts in TCC batch files if it contains embedded commas) , and since that data comes from an external source (specifically the web, of course) I have absolutely no control whatsoever over whether or not it contains those embedded commas. And the task I am trying to perform is to "reformat" that data, which I really need to do to use it for its intended purpose, but, again, the leading blanks are significant. So, Charles, can you please fix this in some way (it's not a character "translation" issue, of course, so the /E: parameter isn't in any way going to do it) in the not-too-distant future? I will almost certainly have to write a C++ program to do this task now, of course, because what I am trying to do needs to be accomplished today. Thank you!

P. S. If you are wondering why I just don't use something like Perl or similar languages (I can't think of the names of any of them at the moment - you will understand why in just a moment) the reason is because of my often-mentioned very-severe memory problems. Learning and therefore remembering "new" stuff is almost impossible for me, but I (mostly) still remember stuff I learned before my my memory issues became serious; and C++ "strongly" falls into that category. (And good documentation, such as Take Command/TCC have, is absolutely essential for me.) And if you are also wondering why I don't just use C++ all of the time in the first place, it is because I am probably at least an order of magnitude slower writing programs than I was in my "prime", and since there is almost always a lot of "infrastructure" code in a C++ program, as well as a general lack of built-in functions to do many of the things that TCC does naturally, so to speak (I have been slowly writing a lot of them over the years but remembering what I have already written at any given point in time is also a minor problem) this means that there are typically many more lines of code to accomplish a given task in a C++ program than there are in a TCC batch file; and since my "slowness" is strongly related to the number of lines of code I actually have to write, that generally means that it takes a lot more time to write a C++ program than it takes to write a TCC batch file (assuming that TCC can do it at all, of course, which it mostly can) that accomplishes the same task, and that gives me a strong bias against C++ programs and for TCC batch files.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,466
88
Albuquerque, NM
prospero.unm.edu
Simple, it really appears that both "@SafeRead" and "@SafeLine" strip leading blanks off of the lines that they read and that literally destroys the data I am trying to process in terms of my intended use for it. (The "@FileRead" and "@Line" functions do not do this.)

If it's doing that, it's certainly not by design. I'll take a look at it tomorrow.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,466
88
Albuquerque, NM
prospero.unm.edu
So what is the issue? Simple, it really appears that both "@SafeRead" and "@SafeLine" strip leading blanks off of the lines that they read and that literally destroys the data I am trying to process in terms of my intended use for it. (The "@FileRead" and "@Line" functions do not do this.)

Dave: (it is Dave, isn't it? -- my memory isn't so great either!)

I'm not seeing the behavior you describe; I always get leading and trailing blanks back, as expected.

Code:
C:\BIN\JPSDK\safechars>ver /r

TCC  13.00.23   Windows XP [Version 5.1.2600]
TCC Build 23   Windows XP Build 2600  Service Pack 3
Registered to Charles Dye - 5 System License

C:\BIN\JPSDK\safechars>plugin /i safechars
Module:      C:\BIN\JPSDK\safechars\release\safechars.dll
Name:        SafeChars
Author:      Charles Dye
Email:       cdye@unm.edu
Web:         http://www.unm.edu/~cdye/plugins/safechars.html
Description: Read and write text containing special characters
Implements:  @safeclip,@safeclipw,@safeenv,@safeexp,@safeline,@saferead,@safewrite,@uquotes,_amp,_bq
,_caret,_closebrk,_closepat,_gt,_lt,_openbrk,_openpat,_pct,_quote,_vbar,safecharshelp,safeecho,safee
chos,unsafe
Version:     1.5  Build 3

C:\BIN\JPSDK\safechars>type spaces.txt
Zero
 One
  Two
   Three
    Four
     Five

C:\BIN\JPSDK\safechars>for /l %i in ( 0, 1, 5 ) echo %i "%@safeline[spaces.txt,%i]"
0 "Zero"
1 " One "
2 "  Two  "
3 "   Three   "
4 "    Four    "
5 "     Five     "

C:\BIN\JPSDK\safechars>set handle=%@fileopen[spaces.txt,r]

C:\BIN\JPSDK\safechars>for /l %i in ( 0, 1, 5 ) echo %i "%@saferead[%handle]"
0 "Zero"
1 " One "
2 "  Two  "
3 "   Three   "
4 "    Four    "
5 "     Five     "

C:\BIN\JPSDK\safechars>set rv=%@fileclose[%handle] & set handle=

C:\BIN\JPSDK\safechars>

Can you give me a minimal test case which reproduces this behavior? Thanks!
 
Similar threads
Thread starter Title Forum Replies Date
M A (presumbly pretty simple) SafeChars plugin request... Plugins 2
M How to? Use SafeChars plugin... Plugins 2
dcantor Error in SAFECHARS plugin v 1.9.0 Plugins 2
M SafeChars plugin misbehaving... Plugins 3
dcantor Suggestion for SafeChars plugin Plugins 7
M Charles, I just installed the "new" SafeChars plugin, ... Plugins 5
M A problem with the SafeChars Plugin... Plugins 30
S SafeChars plugin Plugins 2
Charles Dye New plugin: SafeChars Plugins 15
thedave SafeChars: Escaped version of @unsafe Plugins 7
S How to? SafeChars.dll question Plugins 4
Stefano Piccardi SafeChars thank you Plugins 2
Joe Caverly 64-bit Plugin development using PureBasic Plugins 15
R New Plugin Plugins 0
Alpengreis elevated plugin questions Plugins 3
fpefpe utf-8 support in sdk/plugin api Plugins 4
S How to? Can @DU function in 4Utils64 plugin somehow cater for dirs with spaces? Plugins 3
vefatica Plugin access to arrays? Plugins 4
vefatica How big is a plugin's parameter buffer? Plugins 5
C @knownpath plugin Plugins 0
Charles Dye Updated OSD plugin Plugins 0
Joe Caverly C# plugin framework for JPSoft's TCC Plugins 0
dcantor Help for newest version of TEXTUTILS plugin Plugins 10
dcantor UISTUFF plugin missing help topic Plugins 12
dcantor Request for documentation for ISO8601 plugin Plugins 4
vefatica Possible with a plugin? Plugins 6
dcantor Inconsistency between textutils plugin and wrap utility Plugins 2
M (Stupid?) Problem with 64-bit 4Utils plugin... Plugins 3
H Latest ISO8601 plugin? Plugins 1
Charles Dye New plugin: QKeys Plugins 34
S Plugin to quickly locate all files hard linked together Plugins 5
S Documentation Plugin everything.dll Plugins 5
newbie How to? Multi-plugin installation errors, Re: FedUtils8 Plugins 7
vefatica Plugin -> thread -> Command() -> Ctrl-C? Plugins 20
Charles Dye A weirdoid plugin question Plugins 6
M A weird error re a plugin... Plugins 0
vefatica Plugin dilemma Plugins 2
fpefpe Documentation Plugin API/SDK Plugins 3
C Looking for Vince's old 4UTILS plugin for TCMD v8 Plugins 1
S DESKTOP plugin - anyone ? Plugins 0
C How to? a plugin to sort Outlook Express "rules" Plugins 0
M ISO Plugin: Yes, it's wonderful, but it could be yet more wonderful... Plugins 7
M The ISO plugin is wonderful, but it lacks a little something... Plugins 22
Charles Dye Beta plugin: HidePasswords Plugins 3
M ISO8601 Plugin not "reporting" errors to TCC... Plugins 4
Frank 4console plugin Plugins 4
S WAD ISO8601 Plugin Plugins 15
Joe Caverly Plugin and 64-bit TCC Plugins 3
C Problem with FixNames plugin Plugins 9
dcantor Suggestion and request for DBF plugin Plugins 6

Similar threads