Just an argument-passing "strangeness" that I didn't expect...

#1
In a batch file (named DemonstrateIt.btm, for instance):






@Echo Off
Set I=1
Do While %I LE %#
@Echo %I: %[%I]
Set /A I+=1
EndDo

Results of executing above batch file:

[Z:\]DemonstrateIt One Two=Three Four
1: One
2: Two
3: Three
4: Four

Does this mean that I'm just out of luck if I want to use an equals sign to separate a parameter "name" from its value?

(Just as an aside, the above is not exactly how/what I am trying to accomplish. It is just a batch file to demonstrate the problem I am having in the real batch file.)
 

rconn

Administrator
Staff member
May 14, 2008
10,788
97
#2
TCC by default considers a = to be a delimiter; this is for compatibility with CMD.

However, if you're running Take Command v13, you can use the "CMDBatchDelimiters=no" option in your TCMD.INI to tell TCC not to treat = as a delimiter. This will break CMD compatibility, so we only recommend it for users with old 4NT scripts.
 
#3
Thank you, Rex. that certainly explains it (although I can't quite figure what "kind" of delimiter it is since it seems to do nothing more than just "disappear"), but I was going to add to the above posting (I don't know how to do that or even if this bulletin-board software now supports it) that the "disappearance" of the equals sign is quite "complete" - Echoing "%$" yields the command line with no equal signs, I checked because I wanted to see if that was a way to "work around" the problem, so obviously it isn't. (The fact that the equals sign is logically treated as white space I do find somewhat weird; and, as I've noted before, V13 would have to be really compelling (which, for me, it isn't - particularly since I find V12 to be almost perfect for my needs) for me to spend any money on it since my financial situation is now so "tight" due to my (many!) disabilities.) But, as always, thank you.

- Dan
 
#6
Thanks, David, that works.

Warning: Long list of "details: (And Rex, you might want to at least "glance at" both the end of the second paragraph and the end of the last paragraph.)

It does mean that I have to "parse" the command line myself, but both of my extensive experience with "parsing" (years ago (before I became disabled and "lost it") I wrote a complete compiler for a high-level language all by myself (the vendor of said language (the “vendor” was IBM who was then the largest vendor of computer hardware in the world (and if this isn’t obvious by now it was for a mainframe) was totally dropping support for it and suggesting that "users" of the language "replacing" it with another "similar" language because they thought that it was better for people to use a "standard" language than it was for them to use a "proprietary" language that they (IBM) had to support, which that was - and the language wasn't even available any more on the latest version(s) of the machine's operating system) which didn't help the major corporation (I won't name it other to say that they are, by far, #1 in the world in their "industry", and it's a major industry so that I can absolutely guarantee with absolutely no doubt whatsoever that you have not only "heard of" it but have also almost certainly spent a significant amount of money on their "products" over the years, probably starting before you were in grade school; and they have literally thousands (if not 10's of thousands, particularly since they were then and are now a "global" corporation) of employees) at all because they had literally hundreds of programs written in that language which is why they were totally willing to let me at least "attempt" to do the task (my "compiler" was at least somewhat of an interpreter" because it turned the program(s) into a (large!) series of calls to subroutines and functions written in assembly language) and they were completely happy with my final results (I was an independent contractor and not an employee; and this was at their corporate headquarters), particularly since it took me less than three months to do it in its entirety and I had a somewhat-working version (it was usable with some amount of manual "editing" which I also did when needed) in less than a month for what they considered to be the "most important" programs written in that language) and the extensive string-processing support provided by TCC's batch-file language (better than any other language that I ever been aware of) means that "parsing" a string is a relatively-trivial task in TCC in almost all cases.)

I’ll note that if you wonder why/how I manage to “keep track” of parenthesized “clauses" that are "nested" so “deeply” (4 “levels” deep, by my count), the "why" is because, for me, one thought leads to another thought leads to another thought … then back to the “previous” thought then back to the “previous” thought then back to the “top-level” thought; the "how" is that I am able to "manage" it because I have a "systematic" (although not quite "automated") way of doing that. I really don’t understand why my “style of writing” is this way, or, even more significantly, why other people don’t write this way. But I’ve tried not doing it (just as I’m trying very hard to avoid the use of “bold” and “bold italic” fonts in my postings), and believe me, I wasn’t at all satisfied with the results. I’m truly sorry if it offends you (or anyone else) in some way.

And on another note just so you can fully understand (maybe this is “bragging”; but because I have “fallen so far” because of my memory loss in particular it pleases me to remember how good in this field I at least used to be) I once knew (very well because I used them one or more times in “real” products/projects) 10 different computer languages, depending upon how you want to count them (for instance, I am counting “regular” Basic and “Visual Basic” as one language, as well as C and C++ and the three different “assembly” languages I used to know – and, even there, I am counting the assembly languages I used to use for the 8008 all of the way up to the Pentium as one language; and, as far as my C++ competency goes, years ago I took a C++ “competency” exam administered by Microsoft (Microsoft evidently considered C++ a very “difficult” language, which it is, and felt that they could “filter” people out by using this exam; but they “dropped” the program a number of years ago because I think that they felt that C++ really was too “difficult” to be a “mainstream” programming language and they came out with C# (as well as the introduction of Java (by Sun, as I recall)) which made C++ effectively obsolete”) and it was a two-hour exam that I finished in about 45 minutes and the Microsoft employee who had administered the exam called me the next day from Microsoft’s corporate offices to tell me that #1. He and several other people in the room who had made a comment about it as they were leaving felt that I had left after 45 minutes because I had “given up” on the test, when, in fact, I tied for the second highest score ever up to that point and he said that he thought that if I had spent another 15 minutes “going over” my answers on the exam before I left I would have gotten the first “perfect” score ever up to that point because he felt that all of the questions I had missed were “easy” (his words)). Simply put, I never met anybody in my 30 years plus of programming (and related tasks) that was even close to me - I was very, very, fast and I had a reputation for “delivering” programs that had absolutely no “bugs” (no, I am not perfect nor infallible nor God; rather it was just that I was a also very good “tester” and I managed to find and fix all of the bugs that anybody (specifically, me) ever found before I “delivered” the program). Believe me, however, that is not even close to the case now. (And as a real irony in this situation if you are not at all aware of it, being very good in computers is very likely a "side-effect" of one of my more-minor "disabilities" - people who have this disability and largely "overcome" it (which I apparently did) tend to be very good in one or more of computers, mathematics, and the arts (particularly music) - and I was very, very, good in the first and quite good in the "music" category of the third (but mathematics not so much because a fair amount of mathematics requires what is, simply put, memorization; and memorization has always been an "issue" for me). And if you are "curious" about what that "disability" is, do a Google search for "computers mathematics music disability" and it shows up (as the second "hit" on the page as of this minute) - and believe me, I had virtually every one of the "symptoms" listed in that "article", usually to a very-high degree. And this is a well-documented side effect of said disability (why you can do that particular Google search to find it); and the only other person in the world that I am both aware of and know anything at all about their work that I would put on a possibly “higher” level on the "computer competency" scale than I at least use to be is Rex - and I'm not even going to speculate as to whether Rex has it! :) )
 
#7
the extensive string-processing support provided by TCC's batch-file language (better than any other language that I ever been aware of)
I think string processing is much easier in lots of other languages.

the "how" is that I am able to "manage" it because I have a "systematic" (although not quite "automated") way of doing that.
My text editor will show matching parentheses.

I really don’t understand [...] why other people don’t write this way.
Perhaps because they want to make it easier for their readers to understand them.

I’m truly sorry if it offends you (or anyone else) in some way.
It just means that probably fewer people will bother to read your posts. Although some may find the eccentric style amusing, and so read your posts when they might not otherwise.

they came out with C#
C# is very similar to Delphi, but with C syntax. Microsoft (rightly) got tired of all the buffer overflows and similar bugs and decided to come up with a language that would avoid them.

(but mathematics not so much because a fair amount of mathematics requires what is, simply put, memorization;
As someone who has a Ph.D. in mathematics, I'm amazed that you think mathematics requires more memorization than other subjects. In my experience, it requires significantly less. If one understands the material, many things can be derived when needed, so memorization is not necessary.

And if you are "curious" about what that "disability" is, do a Google search for "computers mathematics music disability" and it shows up (as the second "hit" on the page as of this minute)
Dyscalculia? Asperger syndrome?
 
#8
I think string processing is much easier in lots of other languages.
Dave, why I certainly can't (and won't) disagree with your experiences, as I believe I indicated, I never ran into a language with better string processing. (Was it was one of the ones I listed? If so, which one? If not, which language(s)?)

My text editor will show matching parentheses.
While I certainly don't doubt that, I've never had an editor that does (Microsoft Word, Notepad, the Visual C++ program editor (even if it does, which I honestly don't remember because it's never been an "issue" for me, I don't think that would really count for writing "text" documents). And I've never had an "editor" other than those in recent years because, #1, I find all of the above to be (at least mostly!) sufficient for the purposes that I use them for, and #2, I haven't had an editor other than those for 20 years or more. (I'll note that because of my memory issues that I've never been happy with editors that used lots of keyboard "options" (like the very limited set of options like Ctrl-C and Ctrl-X and Ctrl-V in most (if not basically all) Windows editors because I won't remember them; and I still use Word 2003 because I found the "buttons" and in later version(s) of Word to be unusable because I could neither see them nor remember them.)
Perhaps because they want to make it easier for their readers to understand them.
While that certainly may be true, I write the way I write, and I am not at all satisfied with leaving out stuff that I at least think is both relative and somewhat important, nor do I know how to lay it out "sequentially" and have it make any sense (in my e-mails to other people, I tend to use a lot of footnotes, which contain all of the information I want to present while not forcing the reader to either read or try to "skip by" the things that they are not interested in). Could be somehow related to my disabilities, because I was once considered to be a very good writer (in fact, I would go so far as to say that is was considered to be one of my "strengths" - one of my jobs was primarily producing program documentation).
Perhaps because they want to make it easier for their readers to understand them.
I can't do anything about that.
C# is very similar to Delphi, but with C syntax. Microsoft (rightly) got tired of all the buffer overflows and similar bugs and decided to come up with a language that would avoid them.
I don't even slightly disagree with Microsoft's decision; that is pretty much all I've heard over the years from people I am/have been acquainted with who strongly disliked C++ for all of the reasons you indicated. I can only say that absolutely none of those things were (even slight!) problems for me, ever (and I won't even speculate as to why) so that was never at all an issue for me. Frankly, I totally understand why C++ has gone the way of the dodo bird, it's just that those things (again) have never been a problem for me. (And, possibly as a side-benefit of that - particularly for me now given my financial circumstances, Microsoft now gives their C++ compilers away for free.) (I'll also add that, at this point in my life, I seriously doubt that I'll even be able to learn another computer language because of my memory issues; fortunately that's not an issue because I've known C++ for probably 15 or more years now - far pre-dating the time when my memory issues really became serious; and the TCC batch language has the best "help" system I've ever encountered, so much so that just having "some idea" of what I want/want to do is 99.9% of the time completely sufficient (and I probably "look up" something in that help file a dozen or more times in the "average" day.)
As someone who has a Ph.D. in mathematics, I'm amazed that you think mathematics requires more memorization than other subjects. In my experience, it requires significantly less. If one understands the material, many things can be derived when needed, so memorization is not necessary.
I don't have a Ph.D. in mathematics, I don't have (and have never had any interest at all in) getting a Ph.D. in anything. This might be because I was so good in my "chosen" field (which is precisely why it was my "chosen" field) that I never saw any advantage whatsoever in going past my B.S. And, as far as the "memorization" goes, it was in my utter failure to memorize "proofs" in high-school Geometry class that got me "kicked" out of the high-school "honors" mathematics program - and I tried to avoid classes where that would an issue at all costs in college. This meant that my grades were pretty much inversely proportional to the amount of "memorization" required, no memorization, just general "concepts", very high grades; lots of memorization, quite the opposite. I actually had a mid-term "report card" that had (in order, no less!) an "A", a "B", a "C", and a "D" (in Latin - I don't think that I have to explain why.)
Dyscalculia? Asperger syndrome?
Asperger syndrome. And even though the article on "Dyscalculia" has all of those words (or close variations of same) in it, their uses in the article are almost diametrically opposed to their "uses" in the context of Aspbeger syndrome.

And, as a final "thought" on the matter, I am the way I am and I learned a very long ago not to try to "fight it" in any way; it has a lot of disadvantages, but it also has a considerable number of advantages - and in the case of Aspberger syndrome, I have (or at least had) every single one of its often mentioned typically very "good" attributes, so much so that I don't even regret slightly that I have(/had) it.
 
#9
I never ran into a language with better string processing
I'm sure Dave has his own answer(s) to that one, but I'll offer just one - REXX. The parse statement alone makes it superior to any other language that I've encountered, but then there are probably lots that I haven't. TCC's string handling always frustrates the heck out of me because of all of the gotchas that you have to watch out for with specific characters, but then that is the nature of the beast.
 
#10
Steve,

That was true before Charles Dye's "SafeChars" plugin, so much so that I really didn't attempt to do any kind of "serious" string processing in TCC (before that, I did literally everything in C++). However, that plugin has pretty much completely eliminated that as a problem with very few (if any, and I really can't think of any offhand) "downsides". Highly recommended....

And I will note that I was an extensive user of REXX (on IBM mainframes) many years ago, although my recollection is that I found it to be a very strange language. And, some number of years ago I downloaded and installed it on this machine, but I really didn't like it as well at that point as I liked C++, so I really didn't "pursue" it very far. (I'll add that, by that time, I had "developed" an extensive series of C++ subroutines and functions that did the kinds of things I did on a "regular" basis, and those included a fairly large number of character-string functions. And, with my oft-mentioned bad memory, remembering the idiosyncrasies of that language, as I remember, became simply more than I could handle (vs. C++, which by that time was deeply "ingrained" in me).

- Dan
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,727
47
Albuquerque, NM
prospero.unm.edu
#11
I’ll note that if you wonder why/how I manage to “keep track” of parenthesized “clauses" that are "nested" so “deeply” (4 “levels” deep, by my count)....
I actually felt the need to check your parentheses nesting before moving on to the next paragraph. It seemed to work; I was impressed.

... the "why" is because, for me, one thought leads to another thought leads to another thought … then back to the “previous” thought then back to the “previous” thought then back to the “top-level” thought; the "how" is that I am able to "manage" it because I have a "systematic" (although not quite "automated") way of doing that. I really don’t understand why my “style of writing” is this way, or, even more significantly, why other people don’t write this way.
“Sometimes the snake's-hands in a story are the best part, if the story is a long one.” — John Crowley
 
#14
I never ran into a language with better string processing. (Was it was one of the ones I listed? If so, which one? If not, which language(s)?)
My first choice for Windows apps is Delphi. Its string processing is very good. I use PHP for Web development. Its string processing is also very good. TCC is very good at what it is designed for, but it isn't a general purpose programming language.

(I'll note that because of my memory issues that I've never been happy with editors that used lots of keyboard "options"
I use Lugaru's Epsilon. But, you probably wouldn't like it, since it (like Emacs) is keyboard oriented.

who strongly disliked C++ for all of the reasons you indicated.
There are other reasons to dislike C++. I find the syntax backwards, i.e., you have to read many things (in particular those with asterisks) from right to left.

I don't have (and have never had any interest at all in) getting a Ph.D. in anything. This might be because I was so good in my "chosen" field (which is precisely why it was my "chosen" field) that I never saw any advantage whatsoever in going past my B.S.
The point of a Ph.D. is to learn how to do research, not simply learn more of a subject. One also learns how to learn non-sequentially, i.e., how to learn when one does not have the prerequisites.

And, as far as the "memorization" goes, it was in my utter failure to memorize "proofs" in high-school Geometry class
You aren't supposed to memorize the proofs. A little memorization may help you get started. But, if you are relying on memorization, then you aren't learning what the teacher is trying to teach.

When I was a graduate student at MIT and TA-ing undergraduate classes, we had a constant struggle with the students: They wanted to pass the exams by memorizing every possible exam question. We thought this was pointless, and so tried to foil their attempts to do this. If we were too successful, they complained, sometimes vociferously.
 

rconn

Administrator
Staff member
May 14, 2008
10,788
97
#15
TCC's string handling always frustrates the heck out of me because of all of the gotchas that you have to watch out for with specific characters, but then that is the nature of the beast.
I could vastly improve TCC's string handling by making two minor alterations:

1) Give up any pretense of CMD compatibility, and
2) Disallow all interactive usage, and require commands to be executed only through batch files.

But the result might not be too popular with the user base ...
 
Jan 19, 2011
581
10
Norman, OK
#16
I could vastly improve TCC's string handling by making two minor alterations:
If it's that simple, just make it switchable like CMDBatchDelimiters. Even better, make it so that it depends on an environment variable that could be turned on and off on the fly.
 
#17
Thank you for all of the above responses! However, to go through the both "important" and "relevant" ones on by one:

I actually felt the need to check your parentheses nesting before moving on to the next paragraph. It seemed to work; I was impressed. - Charles Dye
Nothing more to add here.

You aren't supposed to memorize the proofs. A little memorization may help you get started. But, if you are relying on memorization, then you aren't learning what the teacher is trying to teach.
That certainly MAY have been true for YOU, it was certainly NOT the case for ME. MY geometry teacher passed out tests that primarily asked you to "cough up" proofs correctly and in their entirety, and I don't really know how (for me, at any rate!) that that was different that just plain "memorization"; particularly since I felt that ALL of the proofs were for things that were just plain OBVIOUS. (PROVE that the sky is blue?)
When I was a graduate student at MIT and TA-ing undergraduate classes, we had a constant struggle with the students: They wanted to pass the exams by memorizing every possible exam question. We thought this was pointless, and so tried to foil their attempts to do this. If we were too successful, they complained, sometimes vociferously.
That was certainly NOT the case for me; I did not want to (try to!) "memorize" ANYTHING, PERIOD.

'Nough said.

- Dan
 
#18
MY geometry teacher passed out tests that primarily asked you to "cough up" proofs correctly and in their entirety,
Exactly. The way to test if the student has learned how to prove things is to ask them to prove things. Just because one can answer a question by memorizing the answer doesn't mean one should.

and I don't really know how (for me, at any rate!) that that was different that just plain "memorization";
If you understand the concepts, then you can figure out how to prove the statement, even if you've never seen that particular statement before, or if you've forgotten the proof. After all, someone figured it out for the first time.

particularly since I felt that ALL of the proofs were for things that were just plain OBVIOUS.
There are several answers to that: 1) You have to walk before you can run. 2) The idea is to logically, rigorously deduce the statements from the axioms, not see if they are intuitively obvious. 3) It isn't hard to give models where the statements are false, e.g., on the surface of a sphere.

It can be hard at the beginning to produce proofs of statements that seem obviously true. However, there are plenty of non-obvious things to prove in Euclidean geometry, so it may be easier to learn the material if one starts with those.

(PROVE that the sky is blue?)
That isn't a mathematical statement, and so isn't susceptible to mathematical proof.

That was certainly NOT the case for me; I did not want to (try to!) "memorize" ANYTHING, PERIOD.
Apparently, it was the case for you since you resorted to memorization to pass the tests rather than understanding the concepts well enough to produce the proofs on your own.

In most schools unfortunately, Euclidean geometry is the only exposure students get to proofs until they get to junior-level math classes in college. Many people struggle with this transition and so get turned off from math. It might be better to teach geometry in a more modern way, and to have more logical thinking in other math classes (including elementary school) that currently have little or none. There seems to be some movement to implement this in the U.S.
 

rconn

Administrator
Staff member
May 14, 2008
10,788
97
#19
If it's that simple, just make it switchable like CMDBatchDelimiters. Even better, make it so that it depends on an environment variable that could be turned on and off on the fly.
It's impossible for one parser to support both formats. (And do you really want to have a different syntax for interactive work vs. batch files?)