Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012
Posted by Skywise on December 23, 2012 at 00:28:43:

I'm sure you've encountered plenty of people who have a driver's license who have absolutely no business behind the wheel. Likewise, I've encountered people who have academic degrees who really don't know squat. Having the degree just means you managed to remember the answers long enough to pass the tests. It doesn't necessarily mean you comprehend the subject, at least for the lower degrees. (obviously, defending a PhD thesis proves you DO comprehend the subject)

BTW, you do know that 80% of drivers think they are better than average drivers, right?

Anyway, there are better ways to handle different initialization statements depending on where the program runs rather than calling a second program.

The easiest is to simply duplicate the few statements in two blocks. Then, just remark out the one block that's not being used.

Just like you and testing on a PC vs on a server, I've had to change a few variables for testing this bulletin board on my own host because the board is running on "skywise711.com" and not "earthwaves.org". I just remarked out the current statement and made a new correct one right below it. When the board finally switches and the DNS points to my host, all I have to do is change which statements are commented out.

Another technique I've used in the past is to use one (or a few) variables at the beginning of the program to set the conditions, then when there is a choice to use different settings, the code uses an IF to set the variables or run other code according to those conditional statements at the beginning of the program.

pseudocode:

set Local = TRUE

IF Local = TRUE THEN
{set variables as needed to run locally on the PC}
{or run commands only used when run on PC}
ELSE
{set variables for use on the server}
{or run commands only when on the server}
END IF

Now all you have to do is change the definition of the variable 'Local' from TRUE to FALSE to change the variables set. This is really only useful if there are a LOT of variables that change, especially when those variables are scattered all through the program.

Yet another would be to have a GOSUB or function call to a specific subroutine that sets the variables as needed. Then you just call the right sub as needed, commenting out the one not used.

I may also be a self taught programmer, but I've had 30 years to discover the easy ways to solve these problems.

Yep, 30 years ago this year is when I received my first computer. 8 bits. <1Mhz. 32k RAM. Cassette tape storage.

Brian


Follow Ups:
     ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - Canie  12:30:20 - 12/23/2012  (80886)  (1)
        ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - Skywise  14:47:39 - 12/23/2012  (80892)  (1)
           ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - Canie  17:10:00 - 12/23/2012  (80895)  (1)
              ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - Roger Hunter  17:19:24 - 12/23/2012  (80897)  (1)
                 ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - Skywise  19:34:44 - 12/23/2012  (80899)  (2)
                    ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - Jim W.  09:05:36 - 12/25/2012  (80904)  (0)
                    ● Mac SE - Island Chris  06:34:18 - 12/24/2012  (80900)  (1)
                       ● Re: Mac SE - Roger Hunter  07:36:32 - 12/24/2012  (80901)  (1)
                          ● Re: Mac SE - Island Chris  06:14:01 - 12/25/2012  (80903)  (1)
                             ● Re: Mac SE - Roger Hunter  10:06:23 - 12/25/2012  (80905)  (0)
     ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - EQF  02:59:49 - 12/23/2012  (80884)  (1)
        ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - Skywise  14:57:25 - 12/23/2012  (80893)  (1)
           ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - Roger Hunter  16:09:33 - 12/23/2012  (80894)  (1)
              ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - Canie  17:17:07 - 12/23/2012  (80896)  (1)
                 ● Re: Demonstration Bulletin Board and Note To Skywise – December 21, 2012 - Roger Hunter  17:23:10 - 12/23/2012  (80898)  (0)