|
Post by George on Apr 9, 2020 15:22:25 GMT -5
IMACRO ON/OFF is becoming a problem since IMACRO supports the IMACRO AND it's operands. So ON/OFF could be operands to the macro itself. I just have to figure out how to store this stuff in the CFG file. AND be compatible with current releases.
But I guess /OFF /ON are pretty unambiguous.
George
[UPDATE] I'm not going to change IMACRO, the operand problem is really awkward. So /ON /OFF type support will only be for XFORM.
[\UPADTE]
|
|
|
Post by George on Apr 10, 2020 9:33:56 GMT -5
Robert: OK, I'll give it a go. Having to maintain an ON/OFF setting along with the string itself now means two profile variables, or some kind of hybrid string/ON|OFF. Yet more grungy code. Maybe some other method.
George
|
|
|
Post by George on Apr 11, 2020 11:30:41 GMT -5
Robert: Well, after a couple '3 ahead, 2 back" attempts to get the ON/OFF/NONE/mac-name override logic to work, and figuring out how to store two settings in one profile variable, I think the %Imacro and /XForm stuff is basically working.
Next is tackling the WRITE half of XFORM.
George
|
|
|
Post by George on Apr 13, 2020 10:41:23 GMT -5
Robert: I've got the XFORM WRITE support going. Since there is no /ON /OFF ability (I am NOT adding it to SAVE etc.) the XFORM Write support is only active for the plain ordinary SAVE command. All other flavors (CREATE, REPLACE, SAVEAS etc.) will work just like today.
When a file is loaded via XFORM, the Mode box on the status bar will change from say, Save to (X) Save and the box will be colored RED.
So if someone loads a file with XFORM, and does a SAVEAS - the file will be saved with the text as it appears in Edit. Not what the user wants? Tough.
Also, the Write will use whatever XFORM macro was used to actually load the file. No loading with ABC macro, changing XFORM and writing with DEF macro.
If a SAVE is attempted, and the XFORM macro reports an error (say at END time with AUTOSAVE ON) the session is not ended, you are left in Edit with some error messages.
If a file is loaded via XFORM, changing the Profile to XFORM NONE will not prevent SAVE from using the XFORM macro, you'd need to use CREATE/REPLACE etc. or CAN out.
This is all going to mean a lot of documentation. So if you want tweaks, say so quickly before I get the Doc. underway.
George
|
|
|
Post by George on Apr 14, 2020 10:42:57 GMT -5
Robert: I need your help. I've started to try and document XFORM, and finding it difficult to organize a coherent "Working with File Transform" section. Between describing what it's for, how it can be used, the syntax of the commands, the ON/OFF override ability, macro structure, new macro functions etc. etc. I'm floundering.
You at least understand it as it was your idea, do you have any time to crank out some words? Before I waste any more time on this mess.
I'd rather be testing and creating additional sample XFORM macros.
G.
|
|
|
Post by George on Apr 14, 2020 12:20:23 GMT -5
OK, I'll cut out what I started from HnD. Not much but every bit I wrote made it more and more obvious I was on the wrong track. I'll email it to you.
George
|
|
|
Post by George on Apr 16, 2020 13:35:31 GMT -5
Robert: I've created some sample XFORM macros to ship along with the normal install stuff. They are: - XRW - Provides Read / Write access to normal ANSI text files, a skeleton showing all the interface elements.
- XLines - Shows how to read any text file, RECFM=U or F or V, different EOL's etc. Displays the data in Dump format (the one you saw and commented on). No WRITE support.
- XRaw - Provides a Dump of a file, no line handling, like a binary file editor. No WRITE support.
- XZIP - Displays the file contents of a standard ZIP file. A demo of accessing a non-text type file. No WRITE support.
- XCFG - Displays the names of the Profiles contained in an SPFLite CFG file. Another demo of accessing a non-text file. No WRITE support.
Reasonable samples? Any suggestions for a better sample demo are welcome.
George
|
|
|
Post by George on Apr 16, 2020 14:48:31 GMT -5
Robert: IMACRO and XFORM have no problem co-existing. Remember XFORM is involved in loading the file; IMACRO is invoked after the file is loaded, regardless of how it was loaded.
Yes, WRITE support works. The XRW demo macro does just that, you can edit and save normal ANSI files using it. Remember, the heavy lifting part of all this is going to be in the macro, not in SPFLite. We're providing an interface for replacing the file Read/Write functions. The sample macros are to help users get started in writing their own macros.
As to creating a full Hex editor, that's a lot more effort. One problem is that the dump format currently has a problem if the font used can't handle all 256 characters, it ends up with the character display shifted and distorted by unprintable characters. That lovely Dump display is, after all, just print lines loaded into the editor. SPFLite has no idea that it is some kind of file dump.
There's a lot to plan before tackling something like a hex editor.
George
|
|
|
Post by George on Apr 17, 2020 13:21:26 GMT -5
Robert: OK I added the replacing of non-printing characters to match what normal edit does.
Then I went ahead and created the WRITE support, we now have a Hex editor. The new XFORM XHEX macro only ended up being about 150 lines, surprising. Now as to how trustworthy it is.
If you are interested, I could ship you the EXE and the sample macros.
George
|
|
|
Post by George on Apr 18, 2020 9:59:15 GMT -5
SPFLite22.zip (446.53 KB) Robert: I'll rename the EXE to SPFLite22.EXE, then you can just add it to the install folder. The macros can just be added to your normal MACROS folder. I'll package some stuff up. I'm not all done yet, still stuff to do with handling the other WRITE commands (CREATE/SAVEAS etc.) so no complaints about them are allowed yet. The macros are: XCFG - Displays Profile names from an SPFLite.CFG file XHex - This is the basic hex file editor. XLines - This dumps text type files in Hex/Char dump format. XRW - Simple demo of reading / writing a text file via XFORM. XZIP - Displays the filenames contained in a normal ZIP file. George
|
|
|
Post by George on Apr 20, 2020 14:03:40 GMT -5
Robert: Did you get the test stuff. I attached it to the above posting, I hope you weren't waiting for an email.
George
|
|
|
Post by mueh on May 14, 2020 12:43:43 GMT -5
George ! Here the XH XL macros . MXform.7z (5.55 KB) Nr of Bytes in Line and word can be tailored in macro . for other changes see macro comment . Here a sample screen shot of SPFLite2.exe Version id area . Above part is XH below HxD Display . Thanks
|
|
|
Post by George on May 14, 2020 13:23:13 GMT -5
mueh: Are you saying in XL that the SPF_INVCHARS$ is still leaving characters that don't properly display? It uses a table of valid characters (those with valid glyphs) for the currently assigned font. If so, then I'll have to research how to build that table better.
George
|
|
|
Post by mueh on May 14, 2020 13:40:17 GMT -5
George ! Yes im XH macro i added the translate . Use XH and your XHEX macro to hex view SPFLite2.exe and you will see the difference at x'350' x'4a0' f.e.
|
|
|
Post by George on May 15, 2020 7:49:34 GMT -5
mueh: yes, I've been trying out various fonts using a test 256 character display. The routine I'm using checks that each character has an assigned glyph. Obviously, even for a fixed pitch font, the glyph MAY still not be the correct width. Now to try and figure out how to test each individual character.
George
|
|