+ Reply to Thread
Page 11 of 13 FirstFirst ... 910111213 LastLast
Results 101 to 110 of 122

Thread: Subcode.vdm : The Macro Subroutines Project

  1. #101
    Senior Member
    Join Date
    Aug 2011
    Location
    British Columbia, Canada
    Posts
    383
    Hi Peter,

    Thank you for your comments.

    I think you mean Vfiler need its own vfiler.txt file ? I agree. It will take quite a bit of work to turn it into a "finished macro" from a demo. It needs a way to rename a file as well as change its attributes, as you suggested.

    Cannot give subcode a help button, as the subroutines do not provide an user interface to place a help button.
    However I will give the issue some thought.

    Scott
    Using Vedit 6.21.3, (32 bit), dated 9/12/11 running on Windows 7 (64 bit).

  2. #102
    Senior Member
    Join Date
    Aug 2011
    Location
    British Columbia, Canada
    Posts
    383
    Hi Peter,

    You said: "Actually, my USER.MNU files are too crowded and I would love to use it via VFiler."

    It occurs to me that one can have a master user menu and then have submenus off it.

    Consider an user.mnu like this:

    1
    Default Menu
    Reg_Load(124,"|(USER_MACRO)\default.mnu",EXTRA+NOE RR)
    1
    Latex Menu
    Reg_Load(124,"|(USER_MACRO)\latex.mnu",EXTRA+NOERR )
    1
    Scott Macros
    Reg_Load(124,"|(USER_MACRO)\scott.mnu",EXTRA+NOERR )
    1
    Pauli Macros
    Reg_Load(124,"|(USER_MACRO)\latex.mnu",EXTRA+NOERR )
    6
    Most Used
    Reg_Load(124,"|(USER_MACRO)\mostused.mnu",EXTRA+NO ERR)


    So this would be your new user.vdm, what you currently have would renamed default.mnu

    The first entry in each submenu would be:

    11
    Return to Main Menu
    Reg_Load(124,"|(USER_MACRO)\user.mnu",EXTRA+NOERR)

    I have not actually tested this, but I don't see why it would not work.

    Just an idea....

    ps: Beware of the space in noerr in the above, it does not show up when I edit the message.

    Scott
    Last edited by Scott Lambert; October 5th, 2016 at 07:39 AM.
    Using Vedit 6.21.3, (32 bit), dated 9/12/11 running on Windows 7 (64 bit).

  3. #103
    Senior Member
    Join Date
    Nov 2014
    Location
    Minneapolis, MN
    Posts
    311
    Quote Originally Posted by Scott Lambert View Post
    Hi Peter,

    You said: "Actually, my USER.MNU files are too crowded and I would love to use it via VFiler."

    It occurs to me that one can have a master user menu and then have submenus off it.

    Consider an user.mnu like this:

    Just an idea....

    Scott

    Thanks Scott,

    I believe that I have been using a variation of your suggestion.

    Specifically, I have an old macro that allows me "point and shoot" a user-mnu file.

    Now, I would say that I am invoking your "getdir" Subroutine. So, I tried to find the getdir Subroutine on this forum. When I searched for it, I got exactly one hit. It put me to the first page of the Subroutine Project.

    I believe in the old days this would have put me to the "getdir" subroutine directly. In short, I would like to get your gertdir.htm file in which you describe the getdir.vdm subroutine.

    In short, I would like to use the forum search engine to find getdir.html. Is that possible ?

    My reason for getting the getdir.html file is that I would like to use it as a help file for the getdir.vdm.

    Thanks as always,

    -peter
    Last edited by rejto12; October 9th, 2016 at 12:05 PM. Reason: correct typo

  4. #104
    Senior Member
    Join Date
    Aug 2011
    Location
    British Columbia, Canada
    Posts
    383
    Hi Peter,

    Like all Subcode Subroutines, getdir is in subcode.vdm. Instructions for all subroutines are in the included Subcode.txt file. Use a current version of subcode.vdm, made buxfixes to getdir a few versions back.


    Scott
    Using Vedit 6.21.3, (32 bit), dated 9/12/11 running on Windows 7 (64 bit).

  5. #105
    Senior Member
    Join Date
    Nov 2014
    Location
    Minneapolis, MN
    Posts
    311
    Thanks Scott,

    Now I would like to look up the getdir help file while I am visiting the forum. When you posted the getdir.vdm subroutine you had an electronic cover letter. I do not know the technical term for it. It is a kind of an update. Now subcode.vdm has the new getdir.vdm subroutine and usually you give a short description of the new subroutine. I would like to use this description in place of the "official" help file.

    I should be able to find this file on the forum.

    Thanks as always.

    -peter
    Last edited by rejto12; October 10th, 2016 at 09:37 PM. Reason: correct a typo

  6. #106
    Senior Member
    Join Date
    Aug 2011
    Location
    British Columbia, Canada
    Posts
    383
    Hi,

    As per Peter's request, the attached Subcode includes the subroutines getattr and getro.

    Getattr gets the attributes of file in t-reg 10. A sting of attributes set is returned in t-reg 20. Various flags are also set for each attribute. (files only!)

    Getro : Just returns the status of the read-only attribute of file in t-reg 10 in #20. 0=not set, 1=set (again files only!)

    Also includes several subroutines related to a subcode.ini file, I was working on, before getting distracted by the idea of Jarvis.

    November 2: Fixed bug related to file attributes.
    November 3: fixed bug in getro as per Peter's message

    Scott
    Attached Files Attached Files
    Last edited by Scott Lambert; November 3rd, 2016 at 07:49 AM.
    Using Vedit 6.21.3, (32 bit), dated 9/12/11 running on Windows 7 (64 bit).

  7. #107
    Senior Member
    Join Date
    Nov 2014
    Location
    Minneapolis, MN
    Posts
    311
    Quote Originally Posted by Scott Lambert View Post
    Hi,

    As per Peter's request, the attached Subcode includes the subroutines getattr and getro.

    Getattr gets the attributes of file in t-reg 10. A sting of attributes set is returned in t-reg 20. Various flags are also set for each attribute. (files only!)

    Getro : Just returns the status of the read-only attribute of file in t-reg 10 in #20. 0=not set, 1=set (again files only!)

    Also includes several subroutines related to a subcode.ini file, I was working on, before getting distracted by the idea of Jarvis.

    Scott
    Great,

    Thank you very much.

    -peter

  8. #108
    Senior Member
    Join Date
    Aug 2011
    Location
    British Columbia, Canada
    Posts
    383
    Hi Peter,

    I made a minor bug fix to getattr in in subcode. Message #106 in this thread has the zip file with the fix. Basically if the archive attribute was set, the string in t-reg 20 would not show the I if the index attribute was set. Forgot an append parameter.

    Also made & posted a similar fix to jarvis in the first message of that thread.

    Scott
    Using Vedit 6.21.3, (32 bit), dated 9/12/11 running on Windows 7 (64 bit).

  9. #109
    Senior Member
    Join Date
    Nov 2014
    Location
    Minneapolis, MN
    Posts
    311
    Quote Originally Posted by Scott Lambert View Post
    Hi Peter,

    I made a minor bug fix to getattr in in subcode. Message #106 in this thread has the zip file with the fix. Basically if the archive attribute was set, the string in t-reg 20 would not show the I if the index attribute was set. Forgot an append parameter.

    Also made & posted a similar fix to jarvis in the first message of that thread.

    Scott
    Hi Scott,

    On a project of this magnitude, this type of typo is unavoidable. At the same time, I do appreciate your fixing the typo.

    -peter

  10. #110
    Senior Member
    Join Date
    Nov 2014
    Location
    Minneapolis, MN
    Posts
    311
    Quote Originally Posted by Scott Lambert View Post
    Hi,

    As per Peter's request, the attached Subcode includes the subroutines getattr and getro.

    Getattr gets the attributes of file in t-reg 10. A sting of attributes set is returned in t-reg 20. Various flags are also set for each attribute. (files only!)

    Getro : Just returns the status of the read-only attribute of file in t-reg 10 in #20. 0=not set, 1=set (again files only!)

    Also includes several subroutines related to a subcode.ini file, I was working on, before getting distracted by the idea of Jarvis.

    November 2: Fixed bug related to file attributes.

    Scott
    Hi Scott,

    After fixing a harmless typo in the getro subcode it worked like a charm. Here are the details,

    // gets status of the read-only attribute of a file
    :getro:
    reg_push(30,49)
    num_push(30,49)
    #20=0
    #30=file_attrib('"|@(10)"') // neat trick concatenating the content of T-reg 10 and the `"` strings
    // without using the Reg_Set(10, `"`, APPEND) construction. In other words,
    // simple concatenation works in this special case.
    #31=#30/2
    if(remainder==1) {#20=1} // rejto corrected typo, 2016-11-02.
    reg_pop(30,49)
    num_pop(30,49)
    return
    // end of getro

    Specifically, after consulting the "if-then" flow control statement in the Vedit Macro Manual, I have changed a round parenthesis to a curly one.

    Thanks as always,


    -peter
    Last edited by rejto12; November 3rd, 2016 at 12:21 AM.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts