Announcement

Collapse
No announcement yet.

Some useful housekeeping routines for those writing a big program

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

    Some useful housekeeping routines for those writing a big program

    Hello PBCCers. You all have helped me so much, I thought I'd share a few useful little utilities that I wrote. These are to help me as I'm working on my large PBCC aircraft design program which is spread across dozens of source code #Includes and was coded over a period of 30+ years. They've been a big help as I've been trying to clean up and squeeze down my code to solve the Cannot Access Compiler Results error that has been plaguing me recently (I'm winning, but the battle continues).

    There are five utilities, as follows:

    -List the Subs and Functions in all .bas files
    -List all #Includes
    -List out long IO text strings which were originally hard-coded in quotes
    -Remove non-standard characters and optionally replace long blank strings with CHR$(34)+SPACE$(#)+CHR$(34)
    ​-Add up total lines of code

    The first three write a text file with the results, making it easy to search for a particular item. The fourth one creates a fixed copy of your source code file but doesn't touch the original.

    All are written in simple PBCC Basic, nothing tricky, no WinAPI calls, etc. I'm sure you all could quickly write similar codes and make them better, but these are already working.

    These are in the attached file, or you can download them at www.aircraftdesign.com/RaymerCodes.txt.
    Attached Files

    #2
    Got file attached here after www.aircraftdesign.com/RaymerCodes.txt.​ closed the connection on me.
    Thought you'd want to know (does server block IPs from outside U.S.?)

    Cheers,
    Dale

    Comment


      #3
      Originally posted by Dale Yarker View Post
      Got file attached here after www.aircraftdesign.com/RaymerCodes.txt.​ closed the connection on me.
      Thought you'd want to know (does server block IPs from outside U.S.?)

      Cheers,
      It didn't block from PNG. But if you browser automatically uses https, you may get a refusal to download with that link.. (Firefow gave me a "Secure Connection Failed") Specifically going to http://www.aircraftdesign.com/RaymerCodes.txt ( without the "s") worked.

      @Raymond. You really should get an SSL certificate for your site to avoid these problems. Browsers are getting very fussy about insecure sites these days.Check out ZeroSLL.com for a free certificate..
      =========================
      https://camcopng.com
      =========================

      Comment


        #4
        Originally posted by Daniel Raymer View Post
        -Remove non-standard characters and optionally replace long blank strings with CHR$(34)+SPACE$(#)+CHR$(34)
        A couple of suggestiions.

        PB has a built in equate $DQ which you can use rather than CHR$(34)

        You can concatenate characters with CHR$, so you could shorten your replacement to
        CHR$(34,SPACE$(x),34) or preferably CHR$($DQ,SPACE$(x),$DQ) (avoid "magic numbers" wherever possible in code )

        =========================
        https://camcopng.com
        =========================

        Comment


          #5
          From post 1 in view source:
          Code:
          at <a href="[URL]https://www.aircraftdesign.com/RaymerCodes.txt[/URL]" target="_blank" rel="nofollow">www.aircraftdesign.com/RaymerCodes.txt</a>.​
          Is vBulliotin adding the "https:" or MS Edge? (both in different places?)

          Edge gave me a problem in address bar when I went to log into my web host. It worked a few months ago without "forcing" it.

          Hovering over URL in post 1 showed "https:// etc etc" in status bar so it appeared to be secure. I did not associate it to be same problem.

          Or are both vBullitin a Edge doing things they should not? (In Edge's case it can warn, but should not change http to https upon entering it!!)

          Cheers,
          Dale

          Comment


            #6
            Originally posted by Dale Yarker View Post
            From post 1 in view source:
            Code:
            at <a href="[URL]https://www.aircraftdesign.com/RaymerCodes.txt[/URL]" target="_blank" rel="nofollow">www.aircraftdesign.com/RaymerCodes.txt</a>.​
            Is vBulliotin adding the "https:" or MS Edge? (both in different places?)

            Edge gave me a problem in address bar when I went to log into my web host. It worked a few months ago without "forcing" it.

            Hovering over URL in post 1 showed "https:// etc etc" in status bar so it appeared to be secure. I did not associate it to be same problem.

            Or are both vBullitin a Edge doing things they should not? (In Edge's case it can warn, but should not change http to https upon entering it!!)

            Cheers,
            vBulletin is the culprit: If you just type in the URL without "http" or "https" , it autocompletes with "https"
            See https://forum.powerbasic.com/forum/t...ion#post823874 for a demo.

            If you find a site changing from http to https when you go to it, it is the site's server that is doing the redirect - either with a Virtual Host configuration entry or a .htaccess file.



            =========================
            https://camcopng.com
            =========================

            Comment


              #7
              It is both then.

              I retried going to my web host with Edge. Now that it has been "forced" it shows "https" in red and lined through, but retrieves the http page as requested.

              [end hijack AFAIC]

              Cheers,
              Dale

              Comment


                #8
                Originally posted by Stuart McLachlan View Post
                It didn't block from PNG. But if you browser automatically uses https, you may get a refusal to download with that link.. (Firefow gave me a "Secure Connection Failed") Specifically going to http://www.aircraftdesign.com/RaymerCodes.txt ( without the "s") worked.

                @Raymond. You really should get an SSL certificate for your site to avoid these problems.
                Browsers are getting very fussy about insecure sites these days.
                Check out ZeroSLL.com for a free certificate..
                Fussy about spelling too ... correct link is: ZeroSSL.com
                Last edited by Mr. Kevin Diggins; 18 Jun 2023, 01:03 PM.

                Comment


                  #9
                  > Check out ZeroSLL.com for a free certificate.​

                  Doh! PB SLL's on the brain
                  =========================
                  https://camcopng.com
                  =========================

                  Comment

                  Working...
                  X
                  😀
                  🥰
                  🤢
                  😎
                  😡
                  👍
                  👎