|
Post by mueh on Apr 18, 2023 8:28:22 GMT -5
Hi George ! Get_Profile$ in XFORM Macro sets EOL ? in cmd line after 2.6
Following change Between 2.5.22066 and 2.6.22138 (May 18/2022) When a Macro returns with a WARN or FAIL return code, the command line will be restored to the ORIGINAL command invoking the macro, rather than the last Primary command (which may have been issued internally by the macro itself. introduced the cmd line set .
to reproduce open a file with V /t in fm . Here the macro ' t.macro dim EOL as string = Get_Profile$("EOL")
Maybe solving the msg DoErrorSetup(0, "Warning, current SOURCE is " & ZPrf.PSource & ", file loaded was " & TRIM$(lclSource))
in CopyAFile is a solution . Same for other Get_Profile$(...) values . P.S. /XLINES sample macro is looping . Have to check what breaks it after 2.5 Thanks
|
|
|
Post by George on Apr 18, 2023 9:39:55 GMT -5
MUEH: I added a clear of the command string in Get_ProfString in BMacro.inc; that should get rid of the internal command.
CopyAFile will now skip the SOURCE test for XFORM loads.
Thanks for the report. I'll dump out a new Beta for you.
George
|
|
|
Post by mueh on Apr 18, 2023 12:23:08 GMT -5
George: Thanks for solving the EOL in cmd line with 23108 . The loop in Xlines.macro is not solved . Debugged it and reason is that Get_Profile$("RECFM") and other like EOL return now RECFM set to U EOL set to CRLF with 2.6 and later . Only U and CRLF should be returned . Thanks
|
|
|
Post by George on Apr 18, 2023 12:40:03 GMT -5
MUEH: Not clear here. Is there still a problem with Get_Profile$, or is the error in the XMACRO itself?
George
|
|
|
Post by mueh on Apr 18, 2023 12:48:31 GMT -5
George: The Problem is with Get_Profile$("RECFM") which returns since 2.6 a string of "RECFM set to U" instead of "U" . Thanks
|
|
|
Post by George on Apr 18, 2023 15:27:55 GMT -5
MUEH: Hmmm, yes, the change was made to return what an xxxx ? command returned. But obviously that's not what's needed, you want the value, not a sentence containing the value. This is a serious failing. I've got some work to do.
George
[UPDATE]
OK, Get-Profile$ code completely revised, and now performs correctly what the HELP file says it does. And BTW, I also corrected the HELP which was not quite correct in a couple places, and even had a couple of missing items. A worthwhile exercise.
I'll post another Beta.
[/UPDATE]
|
|
|
Post by Stefan on Apr 19, 2023 13:28:42 GMT -5
George, I recall requesting the standardisation of the replies for Get_Profile$. As you said above, you 'standardised' them all on whatever a ' <cmd> ?' syntax would return. At the time, I thought it awkward because the response was in the form of a phrase equivalent to the message returned my the <cmd ? syntax, but accepted it as implemented. I welcome the new format where responses to Get-Profile$("...") are more easily 'digestable' by a macro without the need to PARSE$ the reply. However,... at the time, you also enhanced Get_Profile$ to return information on all profile values and some on those changes appear to have been lost in v23109. (1) Get_Profile$ no longer provides information about AUTONUM and BOUNDS. Could you consider restoring support for them, please? (2) I note that functions Get_MaskLine$ and Get_MarkLine$ are still operative, but Get_TabsLine$ has been removed and replaced by Get_Profile("TABSLINE") I think all three 'lines' should be accessible by the same mechanism - either via Get_XxxxLine$ or via Get_Profile$("XxxxLine"). And just out of curiosity, what is the "Get_ProfString$" function which is referenced in the description for the latest beta? Typo? Thx
|
|
|
Post by George on Apr 19, 2023 14:43:22 GMT -5
Stefan: Adding AUTONUM and BOUNDS - no problem, I myself spotted a coupe of missing ones.
As to the Line$ trio, I'll be flexible - I'll add Get_TabsLine$, and I'll add Get_Profile$(..) for MaskLine and MarkLine
Get_ProfString$ is a typo, Internally labels get very clunky/clumsy.
A Profile variable has an INSTANCE name in the Profile Object, simple to reference within that object. But since Profile Objects are defined inside the Tab Object, referencing them in a macro, which is executing within the tab, yet as a callback structure, it has to explicitly define the full variable path. I use a relatively simple naming structure, but with all these names, including the external macro name (which may or may not match the macro's real routine name) and the brain just fails sometimes.
George
|
|
|
Post by George on Apr 20, 2023 9:29:57 GMT -5
Stefan: OK, cleanup complete. BNDS, MASK, MARK, and TABS can be retrieved with either Get_xxxxLINE$ or with Get_Profile$("xxxxLINE").
I figure this way no older macros will lose a familiar function name, and it allows you to 'think' in either terms when coding.
Also AUTONUM was added to Get_Profile$.
George
|
|
|
Post by Stefan on Apr 20, 2023 16:46:56 GMT -5
Version 23110 comes close, but....
Get_Profile$("MARK") returns ON/OFF Get_Profile$("MARKLINE") returns nothing and RC=8
Get_Profile$("MASK") returns the maskline Get_Profile$("MASKLINE") returns nothing and RC=8
The four Get_xxxxLine$ functions are all correct.
|
|
|
Post by mueh on Apr 21, 2023 1:23:31 GMT -5
Just one more addition to Stefan's update Get_Profile$("BNDS") returns nothing and RC=8 same for BOUNDS . Worked of course between 2.6 and 3.0 23088 . BNDS ? answer is f.e xxx thru MAX (which is perhaps more usefull than BNDSLINE) Noticed also that Get_Profile$("HIDE") doesn't show the status for both X and FILE . Returned value is for X . Here a screen shot . Left Debug window is 23110 right is 23088 . in case you want the test macro with cmd's in comment mgp.macro (1.29 KB) Thanks
|
|
|
Post by George on Apr 21, 2023 10:25:51 GMT -5
Stefan: MUEH:
Sheesh! Despite checklists while I was doing this, and testing (supposedly) all items, I still mucked it up!
OK.
MASK, MASKLINE, MARK, MARKLINE have been corrected.
HIDE now returns: X ON|OFF FILE ON|OFF
BNDS was renamed to BNDSLINE to try and be compatible with the other 'return line' guys. But MUEH may be right, perhaps BNDS should just return:
nnn THRU nnn|MAX
Vote?
George
[UPDATE] Forget the vote, I'll leave BNDSLINE as is, and add back BNDS which will return nnn THRU nnn|MAX [/UPDATE]
|
|
|
Post by Stefan on Apr 22, 2023 13:46:15 GMT -5
George,
Probably too late, but given that the other profile calls mostly return minimal 'words', I reckon BNDS should just return two 'words'. The first is the left bound value (always a number), the second is the right bound value (either a number or the word MAX)
The word 'THRU' is not needed.
|
|
|
Post by George on Apr 22, 2023 16:18:07 GMT -5
Stefan: I have no problem dropping the THRU, it all comes down to making sure the result equals what the Help file says it will return.
George
|
|
|
Post by Stefan on Apr 24, 2023 15:16:02 GMT -5
George,
There's a discrepancy between Get_Profile$("MASKLINE") and Get_MASKLINE$. When the Maskline is empty (no mask specified) Get_Profile$("Maskline") will return "None" Get_MaskLine$ returns "" (empty string). Get_Profile("Mask") returns "" (empty string).
For a bit of fun, try this....
I note the "THRU" is still there in BNDS
|
|