Announcement

Collapse
No announcement yet.

Macrohelp

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Rodney... AWESOME work and greatly appreciated. Not to look the equine present straight past the gums, but would this be easier in some sort of database format with viewer (like gbThreads) that is more easily updated routinely?
    <b>George W. Bleck</b>
    <img src='http://www.blecktech.com/myemail.gif'>

    Comment


    • #22
      but would this be easier in some sort of database format with viewer (like gbThreads) that is more easily updated routinely?
      Thank you, George!
      For compilation purposes, yes it would be easier, but this way it can be made available right from the PowerBASIC IDE, with context sensitive help and the include files readily available, and simplified with the use of templates.

      Like gbThreads, MACROHELP is another tool, usage is entirely up to the coding population.

      The version I'm currently working on will be the most onerous, but subsequent ones will be a piece of cake. Having said that, I don't want to drive users wacky by providing an update every week so it will likely be 3 or 4 or 6 or 12 month intervals, and depending on forum input.
      Rod
      "To every unsung hero in the universe
      To those who roam the skies and those who roam the earth
      To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

      Comment


      • #23
        At long last, I have completed version 2 of MACROHELP.

        For those interested in statistics:
        429424 characters
        1100 keywords
        769 topics
        17,968 local links
        129 MACRO FUNCTIONS
        224 Multi Line MACROs
        747 Single Line MACROs
        1100 total MACROs

        There are 3 files in the attached zip.

        There is only one *.inc file to be placed in the WinAPI directory(or your $INCLUDE directory) as support code is now in the same file as the MACROs.

        The *.chm file and the *.PBKeys file go in the 'bin' folder of your IDEs.

        A known issue concerns the following MACRO:
        MACRO NUL = ""
        This is because the MS CHM compiler will create a blank page for NUL, %NULL, $NUL, $NULL, NULL, and %NUL.
        This MACRO is included and works, there just isn't anything on its page in the compiled file.

        This version works with both PBCC 6 and PBWIN 10.

        There are now 3 sample code templates in 'Attaching to the PB IDE'

        I have a light-hearted approach to this, so don't be offended by out of context comments.

        Click image for larger version

Name:	MACROHELP_Version_2.gif
Views:	127
Size:	98.7 KB
ID:	779033

        MyZip.zip

        Rod
        "To every unsung hero in the universe
        To those who roam the skies and those who roam the earth
        To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

        Comment


        • #24
          Rod,

          I have some extra macros for you. These are primarily designed to call FASTPROC procedures but will work with normal subs and functions. They only accept 32 bit DWORD values (LONG is the same in this context) and are the bare bones for calling normal 32 bit procedures.
          Code:
          ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
          
              MACRO invoke1(proc,arg1)
                ! push arg1
                ! call proc
              END MACRO
          
              MACRO invoke2(proc,arg1,arg2)
                ! push arg2
                ! push arg1
                ! call proc
              END MACRO
          
              MACRO invoke3(proc,arg1,arg2,arg3)
                ! push arg3
                ! push arg2
                ! push arg1
                ! call proc
              END MACRO
          
              MACRO invoke4(proc,arg1,arg2,arg3,arg4)
                ! push arg4
                ! push arg3
                ! push arg2
                ! push arg1
                ! call proc
              END MACRO
          
              MACRO invoke5(proc,arg1,arg2,arg3,arg4,arg5)
                ! push arg5
                ! push arg4
                ! push arg3
                ! push arg2
                ! push arg1
                ! call proc
              END MACRO
          
              MACRO invoke6(proc,arg1,arg2,arg3,arg4,arg5,arg6)
                ! push arg6
                ! push arg5
                ! push arg4
                ! push arg3
                ! push arg2
                ! push arg1
                ! call proc
              END MACRO
          
              MACRO invoke7(proc,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
                ! push arg7
                ! push arg6
                ! push arg5
                ! push arg4
                ! push arg3
                ! push arg2
                ! push arg1
                ! call proc
              END MACRO
          
              MACRO invoke8(proc,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)
                ! push arg8
                ! push arg7
                ! push arg6
                ! push arg5
                ! push arg4
                ! push arg3
                ! push arg2
                ! push arg1
                ! call proc
              END MACRO
          
              MACRO retvalue(var)
                ! mov var, eax
              END MACRO
          
          ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
          hutch at movsd dot com
          The MASM Forum

          www.masm32.com

          Comment


          • #25
            This is a simple test piece using the macros.
            Code:
            ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
            
                #include "\basic\include\win32api.inc"
            
            ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
            
                MACRO invoke1(proc,arg1)
                  ! push arg1
                  ! call proc
                END MACRO
            
                MACRO invoke2(proc,arg1,arg2)
                  ! push arg2
                  ! push arg1
                  ! call proc
                END MACRO
            
                MACRO invoke3(proc,arg1,arg2,arg3)
                  ! push arg3
                  ! push arg2
                  ! push arg1
                  ! call proc
                END MACRO
            
                MACRO invoke4(proc,arg1,arg2,arg3,arg4)
                  ! push arg4
                  ! push arg3
                  ! push arg2
                  ! push arg1
                  ! call proc
                END MACRO
            
                MACRO invoke5(proc,arg1,arg2,arg3,arg4,arg5)
                  ! push arg5
                  ! push arg4
                  ! push arg3
                  ! push arg2
                  ! push arg1
                  ! call proc
                END MACRO
            
                MACRO invoke6(proc,arg1,arg2,arg3,arg4,arg5,arg6)
                  ! push arg6
                  ! push arg5
                  ! push arg4
                  ! push arg3
                  ! push arg2
                  ! push arg1
                  ! call proc
                END MACRO
            
                MACRO invoke7(proc,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
                  ! push arg7
                  ! push arg6
                  ! push arg5
                  ! push arg4
                  ! push arg3
                  ! push arg2
                  ! push arg1
                  ! call proc
                END MACRO
            
                MACRO invoke8(proc,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)
                  ! push arg8
                  ! push arg7
                  ! push arg6
                  ! push arg5
                  ! push arg4
                  ! push arg3
                  ! push arg2
                  ! push arg1
                  ! call proc
                END MACRO
            
                MACRO retvalue(var)
                  ! mov var, eax
                END MACRO
            
            ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
            
            FUNCTION PBmain as LONG
            
                LOCAL psrc as DWORD
                LOCAL pdst as DWORD
                LOCAL blen as DWORD
            
                a$ = "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
                psrc = StrPtr(a$)
            
                invoke1(slen,psrc)
                retvalue(blen)
            
                b$ = space$(blen)
                pdst = StrPtr(b$)
            
                invoke3(bcopy,psrc,pdst,blen)
            
                StdOut b$
            
                waitkey$
            
            End FUNCTION
            
            ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
            
             FASTPROC bcopy
            
                PREFIX "!"
            
                push esi
                push edi
            
                mov esi, [esp+4][8]
                mov edi, [esp+8][8]
                mov ecx, [esp+12][8]
                rep movsb
            
                pop edi
                pop esi
            
                ret 12
            
                END PREFIX
            
             END FASTPROC
            
            ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
            
             FASTPROC slen
            
                PREFIX "!"
            
                mov eax, [esp+4]
                sub eax, 1
            
              lbl:
                add eax, 1
                cmp BYTE PTR [eax], 0
                jne lbl
                sub eax, [esp+4]
            
                ret 4
            
                END PREFIX
            
             END FASTPROC
            
            ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
            hutch at movsd dot com
            The MASM Forum

            www.masm32.com

            Comment


            • #26
              Thanks Steve!

              I won't get a new version out for a while, that is, until I get a build up of new macros, so keep them coming!

              Everyone else as well!
              Rod
              "To every unsung hero in the universe
              To those who roam the skies and those who roam the earth
              To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

              Comment


              • #27
                Hm, downloaded it, installed as instructed in bin folders, etc. but get no contents in right side page. What is wrong? (Win7, 64 bit)
                Attached Files

                Comment


                • #28
                  Problem solved - had to right click on the chm file, open up properties and click an "Unblock" button there so see the contents page. Now its working!

                  Comment


                  • #29
                    Apparently that can be an issue with these *.chm files, and I keep forgetting to mention it to smooth the installation process. I should have put in the Help file itself.
                    Rod
                    "To every unsung hero in the universe
                    To those who roam the skies and those who roam the earth
                    To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

                    Comment


                    • #30
                      I googled, found the answer right away and while reading it, I remembered I already knew this. Can someone please invent a Google for brains?
                      Ps, great work, thanks! - and those jokes on every page has kept me "busy" for hours now..

                      Comment


                      • #31
                        and those jokes on every page has kept me "busy" for hours now.
                        It was my intention to create the world's most lighthearted Help file!! Glad you enjoy them.
                        Rod
                        "To every unsung hero in the universe
                        To those who roam the skies and those who roam the earth
                        To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

                        Comment


                        • #32
                          Hats off to you Rodney. Very nice organization. I'm sure I'll spend hours browsing!!

                          Comment


                          • #33
                            Originally posted by Rod
                            I should have put in the Help file itself.
                            How would we see it if the contents were not displaying? Reminds me of the Microsoft message box many years ago which advised the user that the monitor was not working.

                            A ReadMe.txt would do it.

                            Comment


                            • #34
                              How would we see it if the contents were not displaying?
                              So that those who did not have the problem could help those that did have the problem, and have bad memories, the latter which might be why it's not in the help file because I thought exactly as you did and forgot that I did!

                              As I finished typing the above sentence, I remembered why I didn't. It's already been mentioned in this thread.

                              Thanks Raymond!
                              Rod
                              "To every unsung hero in the universe
                              To those who roam the skies and those who roam the earth
                              To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

                              Comment


                              • #35
                                Börje,
                                "Problem solved - had to right click on the chm file, open up properties and click an "Unblock" button there so see the contents page."
                                Perfect!!
                                /Fim W.
                                Fim Wästberg

                                Comment


                                • #36
                                  You'd man Rodney! Thank you very much indeed and to other's for their contributions/advice.

                                  Comment


                                  • #37
                                    Rodney,

                                    This is fabulous! THANKS!

                                    Two questions:

                                    1. Is there any way to tell if the "J.M." author is me? If so, I'm quite happy that I was able to contribute to the body of knowledge (it's probably the tiniest of all!), and if not, I'd like to know who's out there using my initials!

                                    2. The downloadable MyZip.ZIP in post 23 contains the file: MacroHelp.PBKeys
                                    Per instructions in one of the posts above, I copied it to the folder: \PBWin10\bin\
                                    But I was not able to get the F1 help feature to work, nor see it listed in the Help menu of the P IDE...

                                    SO: upon further investigation, I found that the file is missing a line that would enable those behaviors: HelpFile=

                                    The snippet below duplicates the first 4 lines from the file in the ZIP, with the HelpFile= line inserted.

                                    MenuName="QMacroHelp"
                                    HelpFile="D:\PBWin10\bin\QMACROHELP_V2.chm"
                                    HelpKey="AddOneLabelTest"
                                    HelpKey="ARCCOSH"
                                    HelpKey="ARCSIN"
                                    ...thought folks might find this helpful! (helpful, helpfile, a bit of a pun there...)

                                    -John

                                    Comment


                                    • #38
                                      John, question 1: no there is no way to know for sure other than the content of the macro(s), You'd likely know if the content was yours, unless you're like me and forget what you just did thirty seconds ago.

                                      Re question 2:
                                      I'm sorry for that, glad you figured it out quickly enough. My copy of the file has that line in it. I think I may have put the line in it but not saved it before zipping the files. Too accustomed to the IDE saving things on compile, but there was no compile in this case.
                                      Thanks!!
                                      Rod
                                      "To every unsung hero in the universe
                                      To those who roam the skies and those who roam the earth
                                      To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

                                      Comment


                                      • #39
                                        LOL! Yeah, it's named the way I use names, and it's small and doesn't do much, so it's a lot like me in those ways, too!

                                        I stand on the shoulders of giants.

                                        -John

                                        Comment

                                        Working...
                                        X