Topic
  • 1 reply
  • Latest Post - ‏2012-05-07T17:59:58Z by tmparker
SystemAdmin
SystemAdmin
1192 Posts

Pinned topic Extract the content of a screen problem

‏2012-05-06T16:34:23Z |
Hi

i'm tryng to debug a macro for display the content of a specific position of a screen; following the link http://www-01.ibm.com/software/webservers/hats/library/infocenter/productdir/dgmacsyn.htm#uselogic i copied in my source macro the following source:

<extract name="Get Data" srow="1" scol="1" erow="11" ecol="11"
assigntovar=$data_var$ />

but i receice the error :
An apex of opening is needed for the attribute "assigntovar" in partnership to a type of element "extract."

can someone post an example ho to extract in a variable a region of the screen and then display it in the console ??

Thanks in advance
Updated on 2012-05-07T17:59:58Z at 2012-05-07T17:59:58Z by tmparker
  • tmparker
    tmparker
    518 Posts

    Re: Extract the content of a screen problem

    ‏2012-05-07T17:59:58Z  
    Hi,

    Are you trying to debug this macro and display the contents of the macro variable in the studio or when you are running this on a server? Depending on where you are running the macro will determine where the output is shown. You can use a trace action to display the contents of the variable. For example, here is an extract I did and the trace action I used to print out the contents:
    
    <actions> <extract assigntovar=
    "$extractData$" continuous=
    "false" ecol=
    "28" erow=
    "15" name=
    "'extract1'" planetype=
    "TEXT_PLANE" scol=
    "11" srow=
    "15" unwrap=
    "false"/> <trace type=
    "SYSOUT" value=
    "'extracted data= '+$extractData$" /> </actions>
    


    Now, if you are running this on the server the trace action should display the contents of the macro variable in the console.

    If you are running the macro in the studio and want to see the output of the trace action, you will need to use the studio console. There is no way to view this in the studio itself so you need to modify the eclipse.ini file for the studio to add a command to display the console. To turn on the console you need to add the following parameter to the eclipse.ini file:

    -consoleLog

    If you are using RAD 8 this would look something like this:
    -vm
    jdk/jre/bin/j9vm/jvm.dll
    -consoleLog
    -startup
    ...

    However, if you are using RAD 7.5, I don't think they used jvm.dll so you may have to make another small change. If you see that it is using javaw.exe instead then you will need to change that to java.exe to make the console work. It would look something like this:
    -vm
    C:\Program Files (x86)\IBM\SDP80\jdk\jre\bin\java.exe
    -consoleLog
    -startup
    ...

    After you do this you should see a DOS command prompt window open and it will show you the internal logging for the studio. When I run my macro with the code above I see the following output:


    I hope this helps you understand the tracing.

    Thanks
    Tim