RE: "An IF | ELSE | ENDIF statement is missing"

Author: Darren

Posted: 2017-07-13 at 08:59:28

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.

Viz.

Without 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

ENDIF

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

... 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()

-----Original Message-----

From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of

mbsoftwaresolutions@mbsoftwaresolutions.com

Sent: Thursday, 13 July 2017 11:41 PM

To: profoxtech@leafe.com

Subject: "An IF | ELSE | ENDIF statement is missing"

Don't you hate it when you have a super long one-time conversion program,

add some new 1-time crap over time, and then all of the sudden when ready to

run you get this error message, AND CAN'T SEE WHERE THIS MISSING/ERRANT

STRUCTURE IS?

I'd be surprised if we haven't all been there at some point in our dev

lives.

It pays to take the time and do good modular design instead of this

way-too-long PRG run on crap. hahaha

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

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/001801d2fbe0$3ecd3e50$bc67baf0$@ozemail.com.au

** 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.

©2017 Darren