Sign in to follow this  
Followers 0
Yury

ERRORS from OSX Objects

6 posts in this topic

Good Day, Please Help !

1. I have Code:

$MSCommObj = ObjCreate("MSCOMMLib.MSComm")

$MSCommObj.CommPort = 3

$MSCommObj.PortOpen = True

MsgBox(0, "", "PortOpen !")

2. CommPort 3 is busy different device

3. I Run My Code

4. I have Error in SciTE:

E:\AutoIt\MyScripts.au3 (3) : ==> The requested action with this object has failed.:

$MSCommObj.PortOpen = True

$MSCommObj.PortOpen = True^ ERROR

->17:24:41 AutoIT3.exe ended.rc:1

>Exit code: 1 Time: 3.089

How work with ERRORS from OSX Objects and Continue run my Code ?

And I don't want to use File in VbScript with "On Error Resume Next ..."

:)My email

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Good Day, Please Help !

1. I have Code:

$MSCommObj = ObjCreate("MSCOMMLib.MSComm")

$MSCommObj.CommPort = 3

$MSCommObj.PortOpen = True

MsgBox(0, "", "PortOpen !")

2. CommPort 3 is busy different device

3. I Run My Code

4. I have Error in SciTE:

E:\AutoIt\MyScripts.au3 (3) : ==> The requested action with this object has failed.:

$MSCommObj.PortOpen = True

$MSCommObj.PortOpen = True^ ERROR

->17:24:41 AutoIT3.exe ended.rc:1

>Exit code: 1 Time: 3.089

How work with ERRORS from OSX Objects and Continue run my Code ?

And I don't want to use File in VbScript with "On Error Resume Next ..."

:)My email

Include a COM error handler per the help file under COM/OBJ Reference. You might also verify your initial obj creation worked:
$MSCommObj = ObjCreate("MSCOMMLib.MSComm")
If IsObj($MSCommObj) Then 
    ConsoleWrite("Debug: Created obj $MSCommObj: " & ObjName($MSCommObj) & @LF)
Else
    MsgBox(16, "Error", "Failed to create $MSCommObj from MSCOMMLib.MSComm.")
    Exit
EndIf

:(

Edit: Typo

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Include a COM error handler per the help file under COM/OBJ Reference. You might also verify your initial obj creation worked:

$MSCommObj = ObjCreate("MSCOMMLib.MSComm")
If IsObj($MSCommObj) Then 
    ConsoleWrite("Debug: Created obj $MSCommObj: " & ObjName($MSCommObj) & @LF)
Else
    MsgBox(16, "Error", "Failed to create $MSCommObj from MSCOMMLib.MSComm.")
    Exit
EndIf

:)

Edit: Typo

Thank you very mach for Help !

But I d'not andestand: "Include a COM error handler per the help file under COM/OBJ Reference." What is this ?

May I give Code Error for:

$MSCommObj.CommPort = 3
when CommPort 3 is busy different device ?

And If I Make rather like situation:

Run("File.exe")
when "File.exe" not exist

How I can Give Code and Description of ERRROR ?

Share this post


Link to post
Share on other sites

But I d'not andestand: "Include a COM error handler per the help file under COM/OBJ Reference." What is this ?

In the directory where AutoIt is installed, there is an AutoIt3.chm file. That is the help file. Open it and read the section under AutoIt, Function Reference, Obj\COM Reference. In the lower half of that section is a part labeled "COM error handling" that includes examples.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

In the directory where AutoIt is installed, there is an AutoIt3.chm file. That is the help file. Open it and read the section under AutoIt, Function Reference, Obj\COM Reference. In the lower half of that section is a part labeled "COM error handling" that includes examples.

:)

Thank you very mach for your Help !

I used Rissian Help File, which don't had this information!

Now I solve this Problem!

Share this post


Link to post
Share on other sites

Thank you very mach for your Help !

I used Rissian Help File, which don't had this information!

Now I solve this Problem!

You might consider working on updating it to 3.2.12.0.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0