Sign in to follow this  
Followers 0
RAMzor

VB Obj to AutoIt Obj

5 posts in this topic

I have problems to convert some piece of VB code to AutoIt

How to convert this lines :

On Error GoTo GetMemoryUnblockedFailed

Set progress = new ADspProgress

memory_type.GetMemoryUnblocked &h30000, 10000, 1, progress

...

...

GetMemoryUnblockedFailed:

app.PrintText tabConsole, "GetMemoryUnblocked failed"

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Here is a example code from VisualDSP++ 4.5 help file (automation API chapter)

VisualDSPAutomation.zip

Text from help:

ADspProgress Object

This object is used to get the progress or status of an unblocked operation like a memory get, memory set, or program load. It can also be used to cancel the operation.

Example:

The following example demonstrates starting the memory read.

Visual Basic:

Dim app As Application

Dim session As ADspDebugSession

Dim processor As ADspProcessor

Dim memory_type_list As ADspMemoryTypeList

Dim memory_type As ADspMemoryType

Dim progress As ADspProgress

Set app = CreateObject( "VisualDSP.ADspApplication" )

Set session = app.ActiveSession

Set processor = session.ProcessorList( 0 )

Set memory_type_list = processor.MemoryTypeList

On Error GoTo GetItemFailed

Set memory_type = memory_type_list( "Data(DM) Memory" )

On Error GoTo GetMemoryUnblockedFailed

Set progress = new ADspProgress

memory_type.GetMemoryUnblocked &h30000, 10000, 1, progress

Exit Sub

GetItemFailed:

app.PrintText tabConsole, "Processor doesn't have memory named ""Data(DM) Memory""

Exit Sub

GetMemoryUnblockedFailed:

app.PrintText tabConsole, "GetMemoryUnblocked failed"

-----------------------------------------------------------------------

Properties:

PercentComplete

Methods

Cancel

Events

OnCanceled

onerror

OnGetMemoryCompleted

onprogress

OnSetMemoryCompleted

-----------------------------------------------------------------------

I don't anderstand RED lines - what is AutoIt eqvivalent ?

Edited by RAMzor

Share this post


Link to post
Share on other sites

Will no one knows? :P

Share this post


Link to post
Share on other sites

@RAMzor

Something like this will do it.

If @Error then  GetMemoryUnblockedFailed ()
EndIf

$progress = ObjCreate("ADspProgress")
$memory_type.GetMemoryUnblocked (0x30000, 10000, 1, $progress)

Func GetMemoryUnblockedFailed()
    ConsoleWrite("GetMemoryUnblocked failed" & @CRLF)
EndFunc

regards

ptrex

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