|
Post by Robert on Jun 14, 2023 13:48:03 GMT -5
In SPFLite macros (or in ordinary editing for that matter), if we wanted to temporarily change the settings of a macro, that could be done by using a command of
SPF_CMD ("PROFILE LOCK")
and any subsequent Profile changes would not be written to the external Profile data.
The problem with this is that a change to the LOCK state of a Profile is itself permanent. There isn't any way (that I know of) to temporarily change the LOCK state. Once it's changed, it's changed.
Here is the idea:
Let us say there would be two new keywords recognized on the PROFILE command, which would work as follows:
PROFILE ADJUST
This would function similar to how PROFILE LOCK does, except that the LOCK status itself is NOT changed. Whether you SAVE the file or CANCEL out of it, the permanent Profile data is not changed. When you open the file again, the original, unchanged profile is used, and no record of the effects of a PROFILE ADJUST remain in the Profile data.
You would probably show PROFILE ADJUSTED instead of PROFILE LOCKED in a Profile edit display when ADJUST is in effect.
I see the main issue in implementing PROFILE ADJUST is to somehow internally record the fact that the Profile is not getting saved, no matter what the current lock status is. I am sure this can be resolved with careful coding.
Now, suppose you no longer want to be 'adjusting' the Profile, but want things back the way they were? You would do this:
PROFILE RELOAD
A "reload action" would completely reload the current Profile's settings, exactly as they are permanently stored in the external configuration data - including the original Profile's LOCK/UNLOCK status.
Also, if you issued PROFILE RELOAD, if there had been a prior PROFILE ADJUST in effect, anything and everything that had been altered would be discarded, including the fact that PROFILE ADJUST itself had even been used.
Wouldn't PROFILE RESET do this? No.
RESET will reload the DEFAULT profile, NOT the current edit profile. You'd only do a PROFILE RESET if your current Profile were somehow corrupted and unusable, and you needed some "sane" values to start with to begin correcting the problem.
P.S. I spent quite a bit of time trying to find a good name for ADJUST. The only other name that can to mind was "tweak", but that's hard to type, and seemed a little frivolous. So, ADJUST it is.
As with the current PROFILE command, if ADJUST or RELOAD were actual names of profiles, you'd have to quote them.
Comments invited.
|
|
|
Post by George on Jun 15, 2023 14:14:47 GMT -5
Robert: Don't need RELOAD, just say PROF prof-name to reload the profile. Not sure what this buys us for the EFT thingy.
George
|
|
|
Post by Robert on Jun 15, 2023 16:43:49 GMT -5
If I am editing using Profile TXT and I say PROFILE TXT, it will 'reload' the profile, but the current LOCK status is unchanged. There is no way to restore the lock/unlock state that I know of.
The idea behind this was that if we were going to all an IMACRO function on the EFT line, then the IMACRO could issue an SPF_CMD("PROFILE ADJUST") to temporarily lock the profile, so changes would not be stored. The RELOAD would be done later to clear out all temporary profile settings.
Unless I am missing something.
Can you see what I am getting at?
|
|
|
Post by Robert on Jun 15, 2023 17:01:00 GMT -5
George, maybe ADJUST isn't needed either, IF ...
Suppose you used the DCB keyword on the EFT line. Then, in addition to parsing the DCB stuff, the very presence of DCB means that you are making a temporary adjustment to the Profile. If so, somehow the edit session gets 'marked' so that any changes made to the profile were not saved. You'd be "implying" an ADJUST mode, so to speak. Just saying,
INC = BAS; DCB EOL LF
would imply the 'adjusting'.
===> More information
Come to think of it, maybe you CAN'T do a reload, because if you are overriding something like EOL LF, and you did a profile reload, it might (probably) change EOL back to CRLF. That could be real risky.
Maybe I am wrong, but I am wondering if you are editing with a temporarily modified profile, you might need to save/end or cancel rather than reload.
Am I missing something here? There's something about this that bothers me, and I can't put my finger on it.
|
|
|
Post by George on Jun 16, 2023 9:39:55 GMT -5
Robert: Issuing a Profile xxxx (whether it is the active Profile name or some other name) will completely load the profile data - INCLUDING LOCK status. Maybe the confusion is that PROF LOCK and PROF UNLOCK are absolute - they ALWAYS update the CFG data, it has to be that way, otherwise how would you ever permanently UNLOCK a profile.
RELOAD also reloads the Profile, which (if we do this) would also re-apply the EFT commands.
George
|
|
|
Post by Robert on Jun 16, 2023 11:28:11 GMT -5
George, it seems like this discussion is going well. I believe it would be helpful, before you start trying to write any code, to spell out (as briefly as you can) what YOU believe the current understanding is, so everyone is on the same page, so there's no surprises.
|
|
|
Post by George on Jun 16, 2023 11:46:03 GMT -5
Robert: I think I'll roll out the current Beta level after a few days to ensure no more 'niggles' show up. And then do the EFT changes as a start for a new release.
I'll post a summary of how I see it.
George
|
|