I tried using that SQL trick for a while and ultimately abandoned it. I
really rely on the headers I create to remind me of what the method does
and what the params are at the top. All the long discussion, if any, comes
after that. I've always heard it is all stripped out when compiled so I
just don't worry about it.

Sometimes I use If(True) statements just to make the code easier to manage.
And I like break up long Case of statements with :(false) // ** some
comment or header here **

It's purely cosmetic but I like it.

On Wed, Aug 9, 2017 at 3:11 PM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> From the conversation about converting images we saw this method header:
>
>
> If (True)
>         If (False)
>         Begin SQL
>         /*
>         Name: UTIL_ConvertPICTs
>         Path: UTIL_ConvertPICTs
>
>         Purpose: Convert all PICT formatted images in the
>         Picture Libraray to .PNG images
>
>         The v13.2 or later 4D Pack Plugin must be installed to use this
> method
>
>         */
>         End SQL
>         End if
>         C_TEXT($MethodName_T)
>         $MethodName_T:=Current method name
>          //===================== Declare Variables
> ==================================
>          //method_parameters_declarations
>          //----------------------------------------------------------
> ----------------------
>          //method_wide_constants_declarations
>          //----------------------------------------------------------
> ----------------------
>          //local_variable_declarations
>         C_LONGINT($Ndx;$SOA;$RIS;$PictRef_L)
>         C_TEXT($PictName_T)
>         C_PICTURE($Pict_G)
>         C_POINTER($Pict_P)
> End if
>
> I can suss two things out of this. One is the  "If (false)" bit at the top
> so you can do all kinds of things that break cross-referencing in the name
> of not running code.
>
> In this case it’s ‘protecting’ a Begin/End SQL which is being used because
> the construct allows you just type things with out having to comment your
> comments out.
>
> But, why wrap the whole thing in if (True)?
>
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************




-- 
Kirk Brooks
San Francisco, CA
=======================

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to