Announcement

Collapse
No announcement yet.

discussion for f2+ source code viewer

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

  • discussion for f2+ source code viewer

    posted on Source Code forum: http://www.powerbasic.com/support/pb...378#post323378

    Syntax/keyword coloration, improved source file selection added. Following MCM's suggestion, comments preceding the function header are included with the function in the viewer window.

    Any suggestions for improvements/enhancements welcome.

  • #2
    Great work Chris!

    A dialog to open file would be pretty cool!
    "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.

    Comment


    • #3
      Arthur, a) Thanks! b) are you using the latest version in post #2? That has a file open dialog activated on startup or by clicking the button which shows the path of the current source code file.



      Originally posted by Arthur Gomide View Post
      Great work Chris!

      A dialog to open file would be pretty cool!

      Comment


      • #4
        Just a couple of comments, Chris:

        - the top button with the source file name as text does not look like a button because it takes up all the space above the listview. I didn't even realize it was a button before examining your code.

        - Selecting a BAS soure file for the main window, and then a routine for a second window... and then making the main window active and closing it gives a GPF error.

        Comment


        • #5
          Thanks Charles!

          Originally posted by Charles Dietz View Post
          ... I didn't even realize it was a button before examining your code.
          Good point, I will stick a tooltip on it to make matters plain.

          Originally posted by Charles Dietz View Post
          ... gives a GPF error.
          Not for me! What exactly did you do?

          Comment


          • #6
            I compile your program and select a BAS source file. The main window opens with all of the routines listed. I select one and it opens in a second window. Now, I just close the main window while the second window still shows. Both windows close, but with a MS Windows GPF error.

            Comment


            • #7
              Hmm. Maybe your source code contains something which confuses it. I have tried it on half a dozen large and small sources, but maybe I missed something. Will look harder...

              Comment


              • #8
                Without GPF here, but a window disappears!

                1 execute your exe
                2 open your source prog file
                3 open "build" and drag it to a new position
                4 open "maindlgproc" and drag it to a new position
                5 open "maindlg" and drag it too
                6 open "pbmain" and drag
                all right at this point
                7 click on the bar to open a new file
                when the file is opened the first windows "build" goes out
                "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.

                Comment


                • #9
                  Originally posted by Arthur Gomide View Post
                  1 ...7
                  No, I can't make it do that either, but I have found an array bounds violation which could be a common source for both your error and Charles's - will post a corrected version. Sorry!

                  Also, would you want to keep more than one source file's function viewers active? I had thought of a "one source file, many function viewers" model. Maybe "many source files, each with many function viewers" would be better? What do you think? The implementation is a bit ambiguous.
                  Last edited by Chris Holbrook; 14 Sep 2009, 03:44 PM.

                  Comment


                  • #10
                    Hi Chris,

                    I just tried to force a gpf error ... your program is good this way. You did a great job!
                    "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.

                    Comment


                    • #11
                      Slick!!!
                      Rod
                      In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                      Comment


                      • #12
                        Quite nice, Chris. Well done. I would suggest a sort of the function names (or at least have the option of clicking on Names and having them sorted).

                        Also maybe have it open up to a larger, wider window so one could see more functions at a time.

                        And maybe show Macros as well.

                        Not trying to be picky, just helpful.

                        ===================================
                        "When I use a word,
                        it means what I choose it to mean,
                        neither more nor less."
                        "
                        The Queen of Hearts
                        (Lewis Carrol 1866-...)
                        ===================================
                        It's a pretty day. I hope you enjoy it.

                        Gösta

                        JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                        LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                        Comment


                        • #13
                          OK I think the GPF one is fixed. Both files (f2plus.bas and cce_basro.inc) are changed. Will update the Source Code Forum shortly.

                          Also, the expected action on selecting a different source file was not properly defined. I have changed it so that only a single source code file can be examined by a single instance of the application.

                          Tooltips added to explain the effect of clicking on the main dialog controls.

                          Viewer changed so as to return the viewer dialog handle rather than send it in a user message.

                          Gösta: Three good suggestions, thanks. I have added them to the "to do" list.

                          Arthur: Years of practice have honed my GPF skills!

                          Comment


                          • #14
                            Added a current PowerBASIC keyword list to the Downloads section. Check http://www.powerbasic.com/support/downloads/windows.htm ...

                            Comment


                            • #15
                              Originally posted by Tom Hanlin View Post
                              Added a current PowerBASIC keyword list to the Downloads section...
                              Thanks Tom, I shall also add it to the To Do list.

                              Comment


                              • #16
                                Regarding the problem which Stephane Fonteyne has posted in the Source Code Forum (it's the wrong place, Stephane!).

                                I have downloaded and compiled the code with PBWin 9 without difficulty, so I will have to wait for futher information, which should be posted in this thread (the right place).

                                Stephane, you say "Include files : Jose Roca". If this means that you have changed my code, then I'm sorry, your warranty is null and void and you definitely do not get a refund.

                                However, this prompts me to look again at the "to do" list, which I have not looked at for over a year....

                                Comment


                                • #17
                                  New Source Code posted

                                  Source code is here.

                                  The speed of loading a source file has been improved by using an index which includes the byte offset of each function in the source code file.

                                  I don't have any huge sources to test it against, if anyone would care to try it against their favorite monster application I would appreciate feedback! Come to think of it, I can make one up.

                                  **** added - The delay with a 40K line source is just noticeable. BUT there is an array in there initially dim'd to 50K rows.
                                  Last edited by Chris Holbrook; 7 Feb 2011, 01:12 PM.

                                  Comment


                                  • #18
                                    Some bugfixes and new functionality added:

                                    Code:
                                    ' A Blocklist (Function/sub/method/class/type) utility inspired by PowerBASIC's F2 function
                                    ' Presents a list of blocks from which a selection can be made to view source code
                                    ' Synchronises with the last saved version of the subject file by checking the directory entry
                                    ' every 2000 milliseconds or so and reloading the function index and any changed windows
                                    '
                                    ' Chris Holbrook 12-Sep-2009
                                    '
                                    ' Changes
                                    ' 13-SEP-2009 includes comments preceding sub/function header in the function viewer windows
                                    ' ~~~~~~~~~~~~~~~~~~~~~~~~
                                    ' etc
                                    '~~~~~~~~~~~~~~~~~~~~~~~~~
                                    ' 7-FEB-2011 improved the performance of the source file load
                                    '19-FEB-2011 fixed bug where CLASS and CLASS METHOD were handled wrongly
                                    '19-FEB-2011 Added multi-line MACRO sensing
                                    '19-FEB-2011 Added TYPE declaration sensing
                                    '19-FEB-2011 fixed bug where leading comments were not properly handled
                                    '19-FEB-2011 fixed bug where trailing lines were sometimes included after END...
                                    '19-FEB-2011 Path of target source code file can be supplied on command line as first parameter

                                    Comment


                                    • #19
                                      A little tweaking will give you the ability to browse a repository of PowerBasic source code files and extract block structures from any one of them, to be cut and pasted into your PowerBASIC IDE.
                                      Attached Files

                                      Comment

                                      Working...
                                      X