>>Dear all,
>>
>>I need all the help I can get.Please do help. THanks in advance.
>>Here's my problem.
>
>>*thisform.text2.value = 10 and thisform.aperiod = 10
>>*thisform.text4.value = 1998 and thisform.ayear = 1997
>>DO WHILE thisform.check = .f.
>> thisform.aperiod = thisform.aperiod + 1
>> if thisform.aperiod > acperiod
>> thisform.aperiod = 1
>> thisform.ayear = thisform.ayear + 1
>> endif
>> thisform.i = thisform.i + 1
>>[ if thisform.text2.value = thisform.aperiod and;
>> thisform.text4.value = thisform.ayear
>> thisform.check = .t.
>> endif]
>>ENDDO
>>
>>Logically I think the part with [] works but something weird
>>happens instead, I do not know where I go wrong.
>>GIven thisform.aperiod the value of 10 and thisform.ayear=1997,
>>thisform.text2.value = 10 and thisform.text4.value = 1998
>>when it reached the checking part [] the
>>thisform.ayear's value is changed back to 1997 causing
>>an endless loop. Why does the IF..ELSE..ENDIF statement
>>not working?
>>
>>Dora
>
>For future readability format your code, something like this
>also put more liberal comments to the right. Its easier
>to read the comments while your still can see the code.
>The names of your variables should be a little clearer also.
>What is thisform.i? Text4.Value doesn't mean much to someone
>trying to decipher your code. I realize you want help with
>the code as soon as possible and you typed this out very
>quickly, but you have to make it easier for the person helping
>you as well.
>
>
>Dan
>:)
I would be interested in knowing what the initial values of
'thisform.i' and 'acperiod' are for this example. Also, the
title of this thread is 'IF..ELSE..ENDIF statement...' and
yet I do not see an 'ELSE' anywhere in this code. Should
the the first 'ENDIF' really be an 'ELSE' ?? Just a thought!
Dave
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only