Contributions
Re: How to quit from a paticular script
Exit function only exits from that particular function and it returns back to the subroutine a and will execute next instruction in the sub routine. I do not want to return to the sub routine. It should display the message Fail and should stop execution of sub routine a without returning to itand then should move on to execute sub routine b. Thats what my requirement is. How can we do this?1.3KViews0likes0CommentsHow to quit from a paticular script
Hi, function x(a) If a = 2 then msgbox "Hi" else nsgbox "Fail" wscript.quit'This is throwing error as wscript object is required end if end function Sub a call x(1) msgbox "Pass" end sub sub b call x(2) msgbox "Pass" end sub SubMain calla call b End Sub In the above sample example, sub routine a fails. so it should throw a message Fail and stop executing that particular sub routine. It should then execute sub routine b. Using wscript.quit is throwing error that wscript object is required. Can anyone tell me how to use wscript.quit?17KViews0likes3CommentsGoto in VBScript
Hi, I want following kind of code in VBScript: Function ClickControl(Object,Label) If Object.Exists Then Object.Click() Else Goto Label End If End Function Sub T1 XXX = NameMapping.Sys.Process("XXX") Call ClickControl(XXX,L1) L1: End Sub Sub T2 YYY = NameMapping.Sys.Process("YYY") Call ClickControl(YYY,L2) L2: End Sub I know we can return values from function and can use If conditions. But this won't help me as there are many click operations in one sub routine andusing If conditions that many times will be very tidious and script wont look neat. Can't I use Goto like above in VBScript?Solved114KViews0likes3CommentsHow to post object name in log messages
Hi, I have written ascript as follows: Function clickcontrol(Object) If Object.exists then Object.Click Else Log.Message( Object & " is not found")'This is actually not working when object does not exist End If End function Sub abc() XXX = NameMapping.Sys.Process("XXX") Callclickcontrol(XXX) End Sub My Req is: If object XXX does not exist, then I should get a log message 'XXX is not found'. Using Log.Message( Object & " is not found")throws error as object itself doesnot exist. Is there anyway to display object custom namewhen it doesn't exist?25KViews0likes1CommentHow to handle third party controls
Hi, I have a grid control which is a third party control. This grid has rows and columns. In one of the column, third party check boxes are present. Test Complete recognizes only the grid not the rows or columns. So I have tried to use following property to tick the checkbox: Object.Columns.Item(0).Value = 1 My Req is on checking the checkbox, I should get a warning message. As I'm changing the property value this warning msg is getting bypassed and the checkbox is ticked with abrupt halting of application. There is no other property to tick the checkbox. Can anyone help me how to handle third party controls i.e., is there any way to make TestComplete recognize these objects?17KViews0likes1CommentRe: How to minimize a userform?
Hi Jared, I want the main userform to have minimize button in the header. Using show method, it is displaying the userform for a second and then closing it. I have written the code as follows: Sub Main() UserForm.TestForm.Show End Sub Sub TestForm_cxButton1_OnClick() Action1 - - UserForm.TestForm.Visibile = False End Sub Now, how can I make TestForm visible till cxButton1 is clicked?1.9KViews0likes0Comments