|
Post by George on Jun 19, 2023 10:41:18 GMT -5
All these overrides will be done at the tail end of Profile reading. Profile reading is done BEFORE the file is read (it HAS to be) so any EFT overrides will be setup before needed.
George
|
|
|
Post by Robert on Jun 19, 2023 10:58:30 GMT -5
Yay. Whew. I was imagining all sorts of horrendous workarounds. This is much better.
I am feeling more confident that this will work.
R
|
|
|
Post by George on Jun 20, 2023 11:18:46 GMT -5
What are we going to call the 'fiddled' Profile. I'm not keen of "Derived". "Customized", "Overridden", "Adapted", "Revised", "Qualified".
I'd like it settled before getting into this. I think I'll add a line to the PROF display indicating which profile variables have been altered. Please don't suggest displaying them in different colors. Way too difficult.
George
|
|
|
Post by Robert on Jun 20, 2023 11:41:52 GMT -5
In the old days, we showed USING to indicate that something special was going on. EFT replaces USING, but EFT alone is not enough to show that the PROFILE options have been 'tampered with'. The alterations are temporary, but I don't like the idea of showing TEMP; it's just kinda ugly.
Right now, in the PROFILE edit display, if an EFT got us to the profile (like INC = BAS) we don't see that in the display. It only shows the final profile name. We would see even less if we don't find some means to indicate that tampering occurred.
Here is what I think. I am not sure if all of this is possible, but here goes.
1. In the PROFILE display area, if we got to the profile via an EFT line, we would show,
PROFILE TXT UNLOCKED EFT
2. If the EFT had operands to modify the original profile's attributes, it would be,
PROFILE TXT UNLOCKED MOD
3. For the specific attributes that got modified, show the keywords in lower case. That would be simpler and cleaner than adding a new line.
E:\**\*.txt = TXT, EOL LF
==> COLS OFF, EMACRO NONE, eol LF, FOLD OFF, HEX OFF
As for the name of the 'tampered with' profile, let's say:
(a) Formally, it's a "Modified Profile"
(b) For short, it's a "MOD profile"
Does that work?
|
|
|
Post by George on Jun 20, 2023 13:21:01 GMT -5
Robert: Sure, except for the Upper/Lower case. While not as bad as different colors, I'm not about to alter 40+ constants into some kind of IIF$ with a call to some routine to lookup whether is was modified or not and then an UC and LC version of the constant.
Ick! Coding is one thing, that is soul destroying crap. Besides, in that very cluttered PROF display, it just doesn't stand out.
George
|
|
|
Post by Robert on Jun 20, 2023 14:11:42 GMT -5
Well you know, when you first brought up the subject, my first reaction was to say, use colors, which you didn't want. That's why I suggested lower case. Since you don't like that either, I guess a new Profile line is the only choice left.
I'd say, a new line like,
=MOD=> EOL LF ... etc.
should do it.
|
|
|
Post by Robert on Jun 20, 2023 14:18:57 GMT -5
P.s. is there any way you could underline stuff in the profile display? Would it help any?
|
|
|
Post by Robert on Jun 20, 2023 15:42:58 GMT -5
Another thought, not sure if it helps, but ...
Imagine you had an EFT line like,
E:\*\*.txt = TXT,EOL LF, RECFM F, LRECL 80
Now, as I understand it, you are going to grab these overriding settings, and pass them one at a time to the command handler.
Suppose when you do that, you did two other things:
1. Make a minor tweak to the command handler, so that it would allow a 'flag' at the beginning of each command keyword, let's say it was like "-" for laughs.
2. For each EFT command, put a "-" in front.
That would effectively give you,
E:\*\*.txt = TXT, -EOL LF, -RECFM F, -LRECL 80
3. Then, when you passed a command like "-EOL LF" the command processor would strip off the "-" flag and handle the EOL but it would also 'remember' that the "-" flag had been present. It would then go about its business and dealing with each command in the normal way.
4. Finally, when you go to format the Profile edit display, you'd somehow be able to fetch that flag, and you'd know the EOL (for instance) needed to be displayed differently.
5. To make this determination easier, maybe you could have a 'command highlight table' and some functions to set it and look things up. For instance, at the start, the table would be cleared. Then, if it saw something like "-EOL LF" it would set the entry for "EOL" to True. When you go to format the Profile display, you'd eventually get to the "EOL" entry. You'd call the function and say, "Hey, do I need to do anything special with "EOL", and the function would return True. At that point, take that part of the display and do whatever - change its case, color it, underline it, whatever the heck you want. Even prefix stuff with the "-" you used internally to save all these flags, if you liked that better.
You'd have to decide what method you thought would stand out good enough to keep everyone happy.
Advantage: It would not be necessary to 'tamper' with *every* command handling function. The final formatting of things (however it was done) would be handled in one place. Thus, no soul-destroying modification of every single last command handling function. The changes would only need to be done in a couple of places.
Would THAT work?
---
Although to be honest, I am not even sure why you need to do all this. If the Profile shows something like PROFILE TEXT UNLOCKED MOD and then there is EOL LF showing, why do you need more than that? The user KNOWS that they put EOL LF as a modifier on the EFT line. Do you really need to remind them of it again, so they don't forget?
Maybe, but I can't help feel like it's unnecessary. I will know that my EFT sets up a MOD profile (because I am the one that did it), and I can see the EOL LF. Do we really need to make some bigger deal out of it than that?
I kind of think, no.
|
|
|
Post by George on Jun 20, 2023 15:50:03 GMT -5
I'm not trying to be awkward here. The problem isn't that colorizing, or UC/LC or Underlining is terribly difficult, it's the fact the display routine has to format 40+ variables, and at that point there is nothing associated with each variable that indicates whether it has been modified by an EFT override.
Remember the overrides are to be done by simply passing the EFT operand to the main Primary command processor. These command processors don't know, or care, where the command came from. So they don't set any indicator to say "This was an EFT change" - not that there's even a place to hold such an indicator.
That processed can be reversed by looking up each of the 40+ variables in the display routine to see if it was in the EFT command list, and then choose the color/UC/LC/underline process. A non-trivial exercise.
Here's the code for just one of the 6 PROF lines. Would YOU like to create such a lookup routine and then rewrite this to call the routine and determine and trigger the needed hi-lighting (another exercise)? For all six PROF lines?
t2 = "COLS " + IIF$(ISTRUE Cols, "ON", "OFF") ' Add Cols
t1 = EXTRACT$(EMacro, " ") ' Get macname
t1 = IIF$(uucase(t1) = T1, " ON", " OFF") ' Create ON/OFF
t2 += ", EMACRO " + IIF$(EMacro = "", "NONE", uucase(EMacro) + T1) ' Add EMACRO
t3 = IIF$(VERIFY(EOL, $Hex) = 0, "X'" + EOL + "'", EOL) ' IF hex operand, FRAME it FOR the message
t2 += ", EOL " + TRIM$(t3) ' Add EOL value
t2 += ", FOLD " + IIF$(Fold, "ON", "OFF") ' Add FOLD
t2 += ", HEX " + IIF$(HexMode = &1, "OFF", "ON") ' Add HEX
t2 += ", HILITE " ' Build HILITE
IF ISTRUE HiFind AND ISTRUE HiAuto THEN ' All on
t2 += "FIND AUTO" '
ELSEIF ISTRUE HiFind THEN ' Find
t2 += "FIND" ' Yes, say FIND is on
ELSEIF ISTRUE HiAuto THEN ' Auto
t2 += "AUTO" ' Yes, say AUTO is on
ELSE ' Neither
t2 += "OFF" ' Yes, just say OFF
END IF '
t1 = EXTRACT$(IMacro, " ") ' Get macname
t1 = IIF$(uucase(t1) = T1, " ON", " OFF") ' Create ON/OFF
t2 += ", IMACRO " + IIF$(IMacro = "", "NONE", uucase(IMacro) + T1) ' Add IMACRO
TP.Prof3 = t2 ' Save it
We're talking a lot of grungy code to add some visual hi-lighting.
George
|
|
|
Post by Robert on Jun 20, 2023 16:43:11 GMT -5
OK, I know you don't want to do this, but since you provided code, allow me to suggest a possible approach. The goal would be to highlight any keyword that was involved in an MOD profile.
Method:
1. When you get an EFT line with operands, you clear a 'modifier table', and the for each keyword you set a flag that is was present. So, if "EOL LF" was present, the there would be flag in the table indicating that "EOL" was "True".
2. You would have a function, let's call it EFTMOD(). What this function would do is:
(a) Look up a keyword in the modifier table. If found, the keyword would be prefixed by some 'flag' to 'mark' it. For laughs, let's say the 'flag' was '¬' not sign.
(b) Thus, if EOL were an EFT operand, then EFTMOD("EOL") would return "EOL" If EOL were NOT an EFT operand, EFTMOD("EOL") would return "EOL" unchanged.
(c) To simplify inserting this change into the old code, EFTMOD(", EOL") would either return ", EOL" or ", ¬EOL". That would reduce the amount of cutting, pasting and code hacking. Trailing blanks would be passed through in the same way.
3. Here is how your code would look if so-modified:
t2 = EFTMOE ("COLS ") + IIF$(ISTRUE Cols, "ON", "OFF") ' Add Cols
t1 = EXTRACT$(EMacro, " ") ' Get macname t1 = IIF$(uucase(t1) = T1, " ON", " OFF") ' Create ON/OFF t2 += EFTMOD (", EMACRO ") + IIF$(EMacro = "", "NONE", uucase(EMacro) + T1) ' Add EMACRO
t3 = IIF$(VERIFY(EOL, $Hex) = 0, "X'" + EOL + "'", EOL) ' IF hex operand, FRAME it FOR the message t2 += EFTMOD (", EOL ") + TRIM$(t3) ' Add EOL value
t2 += EFTMOD (", FOLD ") + IIF$(Fold, "ON", "OFF") ' Add FOLD t2 += EFTMOD (", HEX ") + IIF$(HexMode = &1, "OFF", "ON") ' Add HEX t2 += EFTMOD (", HILITE ") ' Build HILITE
IF ISTRUE HiFind AND ISTRUE HiAuto THEN ' All on t2 += "FIND AUTO" '
ELSEIF ISTRUE HiFind THEN ' Find t2 += "FIND" ' Yes, say FIND is on
ELSEIF ISTRUE HiAuto THEN ' Auto t2 += "AUTO" ' Yes, say AUTO is on
ELSE ' Neither t2 += "OFF" ' Yes, just say OFF
END IF '
t1 = EXTRACT$(IMacro, " ") ' Get macname t1 = IIF$(uucase(t1) = T1, " ON", " OFF") ' Create ON/OFF
t2 += EFTMOD (", IMACRO ") + IIF$(IMacro = "", "NONE", uucase(IMacro) + T1) ' Add IMACRO
4. Now, take the string in t2 and scan it, looking for all keyword tokens of the form ¬token. For instance, if the EFT line had EOL LF, there would be, somewhere in t2, a substring of the form "¬EOL LF". Your scanning logic (a separate function) would find the not sign and keyword, and alter the t2 string accordingly - and/or create some kind of 'attribute line' that would colorize things, or underline them, or whatever you wanted to do with it. Let's say the end result was another string, say it is called t2_attr.
5. Insert the altered line as a profile display line.
TP.Prof3 = t2 ' Save it
6. Use the t2_attr string as needed to 'tweak' the profile display
TP.Prof3_attr = t2_attr
That's the idea. Yes, work. But not all that grungy.
|
|
|
Post by Robert on Jun 20, 2023 21:17:08 GMT -5
I feel I need to repeat something I said before. That is, while code like this is possible, and might actually work, I don't think it's necessary. Neither is the new =MOD=> information line on the Profile edit display.
It's overkill. Users know what they put on their EFT lines. They can read perfectly well what is on the profile display. What more is needed?
I wouldn't do it your way, and I wouldn't do it my way (seen above) either. I wouldn't do any of it. It's just not needed, IMHO.
|
|
|
Post by George on Jun 21, 2023 8:25:54 GMT -5
Robert: That's why I wanted to insert a single line, a trivial change ==PROF> EFT modified entries: EOL, RECFM
Adding an Attr line for Color or UC/LC, Underline etc. is a significantly larger change.
George
|
|
|
Post by Robert on Jun 21, 2023 8:34:25 GMT -5
Yeah, I guess if you wanted that, I would show it as
==MOD> EOL RECFM
or
=MODS> EOL RECFM
if you happened to like the idea of "MOD" and "modified profile" as the terminology.
|
|
|
Post by Robert on Jun 21, 2023 10:20:00 GMT -5
You haven't said much about the MOD idea. Maybe you don't like the name?
Suppose you had an EFT line like,
E:\*.txt = TXT, EOL LF
If you want to let users know what EFT parameters are in effect, you could just show them everything to the right of the = sign, like this:
==EFT> TXT, EOL LF
just as it is code on the EFT line.
Then, that handles both the fact that EFT was used, and that the profile selected was modified.
That means you wouldn't need anything like
PROFILE TXT UNLOCKED EFT or PROFILE TXT UNLOCKED MOD
because the ==EFT> line shows you everything.
|
|
|
Post by George on Jun 21, 2023 12:14:50 GMT -5
True, there probably will never be a problem with 'too many' operands. Not sure how easy it will be to get ==EFT> into the left column, that's a murky area.
George
|
|