IF act_flag="2" GO BOTTOM LOCATE FOR UPPER(shipno) =alltrim(thisform.text1.Value) AND act_flag="2" IF!FOUND() MESSAGEBOX("Not Found") ELSE Select (cAlias) scan DELETE FOR UPPER(shipno) =alltrim(thisform.text1.Value) AND act_flag="2" endscan Append from dbf('csrMyCursor') for !empty(bookno) * for !empty(bookno) or !empty(sticket) OR !empty(eticket) SCAN FOR UPPER(shipno) =alltrim(thisform.text1.Value) AND act_flag="2" REPLACE recevied WITH thisform.text8.Value,rdate WITH thisform.text9.value with thisform.combo1 REPLACE storid WITH .List(.ListIndex,2) ENDWITH with thisform.combo2 REPLACE GAMENO WITH .List(.ListIndex,2) ENDWITH endscan IF USED('game') SELECT game ELSE SELECT 0 USE game AGAIN && ENDIF USE game with thisform.combo2 replace balance1 WITH balance1 +thisform.text2.value FOR gameno=thisform.combo2.List(.ListIndex,2) ENDWITH ENDIF ENDIF With thisform.grid1 .recordsource = '' thisform.text1.SetFocus thisform.refresh endwith ********************** with thisform.Grid1 .Recordsource = .Recordsource endwiththanks
>>>If XXXX >>> SCAN >>> If YYYYY >>> Do while ZZZZ >>> If AAAAA >>> Line of code 10 >>> EndIf >>> EndDo >>> Else >>> Line of code 1 >>> Line of code 2 >>> Line of code 3 >>> Line of code 4 >>> EndIf >>> EndSCAN >>>Else >>> Line of code 5 >>> Line of code 6 >>> Line of code 7 >>> Line of code 8 >>> Line of code 9 >>>Endif >>>>>>Then it's a lot easier to understand, rather than all over the place as you presented it, where first one has to sort out the indentation and follow the logic before one can decypher and understand the code