Are the VarType() commands supposed to have the .T. in it to guess it's an Object, or a .F. to return the "X" instead?
Tracy > -----Original Message----- > From: Michael Hawksworth > Sent: Friday, August 18, 2006 6:39 AM > Subject: Case Statement > > > Could you try running this code and see if the otherwise clause > executes? I forgot to have the form load the boLoadSupplier business > object and the routine should have trapped it but it appear to set > lcErrorMsg and then run the otherwise code. If it does work > could you > try making the first line " Case vartype(llOK,.t.) = 'L' " so that it > fails on the second line and see if otherwise executes. > > Thanks > > local lcErrorMsg as string > lcErrorMsg = '' > > local llOK as Logical > llOK = .f. > > Do case > Case Vartype(thisform.boTradingSheet,.t.) <> 'O' > lcErrorMsg = "boTradingSheet" > Case Vartype(thisform.boLoadSupplier,.t.) <> 'O' > lcErrorMsg = "boLoadSupplier" > Case Vartype(thisform.boTradingLoad,.t.) <> 'O' > lcErrorMsg = "boTradingLoad" > Case Vartype(thisform.boOrganisation,.t.) <> 'O' > lcErrorMsg = "boOrganisation" > Case Vartype(thisform.boProductCodes,.t.) <> 'O' > lcErrorMsg = "boProductCodes" > Case Vartype(thisform.boUsers,.t.) <> 'O' > lcErrorMsg = "boUsers" > Otherwise > If ! Empty(lcErrorMsg) > Assert .f. Message 'There IS a bug in foxpro' > else > llOK = .t. > EndIf > EndCase > > If ! llOK > Assert .f. Message 'Unable to load business object '+ Chr(13) + > lcErrorMsg > Return .f. > EndIf > > -- > Michael Hawksworth > Visual Fox Solutions > > [EMAIL PROTECTED] > www.foxpro.co.uk _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** 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.

