|
Post by Robert on Feb 19, 2023 10:39:15 GMT -5
I was hoping you would say that. This was another in a list of (not overly) contentious debates on a new feature, but I believe by everyone stating their case with good rationale, everyone influenced everyone else. I never would have dreamed of suggesting C Q T at the beginning, but now that it's out there, it seems to make sense.
I wanted to mention, when a user issues a command with these codes, they would never need to specify all 3 of them, because that is the same as searching everywhere. But, a macro user might define these codes independently, and it might be tricky macro code to avoid the case of specifically asking for all of C Q and T. So, even though as a user-written command nobody would do that, I believe you should allow for it in the syntax.
|
|
|
Post by Robert on Feb 18, 2023 15:39:32 GMT -5
Just a fine point. If all three letters Q C T are omitted, and you implemented this literally, it would suggest you are looking for the search argument no where; like a BC mask value of 0. So, as you process the operands, you'd start with a "mask" of 0, and "OR-in" the Q/C/T "mask bits" as you encounter them, but if they were never used, you'd have to plug in a "complete mask" that would be the same as if ALL the codes Q C and T were specified.
That's an implementation issue, not a design question. Just didn't want you to overlook it.
|
|
|
Post by Robert on Feb 18, 2023 15:32:13 GMT -5
Do I realize? No, I don't; I am sure it's far more than you ever wanted.
I just wish that the "neither" case could be be made better. It's ugly when you define something by what it's NOT. Even OUT/OUTSIDE means it's NOT a comment and NOT a string. How do you describe what it actually IS?
I first thought, OPENCODE, then OUTSIDE, then OUT.
The only words that come to mind are OPEN and FREE (as in, "free" of being enclosed in comments or quotes).
The idea that is somehow trying to get conveyed is, 'Well, there's stuff that could have random, unconstrained junk in strings or comments, and "real" code that has to follow rules and makes sense.
Weird thought: Think about the FREE/OPEN as a third type of 'enclosure'. Then, each 'closure type' has two possible states: Either a search argument is found in it, or it's not. That allows for 8 possible states, if you think of the yes/no possibilities as as 0 or 1. Remember the Branch on Condition instruction? It had a 4 bit condition code mask, where (and forgive me if I label it wrong, but):
8 = equal 4 = high 2 = low 1 = other condition
That gives 16 possible ways to check something. Greater than or Equal amounts to conditions 8 + 4, etc.
What is unconditional branch? CC 15, and NOP is CC 0. You wouldn't need that in SPFLite, because CC 15 means look everywhere, and CC 0 doesn't make sense (find something but don't look anywhere? weird ...)
My point is, the BC condition codes are always searched for as an OR and never an AND. So, I am hoping you are not intending to actually use AND to connect the operands. If you had to, it would be OR.
Since you could ONLY use OR, that means you don't really need to say it.
Because of that, you don't need any kind of "NOT" specification. Instead, you'd only say where you ARE checking, not where you are NOT checking. That would give you:
Q - in a quoted string C - in a comment T - in open text
Want QC? It's just Q T Want to find something that's in open text or in a comment, but not a string? IT's T C
No NOT'S. No dashes. No N prefixes. Nothing. Nada.
Just one, two or three separate letters.
I rest my case.
|
|
|
Post by Robert on Feb 18, 2023 14:13:14 GMT -5
George, did you add these new operands on top of the longer ones?
I don't believe this was a good idea, for all the reasons I originally stated. No matter how they are written, these operands will be rarely used.
If you insist have having short operands, there should only be short ones, not both. (You didn't mention if the long are still here).
If you are determined to do this, allow me to suggest an analogy from blood types. There are actually only two fundamental blood type factors: A and B. If only only have one, it's A or B. If you have both, it's AB and if you have neither, it's O (the letter O, almost like a 0 Zero or a 'null').
Perhaps that could be applied here. If so, the arguments could be simplified to a single token. That would give you:
Q NQ C NC
CQ - "inside" - you could have an alias of QC if you wanted
That leaves specifying the "open" or "neither" option. I don't like the idea of a plain O being an operand; it just seems wrong. Remembering again that this is an option that will be seldom used, that leaves
NCQ - "outside" - you could have an alias of NQC if you wanted
But, if you were willing to write operands as long as "NQ AND NC" or even "NQC" then how about simpler operands, which are both readable and short, and aren't currently used for anything else:
IN OUT
Yes, it's true that these don't match the Q/NQ/C/NC and X/NX style, but either we can be rigidly consistent, or make something that is readable and easy to remember.
To me, IN/OUT has a lot to offer.
|
|
|
Post by Robert on Feb 17, 2023 13:29:06 GMT -5
As of 23.047, this fix is not in. Is that because you only regen the Help on releases, not Betas?
Of course it is. Chalk it up to dead brain cells.
|
|
|
Post by Robert on Feb 17, 2023 13:25:58 GMT -5
Not a big issue, but the message doesn't mention INSIDE/OUTSIDE. Any way you can insert the specific operand used into the message so it's not a "generic" one? That way, they wouldn't get a warning for COMMENT when they used INSIDE.
I am not sure what you mean by "full, active colorization". I haven't seen your new message yet.
If colorization is on, it's on. Isn't it already "full" and "active"? Am I missing something?
|
|
|
Post by Robert on Feb 16, 2023 15:33:45 GMT -5
Minor cosmetic issue with 23.047. If FIND QUOTED is issued when AUTO is not on, a message appears:
COMMENT / QuOTED operands not supported when Colorization is not active.
1. Typo where "QUOTED" has irregular casing.
2. I recommend this message be rewritten to avoid double-negative language and be more informative:
COMMENT/QUOTED operands require HILITE AUTO ON and profname.AUTO file defined
where 'profname' is the name of the currently defined profile; that part would have to be tailored for the specific file being edited.
|
|
|
Post by Robert on Feb 16, 2023 14:27:48 GMT -5
I still like STRING, but matching keywords in the AUTO file is a good principle to follow, better than using a "nice" word like STRING that doesn't match up to anything.
Yes.
|
|
|
Post by Robert on Feb 16, 2023 8:25:42 GMT -5
The proposal above is a good start, but it still has an issue: OPENCODE. That's not really a word, and what does –OPENCODE mean, again? Conceptually, it's a problem. It's not as obvious as STRING and COMMENT.
There is a way around this, but it would require deviating from the pattern a little. Instead of using a – sign for this part, suppose we used to different words. That could give us:
OUTSIDE value must outside of any string or comment INSIDE value must be inside of either a string or a comment
I think these two operand names make more sense than OPENCODE and –OPENCODE and will be easier to remember.
I wish there were an easier way to figure this out all at once, without constantly saying, "wait, there's a better idea".
But, I believe, at the beginning of any new feature, it's very important to get the names right, and creating stuff is hard.
Whatever is decided tends to stick for a long time, and it needs to be done correctly.
|
|
|
Post by Robert on Feb 15, 2023 17:29:30 GMT -5
This is an area where there is no obvious answer. We are beyond ISPF, so asking "how would IBM do it" doesn't work here. We now have to ask, "how would SPFLite do it". X/NX has the benefit of ISPF history. What is the "SPFLite history" here?
Consider that part of this (sometimes animated) discussion touched upon the concept of colors. First a few words about your ideas.
1. I am not sure the objection about STR is a good one. There is no standard that strings are quoted? Perhaps you could give an example. The only one I can think of is FORTRAN IV and its H-literals. They were truly awful. Aside from some very weird language maybe like LISP, I think there pretty much IS a standard, and it's either "xx" or 'xx' unless you know something I don't. Main area where there is NO standard is how to handle embedded quotes as data values.
2. "LIT" could be a problem, because 123 is a literal too. Only real definition of a literal is a self-defining term that does not dependent on or refer to anything else. It doesn't even have to have quotes or digits; in COBOL, ZERO is a literal.
A "comment" could also be called a "remark" or "note". But, "comment" is pretty much the name most people would see. No real argument here.
Now, back to colors. Reason I bring this up is we already have a notation like this:
RED = find strings that are red +RED = change color of found strings into red -RED = find strings that are NOT red
Part of the "cryptic" issue is that the leading "N" throws things off. Using – instead of N might help.
However, this gets into a common hangup among developers, where they want to optimize everything. I have a saying, "Don't optimize something you never (or, hardly ever) do".
Right now, we've NEVER had the choice to discriminate on the search context in this way. Why does any of it have to be so short, anyhow?
In language theory, there is an idea that the more often a word is used, the shorter it should be, and vice verse. The fact that the indefinite article in English is "a" and not some long word is no accident. In contrast, there is no real demand to make "transmission" short, because we hardly ever say it.
C? Q? Yep, very short, but for an attribute that will be rarely used, shortness doesn't matter. Why make them short at all? I thought for a moment that we could even use ## for comment and $$ for strings, but that's just as cryptic.
Why not say STRING and COMMENT? You know, something obvious? How would this work?
First, somehow we have to deal with the case where you want to handle combined tests, like comment-or-string. And, even operands like my COMSTR are not so hot.
What would we MEAN if we asked to find a search value that was NEITHER a string NOR a comment? What would YOU call it?
I know what I would call it: "open code".
Put all that together, and what do you have?
STRING value must be inside a quoted string
-STRING value must NOT be inside a quoted string
COMMENT value must be part of a comment
-COMMENT value must NOT be part of a comment
OPENCODE value must be in "open code" that is, it must NOT be part of a string or comment
-OPENCODE value must NOT BE in "open code" that is, it must EITHER be part of a string, OR be part of a comment
|
|
|
Post by Robert on Feb 14, 2023 20:50:55 GMT -5
This is an interesting development, but I feel that the spelling of the operands is too cryptic, and may be hard to type correctly. You did so yourself in the Beta announcement, referring to NQT as NCM. That was a cut and paste error, but if even you as the author did not see that, how will users fare?
I recommend these names, which should be easier to remember:
COM - Locate the search argument if within a source Comment NCOM - Locate the search argument if NOT within a source Comment
STR - Locate the search argument if within a String NSTR - Locate the search argument if NOT within a String
Possible enhancement:
COMSTR - Locate the search argument if within EITHER a source Comment or a String NCOMSTR - Locate the search argument if within NEITHER a source Comment nor a String
Of course, these keyboards now become reserved and should be highlighted on the primary command line.
|
|
|
Post by Robert on Feb 13, 2023 15:51:16 GMT -5
In hindsight, the W macro wasn't so hot. I have redone it. It is now called Q.MACRO Changes: 1. Only Q macro is needed; additional user-written "launcher" macros no longer required. 2. To define a program to run, a SET symbol is used, of the form Q.name 3. Q can be run without a program name (set symbol) if Q.DEFAULT is defined to say what program runs if Q alone is specified. Here is the listing, which pretty much explains everything. ' Q.MACRO
' This macro allows you to quickly execute a Windows command from a line-cmd field in FM. ' ' To set up Q for use: ' ' - Create a default program to enter as a SET value ' Example: A default of NOTEPAD is defined as SET Q.DEFAULT = NOTEPAD ' If a default is not defined, you must use a SET name argument after the Q ' ' - Create any other desired programs as SET values ' Example: To allow program MYPROG to be run as Q MP, issue a SET Q.MP = MYPROG ' ' To use Q for a file in the FM: ' ' - Go to line cmd area of desired file ' ' - Enter a Q followed by a space and a SET name as described above, but WITHOUT the Q. prefix ' Example: To run program MYPROG on the file, put Q MP in the line command area. ' (OR) ' - Just enter Q if you want to use your default program defined by Q.DEFAULT ' ' - Press Enter. The command will execute in a new, separate window ' ' - Close the window when finished in the usual way
IF is_fm = 0 OR is_line_cmd = 0 THEN halt("Q must be entered in an FM line cmd area")
DIM Fnum AS LONG = VAL(Get_Arg$(1)) DIM Fname AS STRING = FMGet_FileName$(Fnum) DIM Fpath AS STRING = FMGet_Path$(FNum) DIM fullname AS STRING = Fpath + Fname DIM SetArg AS STRING = ucase$(TRIM$(Get_Arg$(2)))
IF SetArg = "" THEN SetArg = "DEFAULT"
DIM SetName AS STRING = "Q." + SetArg dim WinCmd as string = Get_SETVAR$(SetName)
IF WinCmd = "" THEN halt ("Q " + SetArg + " requires defined SET var named " + SetName)
SPF_Shell (ASYNC, HIDDEN, WinCmd, SPF_Quote$(fullname)) HALT(0) Attachments:Q.MACRO (1.56 KB)
|
|
|
Post by Robert on Feb 12, 2023 15:48:55 GMT -5
The new FM line command W allows you to launch a Windows command that uses the name of the FM file as its Windows command line argument, such as "W NOTEPAD". This is a big improvement and should prove handy. However, this command has a drawback, which is that you must type out a possibly long Windows command-line name every time you use this. That could get old fast if you used it a lot. To overcome this drawback, I wrote a macro to allow you to make an abbreviation of any command you wish, even ones that might require a fully-qualified file name to run. The idea goes like this. You first write your own "launcher" macro to define the short name of how you want to launch your Windows command. It's just a three line macro, that ends with an #INCLUDE to do the bulk of the work. You can make this use any naming convention you want. I will show you how I did it. Let's say you want the "launcher" names to all start with W. as a prefix. Let's make one to launch NOTEPAD, and call it W.N.MACRO. Here is what the launcher macro looks like. Except for the WinCmd string value, all launchers will look the same: ' W.N.MACRO DIM WinCmd AS STRING = "NOTEPAD" #INCLUDE W.0.MACRO Then, you put W.N as an FM line command when you want to launch NOTEPAD. This way, you can create as many launchers as you like. Using just one letter gets you up to 35 short names of these macros (leaving W.0 reserved). Again, you can use any naming convention you want for all this. Here the W.0.MACRO I wrote for this: ' W.0.MACRO ' ' This macro allows you to execute a Windows command from a line-cmd field in FM. ' To use: ' ' 1. Create a macro like this: '-------------------------------------------------------------- ' ' W.name.MACRO ' --> where "name" is the name of the W. macro you want ' ' DIM WinCmd AS STRING = "prog" ' --> where "prog" is the name of the desired program or bat file ' ' #INCLUDE W.0.MACRO '-------------------------------------------------------------- ' ' 2. Example: W.N.MACRO to launch NOTEPAD '-------------------------------------------------------------- ' ' W.N.MACRO ' DIM WinCmd AS STRING = "NOTEPAD" ' #INCLUDE W.0.MACRO '-------------------------------------------------------------- ' ' 3. Enter W.N as a FM line command on the desired line that you want NOTEPAD to edit ' ' 4. Create your own W.name.MACRO named as you wish
IF is_fm = 0 OR is_line_cmd = 0 THEN HALT("W.name must be entered in FM line cmd area")
DIM Fnum AS LONG = VAL(Get_Arg$(1)) DIM Fname AS STRING = FMGet_FileName$(Fnum) DIM Fpath AS STRING = FMGet_Path$(FNum) DIM fullname AS STRING = Fpath + Fname DIM rc AS LONG
rc = SPF_Shell (ASYNC, HIDDEN, WinCmd, SPF_Quote$(fullname))
HALT(0)
Attachments:W.0.MACRO (1.29 KB)
|
|
|
Post by Robert on Feb 7, 2023 13:56:40 GMT -5
The command HELP EFT does not work as one might expect. It does not bring up the EFT help, but rather shows the default help entry, depending on whether you asked for the help from FM or an edit tab.
If you ask for a fully-specified HELP EXTENDED FILE TYPES it will work, but that is more wordy than should be required.
HELP EFT is a reasonable HELP request, and should work without spelling it out.
|
|
|
Post by Robert on Feb 6, 2023 14:45:34 GMT -5
The highlight-pen functions are good for setting blocks of text to a color, like (Pen/Red)A problem with this technique is that you need a key mapped to the color function, and with 15 colors, you may not have enough keys to map everything you need. To get around this, I made a macro called PEN to highlight a block of text to any desired color. To use, highlight the block, press Home to get to the command line, type PEN color and press Enter. You have to be careful to do things in the right order, as commands such as RETRIEVE will disable any text highlighting that you have done, and then you would have to highlight the block all over again. The color name is any color name shown in the Global Hilights tab, like RED, or its color code like RTo make a block the "standard" color, which is the same as "resetting" it, use a code or name of S, STD, RES or RESET(couldn't decide which was the best name). Attachments:pen.macro (1.83 KB)
|
|