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:profoxtech-bounces@leafe.com] On Behalf Of Gene Wirchenko Sent: Friday, 14 July 2017 2:42 PM To: profoxtech@leafe.com Subject: RE: "An IF | ELSE | ENDIF statement is missing"
At 06:59 2017-07-13, "Darren" foxdev@ozemail.com.au 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 and3pm 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 to14: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]