Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd behavior with #ENDIF in #DEFINE
Message
 
 
To
11/09/2006 15:08:16
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01152849
Message ID:
01152855
Views:
18
Greg,

After VFP encounters #IF .F. it will ignore all lines until it finds #ELIF or closing #ENDIF.


>
>I am developing a Test Suite class, and would like to devise my own command using Preprocessors. I have the following include file.
>
>
>#IFNDEF TEST_SUITE
>
>#DEFINE TEST_SUITE      #IF .F.
>#DEFINE ENDTEST_SUITE   #ENDIF
>
>#DEFINE TEST_CASE       *
>#DEFINE ENDTEST_CASE
>
>#ENDIF
>
>
>In the various methods, I am define the test case in the actual code as such:
>
>
>* Standard Method Header
>*---------------------------------------
>
>TEST_SUITE
>TEST_CASE    First Test Case
>    *- <Place Test Case code here>
>ENDTEST_CASE
>ENDTEST_SUITE
>
>WAIT WINDOW "For something"
>
>*- The remainder of the method is the actual code for the method.
>
>
>Now for the problem.
>
>When compiled and ran, the lines after of ENDTEST_SUITE (aka #ENDIF) are ignored at run-time, or something close to that. Here a simplified version of the same problem.
>
>
>SET STEP ON
>
>#define kStart #IF .F.		&& text noshow
>#define kEnding #ENDIF		&& endtext
>WAIT WINDOW
>
>kStart
>? "Hello"
>kEnding
>
>WAIT WINDOW
>? "world"
>
>RETURN
>
>
>In this example, the debugger stops at the first "WAIT" statement, but it proceeds after it, it exits the routine. Now if you comment out the first WAIT statement and run it again, the behavior changes a little. Now the it stops at the "RETURN" statement after executing the SET STEP statement.
>
>Has anyone encountered this before, and is there a fix or work-around to placing a "#ENDIF" is a constant?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform