No not at all.  Only one place - the function adds the comments so one can
more easily work out what issues with branching and matching keywords. Then
another function magically removes them.  Regular expressions being your
friend in this case.


-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Gene
Wirchenko
Sent: Friday, 14 July 2017 2:42 PM
To: [email protected]
Subject: RE: "An IF | ELSE | ENDIF statement is missing"

At 06:59 2017-07-13, "Darren" <[email protected]> wrote:
>And another tool I have which helps is to add comments to the end of 
>the terminating commands  - e.g. ENDIF, ENDFOR, ENDDO, EXIT etc. which 
>help to identify the branch / loop.

      I dislike the clutter intensely, and if the condition changes, there
are then two places to change.

[snip]

>... With terminating comments...
>
>   DO WHILE .T.
>
>     *- Operate between 1am and 3pm local sydney time
>     IF NOT BETWEEN(HOUR(DATETIME()), 1, 15)  && 01:00:00 to 14:59:59
>
>       =messagebox("This function is designed to run between 1am and 
>3pm local time (Sydney)" + CHR(13) + CHR(13) + ;
>         "The program will now terminate", 48, "Outside of times of 
>operation", 10000)
>
>       EXIT && DO WHILE .T.
>
>     ENDIF && NOT BETWEEN(HOUR(DATETIME()), 1, 15)  && 01:00:00 to 
> 14:59:59
>
>     SELECT w_bnTrack
>     SCAN FOR rssAvailable
>
>       *- Check if this track has runs today.
>       SELECT w_usdRace
>       LOCATE FOR track_code = w_bnTrack.livetkcode
>       IF NOT FOUND()
>         SELECT w_bnTrack
>         LOOP
>       ENDIF && NOT FOUND()

      If you really need this to keep your nesting straight, you have too
much nesting.

[snip]

Sincerely,

Gene Wirchenko


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to