Stepping through an array

Dear Forum members,
Can anyone provide some guidance about how to step through and process data in an array file.  My outline LabVIEW program is to carry out the following steps:
(1)  Take the first 5 samples from the data file (which contains 1000 samples)
(2)  Process calculation
(3)  Take the next 5 samples and process calculation Step (2) until the last batch of samples is reached
I understand that I will need a loop (200 x 5 samples = 1000 samples analysed), but what I cannot get is how to programmatically step through the array rows, 5 at a time.  If anyone can help it would be appreciated.
Regards,
Solved!
Go to Solution.

Hi bunnykins,
Using the Array Subset vi, this becomes a fairly simple problem.
Just specify a start point and a length of data you want then you can pull a small array of data out of a large one.
I have attached an example for you to tweak to whatever you need.
Enjoy!
-Rob Afton
Electrical Engineering Intern
GHSP
Attachments:
Subarray Calculations.vi ‏12 KB

Similar Messages

  • Stepping through a poorly formatted xml file

    Hi, this forum worked a charm earlier so I'm hoping it will go 2 for 2.
    Through a httpservice I'm reading an XML file into a ArrayCollection. Because the XML is so poorly formatted I'm having to write some very sloppy code just to step through 20 results. I have no control over the XML.
    XML Example (can be anywhere from 0 to 20 results):
    <results>
        <game>
            <type>game</type>
            <id>321</id>
            <name>gamename</name>
            <image>i34d.png</image>
        </game>
        <character>
            <type>character</type>
            <id>1123</id>
            <name>john</name>
            <image>sds.png/image>
        </character>
        <game>
            <type>game</type>
            <id>432</id>
            <name>examplename</name>
            <image>g2dss.png</image>
        </game>
    </results>
    Each result can be one of 7 types (I've done only 2, game and character, in my example). The order of them I really want to preserve in my ArrayCollection as it's very relevant.
    Here is the (very) sloppy way I'm currently loading each result into my AC:
    //container array
    var ac2:ArrayCollection = new ArrayCollection;
    //I do a block like this for EVERY results type. Meaning 7 in total...
    if (service2.lastResult.response.results.character) {
         var characterAC:ArrayCollection = new ArrayCollection;
         if (service2.lastResult.response.results.character is ArrayCollection) {
         //there is more than 1 entry
         characterAC = service2.lastResult.response.results.character as ArrayCollection;
         } else {
              //There is only 1 entry. Need to MAKE it an ArrayColleciton
              characterAC = new ArrayCollection([service2.lastResult.response.results.character]);
            //Add all characters to AC
         ac2.addAll(characterAC);
    The two major problems with this code is: 1, it's stupidly bloated and 2, ac2 no longer maintains the order of the XML response. First it puts all <character> into my AC, then it puts all <game> into AC. So on and so forth.
    In my head I'm trying to do something like this:
    ac2 = service2.lastResult.response.results.* as ArrayCollection;
    That would then load all results (regardless of type) into an ArrayCollection. I'm guessing a solution is not that simple...
    In an Ideal world, whoever created the XML api would just call each result <result> instead of the stupid type tags it currently uses.
    I hope all that makes sense.
    Regards,
    Zaph.

    @Zaph31,
    Why not use an XMLListCollection instead of an ArrayCollection?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init();">
        <mx:XML id="iWouldntHaveCodedXMLLikeThat" xmlns="">
            <results>
                <game>
                    <type>game</type>
                    <id>321</id>
                    <name>gamename</name>
                    <image>i34d.png</image>
                </game>
                <character>
                    <type>character</type>
                    <id>1123</id>
                    <name>john</name>
                    <image>sds.png</image>
                </character>
                <game>
                    <type>game</type>
                    <id>432</id>
                    <name>examplename</name>
                    <image>g2dss.png</image>
                </game>
            </results>
        </mx:XML>
        <mx:XMLListCollection id="xmlListColl" />
        <mx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = iWouldntHaveCodedXMLLikeThat.children();
            ]]>
        </mx:Script>
        <mx:DataGrid id="dg" dataProvider="{xmlListColl}">
            <mx:columns>
                <mx:DataGridColumn dataField="type" />
                <mx:DataGridColumn dataField="id" />
                <mx:DataGridColumn dataField="name" />
                <mx:DataGridColumn dataField="image" />
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>
    Peter

  • Step through folder heirarchy to make all thumbnails

    New to Bridge but not [Apple]scripting. I see Bridge CS3 has almost no Applescript commands but all Javascript.
    My question is: Is it possible to tell Bridge to step through a big folder heirarchy and create thumbnails for all images?
    Any quick examples or reference appreciated.

    You can use two approaches -- you can use the ExtendScript Folder and File classes or the Bridge API's Thumbnail class.
    Download the Bridge SDK from www.adobe.com/devnet/bridge
    You'll find API documentation for the Folder and File objects in the JavaScript tools guild and of the Thumnail object in the Bridge CS3 JavaScript Reference (both in the SDK's docs folder).
    Please not that if you iterate over the files in a folder using the Thumbail object be sure to use this approach:
    var parent = new Thumbnail( new Folder("~/SomeImages") );
    var children = parent.children;
    for( var c = 0; c < children.length; ++c )
    //etc...
    And not...
    for( var c = 0; c < parent.children.length; ++c )
    // etc..
    The latter approach will be very slow and unreliable--each access to the Thumbnail.children property returns a new array of Thumbnails.
    -David Franzen
    Adobe Bridge Quality Engineer
    Adobe Systems, Inc.

  • Applescript no longer steps through iCal events in sequence

    Hi all,
    I have been using an Applescript that someone on this forum helped me write a few years ago to put unique combos of events into iCal and it has worked perfectly for me, although this year it has begun to jump around within iCal when it is adding events. In other words it used to step through the calendar and add events day by day, progressing chronologically. Now it still accomplishes the task but starts (currently) with May 1 of 2011 and moves to May 16th ... The fact that it still works is cool, but it has slowed the applescript down quite a lot.
    Here is a section of the script...thanks, dan
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into a HTML editor">
    repeat with theEvent in (events of calendar "School Calendar 10-11")
    if isitacycleday contains (summary of theEvent) then
    --Gets the current day and the cycle day number
    set cycleday to summary of theEvent
    set cycleDate to (start date of theEvent) + 1 * hours
    set cycleNumber to last character of cycleday as integer
    --There are always 7 periods in every day
    repeat with periodNumber from 1 to 6
    --Gets the subject from periodCycle
    set theSummary2 to item periodNumber of item cycleNumber of periodcycle2
    set theSummary to item periodNumber of item cycleNumber of periodCycle
    --Checks to see if there's a subject for this period, if not skips to next one
    if theSummary2 is not "" then
    set theStart to date (startTime of item periodNumber of periodTimes) of cycleDate
    set theEnd to date (endTime of item periodNumber of periodTimes) of cycleDate
    --Makes the event in the calender whose name is defined at the top of the script
    make new event at end of calendar TargetCalendar with properties {summary:theSummary, start date:theStart, end date:theEnd}
    end if
    end repeat
    end if
    end repeat </pre>

    Hi Bernard,
    right, I believe you were the one that came up with this script! It still does the trick, although it does begin adding new events at different times depending on when the cache was last deleted (i think). I've used the Onyx program to do this and indeed it influences the start date for the creation of new events via your script, so I don't think it has anything to do with the master calendar. Since I repeatedly run this script to make new events and then export the calendar, delete it, make a new untitled calendar and then run the script again... I've found that iCal and the applescript sloooow down over time and it is best to quit both, maybe even restart and then start the process again. Guess I might never figure this one out.
    Thanks for the help,
    dan

  • Code works fine when stepping through debug, but not without debug

    I have the following code that works fine when I step through with the debugger, but when I run it with out the debugger it never gets the objects in the "moveObjects" method. I would appreciate any help. Thank you
    import com.crystaldecisions.sdk.exception.SDKException;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.plugin.desktop.program.IProgramBase;
    import com.crystaldecisions.sdk.plugin.desktop.common.*;
    import com.crystaldecisions.sdk.framework.*; //cesession
    import com.crystaldecisions.sdk.plugin.desktop.program.*; //ceplugins
    import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
    import com.crystaldecisions.sdk.occa.infostore.*;
    import com.crystaldecisions.sdk.properties.IProperties;
    import com.crystaldecisions.sdk.plugin.destination.managed.*;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.sql.DriverManager;
    import java.sql.Connection;
    import java.util.*;
    import java.sql.ResultSet;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.DriverManager;
    * @author ag0310m
    public class MoveRptInstance implements IProgramBase {
        public void run(IEnterpriseSession enterpriseSession, IInfoStore iStore, java.lang.String[] args) {
            try {
                IInfoObjects objects = null;
                IInfoObjects objs = null;
                IProperties props = null;
                try {
                    getObjectsToSend(objects, iStore);
                    moveObjects(iStore);
                } catch (SDKException e) {
                    //ExamplesUtil.WriteError(request, response, e, "RETRIEVE_ERROR", errorpagerfile);
                    System.out.println(e.toString());
                    //out.clear();
                    return;
            } catch (Exception ex) {
                ex.printStackTrace();
        private void getObjectsToSend(IInfoObjects objects, IInfoStore iStore) throws SDKException {
                        objects = null;
                        objects = iStore.query("Select * from CI_INFOOBJECTS where si_name = 'ReportBurstingTest' and si_instance = 1 and si_recurring = 0");
                        try {
                              sendObjects(objects, iStore);
                         } catch (Exception e) {
                             System.out.println(e.getLocalizedMessage().toString());
                             e.printStackTrace();
                         } finally {
        private void moveObjects(IInfoStore iStore) throws SDKException {
                        IInfoObjects iObjects = null;
                        iObjects = iStore.query("Select * from CI_INFOOBJECTS where si_parentid = 716");
                            int x = iObjects.size();
                            System.out.println("value of x = "+x);
                            for (int ii = 0; ii < x; ii++) {
                                IInfoObject obj = (IInfoObject) iObjects.get(ii);
                                obj.setParentID(868003);
                           iStore.commit(iObjects);                   
        private void sendObjects(IInfoObjects oInfoObjects, IInfoStore infoStore) throws SDKException {
         //Grab the first object in the collection, this will be sent.
            int x = oInfoObjects.size();
            System.out.println("3");
            for (int i = 0; i < x; i++) {
                IInfoObject infoObject = (IInfoObject)oInfoObjects.get(i);
                ISendable obj = (ISendable)infoObject;
                IDestinationPlugin destinationPlugin = getDestinationPlugin(infoStore, infoObject.getKind(), infoObject.getTitle(), infoObject.getUpdateTimeStamp());
                IDestination destination = obj.getSendToDestination();     
                destination.setFromPlugin(destinationPlugin);
        //Send the InfoObjects.
        infoStore.sendTo(oInfoObjects);
        private IDestinationPlugin getDestinationPlugin(IInfoStore infoStore, String kind, String title, Date dte) throws SDKException {
         //Retrieve the Managed Destination plugin from the InfoStore
        //this should be cast as an IDestinationPlugin *DON'T FORGET THE get(0) AT THE END**
        IDestinationPlugin destinationPlugin = null;
        destinationPlugin = (IDestinationPlugin)infoStore.query("SELECT TOP 1 * " +                                                                               
    "FROM CI_SYSTEMOBJECTS " +
                                                                                    "WHERE SI_NAME='CrystalEnterprise.Managed'").get(0);
        //Retrieve the Scheduling Options.
        //This interface is the one which allows us to add the file location for the scheduling.
        IManagedOptions managedOptions = (IManagedOptions) destinationPlugin.getScheduleOptions();
        managedOptions.setDestinationOption(IManagedOptions.CeDestinationOption.ceInbox);
        managedOptions.setIncludeInstance(true);
        managedOptions.setTargetObjectName(title+" - "+dte.toString());
        managedOptions.setSendOption(IManagedOptions.CeManagedSendOption.ceCopy);
        //Set of users that will receive the instance. 
        Set userSet = managedOptions.getDestinations();
        //Query for the id of a particular user that will receive the instance.
        IInfoObjects users = null;
            users = infoStore.query("SELECT TOP 1 SI_ID " +
                                 "FROM CI_SYSTEMOBJECTS " +
                                 "WHERE SI_NAME='Administrator' AND SI_PROGID='CrystalEnterprise.User'");
            if (users.size() > 0) {
             IInfoObject user = (IInfoObject)users.get(0);     
             int id = user.getID();
             userSet.add(new Integer(id));
         return destinationPlugin;

    I'm assuming SI_ID=716 is the Inbox where you're sending the objects.
    The issue is that you're not clicking the "Step Over" button fast enough when debugging.  If you click really fast, then you'll get the same issue.
    Workaround for the non-debug case is to count the number of objects you're sending, then when moving, loop till the InfoStore query retrieves the correct number of objects.
    You're not giving enough time for the Destination Job Server to send the objects to the Inbox - they're not there yet.
    Sincerely,
    Ted Ueda
    Edit:  I see you've identified the issue as well - note that the CMS job scheduling thread triggering interval isn't under programmatic control, so I'd still recommend loop-count-wait workflow.
    Edited by: Ted Ueda on Oct 22, 2009 11:59 AM

  • Step Through a List of .p12 Certificates and Their Passwords to Extract Property Data

    This is a follow-up question to my previous thread:
    http://social.technet.microsoft.com/Forums/en-US/58ca3098-e06d-419a-9465-1ae7973e1c04/extract-p12-property-information-via-powershell?forum=ITCG
    I understand how to extract the information for a certificate one-by-one, but I am wanting to write a powershell script that will step through a list of certificates and a list of their corresponding network passwords in order to extract their property
    data (i.e. expiration date, etc). Any suggestions?
    jrv helped me with the first part of my question by providing this script:
    PS C:\> $filename='c:\temp2\certs\jpd.cer'
    PS C:\> $cert=[System.Security.Cryptography.X509Certificates.X509Certificate2]::CreateFromSignedFile($filename)
    PS C:\scripts> $cert|fl
    Happy Hunting!

    HINT:
    dir *.cer | %{ [System.Security.Cryptography.X509Certificates.X509Certificate2]::CreateFromSignedFile($_)}
    ¯\_(ツ)_/¯

  • Can you set a BREAKPOINT and step through it

    Hello all,
    How do set a breakpoint in the app so that one can step through it and no where it is failing and the value of the variables returned?
    Thanks

    If you are trying to debug server side PL/SQL program units, you could use DBMS_DEBUG.
    http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_debug.htm#996728

  • Looping through javabean array in jsp?

    Hello,
    In my servlet, I created an ArrayList of objects and pass these to a jsp page using:
    req.setAttribute("bean", uploadList);
    The ArrayList contains objects of the FileBean class, with a getIndex, and getDate methods.
    Could any possibly demonstrate how to loop through the ArrayList in the jsp and display the FileBean object values in a html table?
    To display the values of a javabean in jsp pages I normally have to use for example, requestScope.bean.getMethod();
    Thanks

    No, that would be requestScope.bean.attributename, if your getter method has the same name as the attribute you are getting.
    To loop through an array you have to use the c:forEach tag. Check google for "jstl foreach example", there are loads of examples.

  • Can I instruct the debugger to step through triggered events as well?

    I have the following statements in my code:
    Public Class Class1
    Public Shared Sub TestClass()
    Dim ExlApp As Excel.Application = CType(AddinModule.CurrentInstance, TimeTracker.AddinModule).ExcelApp
    ExlApp.Range("A1").Value = "Test"
    ExlApp.Range("A2").Value = "When I press F11 the debugger jumps to this row from test"
    End Sub
    End Class
    When I step through the debugger, it jumps directly from the first statement above to the second. But inbetween those rows some events are triggered. Is there any way to tell the debugger to not jump over these events but instead step into these events?

    Hi JP3O,
    Since it is related to the specific VB app, to really repro this issue, could you share me the sample?
    >>But inbetween those rows some events are triggered.
    Maybe you could add breakpoints in your events, and then debug your whole app with "Start debugging (F5)", and make sure that the code is really called (the breakpoints were hit)or it has been called before the code shared in your thread.
    Or it is related to the JIT:
    https://msdn.microsoft.com/en-US/library/7ad07721(v=vs.100).aspx 
    If the breakpoints in evens are not hit, please check whether you could get any message if you put the mouse on the breakpoints. Maybe it is related to the symbols loaded or others.
    If you get any latest information, please feel free to let me know.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Code works when I step through it, not when run real-time though.

    Hi,
    I have a bit of code, a trivial problem in fact, that has completely defeated me.
    private int recFibonacci(int N, long starTime) {
            long totalTime = System.currentTimeMillis() - starTime;
            if(N <= 0) return -3;  //negatives not allowed
            try {
                if (N < 2) {
                    return N;
                } else {
                    if (totalTime <= 1500) { //if it takes longer than 15 seconds, end.
                        N = recFibonacci(N - 2, starTime) + recFibonacci(N - 1, starTime);
                    } else {
                        return -1;//return if taking too long
            } catch (StackOverflowError ex) {
                return -2;//return if overflow
            return N;
    //This is the user accessible function for the recursive fibonacci method.
    //It calls the private fibonacci function and passes it a startTime value.
    //This is so that the startTime is only set at the user's call, not each time the
    //function recurses.
        public int recFibonacci(int N) {
            setTime();
            int retN = this.recFibonacci(N, getStartTime());
            if (retN == -1) {
                System.out.println("Calculation is is taking too long, try a non-recursive solution.");
                return -1;
            if (retN == -2) {
                System.out.println("Stack overflow, recursed too deeply.  Try a non-recursive solution, or a smaller number.");
                return -2;
            if (retN == -3){
                System.out.println("Fibonacci sequence is undefined for negative numbers.");
                return -3;
            return retN;
        }From the driver I call the single argument method.
    When I debug and step through the code it runs perfectly. If the number is large enough to take a little while to execute,i get the appropriate error message. Also, if the number causes a stack overflow, I get that message as well.
    When I run the code (realtime not stepping) I always get a strange return value if N is too large. Its always a different value, and I never receive the error code. I am at a complete loss to explain this discrepency.
    Any ideas?

    Seems to me your problem could be the same as this poster's:
    [Problem With Recursion|http://forum.java.sun.com/thread.jspa?threadID=5270481]
    db

  • Stepping through the code

    Using Eclipse, latest build, on a Mac, I'm stepping through the FlexPMD code.  I enter in the debug configuration the parameters "-s <src dir>" and "-o <output dir>".  Those arguments are successfully passed into FlexPMD but when the FileUtils tries to locate the Flex source files, I have some ActionScript, *.as, files in the <src dir>, I get an error:
    Exception in thread "main" net.sourceforge.pmd.PMDException: sourceDirectory does not contain any Flex sources (Specify the source directory in relative (not absolute))
        at com.adobe.ac.pmd.files.impl.FileUtils.getFlexFiles(FileUtils.java:107)
        at com.adobe.ac.pmd.files.impl.FileUtils.computeFilesList(FileUtils.java:52)
        at com.adobe.ac.pmd.FlexPmdViolations.computeFiles(FlexPmdViolations.java:128)
        at com.adobe.ac.pmd.FlexPmdViolations.computeViolations(FlexPmdViolations.java:92)
        at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.computeViolations(AbstractFlexPmdEngine.ja va:153)
        at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.executeReport(AbstractFlexPmdEngine.java:1 36)
        at com.adobe.ac.pmd.commandline.FlexPMD.startFlexPMD(FlexPMD.java:115)
        at com.adobe.ac.pmd.commandline.FlexPMD.main(FlexPMD.java:69)
    Since the 'args' parameter in the main function is getting the '-s' and '<src dir>' parameters, I'm not sure what is it complaining.  I don't see anything in the source code what those parameters are being discarded.
    Any ideas?
    Thanks
    Brenda

    Hi Brenda!
    I don't think I understood your problem.
    The error you mentioned means that the source folder you specified does not contain any Flex source files (*.as, *.mxml)
    Are you saying that you have a folder with Flex source files, and that those files are not picked up by FlexPMD?
    Any FlexPMD clients (command-line, Maven, Ant, ...) are using AbstractFlexPmdEngine which uses the class FlexPmdParameters
    I don't see any reasons why your source folder would be discarded.
    Best
    Xavier

  • Iterrate through an array of files

    I am having trouble with the following program, making to iterate through an array of three files, that
    are placed in a directory below the program directory. What I would like my program to do is to read 10 lines of each of the files in the subdirectory and then go back and read another 10 lines from the each files(remembering which file is which) and so on till all the files are read. The number of the files in the subdirectory can change, therefore nothing should be hardcoded!
    Here is the program so far:
    public class thekernel {
    public void thekernel() {}
    public void executeKernel() throws Exception {
    boolean read = false;
    String input_line = null;
    int quantum = 10;
    int programCounter = 0;
    String dirname = "processdir";
    File f1 = new File(dirname);
    if (f1.isDirectory()){
    String s[] = f1.list();
    for(int i = 0; i < s.length; i++) {
    System.out.println (s);
    while ( i < s.length ) {
    RandomAccessFile fr =
    new RandomAccessFile (("processdir/")+s[i], "r");
    while (((input_line=fr.readLine()) != null) &&
    ( programCounter < quantum )){
    System.out.println (input_line);
    programCounter++;
    i++;
    programCounter = 0;
    public static void main(String args[]) throws Exception {
    thekernel K = new thekernel();
    K.executeKernel();
    here is the output it produces at the moment:
    Process_1.txt
    1FORK 1F1
    FORK 2
    WAIT 4
    WAIT 2
    FORK 5
    FORK 6
    ABCD 7
    FORK 8
    FORK 9
    ABCD 10
    2FORK 1F2
    FORK 2
    ABCD 3
    WAIT 4
    FORK 5
    FORK 6
    ABCD 7
    FORK 8
    FORK 9
    ABCD 10
    3FORK 1F3
    FORK 2
    ABCD 3
    WAIT 1
    FORK 5
    FORK 6
    ABCD 7
    FORK 8
    FORK 9
    ABCD 10
    Any help much appreciated.........................

    You should create an collection of rafs, one for each file, then when you switch between files, the location will be intact.You still need to logic to determine when all of the files have been read. One idea could be to use a vector to hold the rafs, and remove each one as the the eof is reached. When the vector is empty, then all of the files will have been read.
    Something like:
    public void executeKernel() throws Exception {
        final int QUANTUM = 10;
        String dirname = "processdir";
        File f1 = new File(dirname);
        if (f1.isDirectory()){
            String s[] = f1.list();
        class Foo {
            public String name;
            public RandomAccessFile file;
            public Foo(String name, RandomAccessFile file) {
                this.name = name;
                this.file = file;
        Vector files = new Vector()
        for(int x = 0; x < s.length; x++)
            files.add(new Foo(s[x], new RandomAccessFile (("processdir/")+s[x], "r"))));
        String input_line = null;
        int programCounter = 0;
        while(files.size() > 0) {
            for(int i = 0; i < files.size(); i++) {
                System.out.println ( ((Foo)files.elementAt(i)).name );
                programCounter = 0;
                while (programCounter < quantum ) {
                    if( (input_line = ((Foo)files.elementAt(i)).file.readLine()) != null) {
                        System.out.println (input_line);
                        programCounter++;
                    else {
                        files.removeElementAt(i);
                        programCounter = quantum;

  • How to Step through Scripts that are sent to other Adobe Apps?

    A newbie question. In the ExtendScript Toolkit, I'm examining a script that uses BridgeTalk to send a script to Photoshop. I understand how to step through and examine the variables and functions that execute within the Bridge application. But how can I step through and examine the variables that are sent to the Photoshop application? The script executes without breaking as soon as the BridgeTalk script is sent.
    Thanks
    Help Getting Started with Bridge Scripting 

    I not sure that you can… What you may be able to do in some cases… is comment out the sending of the bridgetalk message and write the script constructed string message body to the toolkit console… That you might be able to cut and paste to a new script window and run with #target photoshop your other option would be to add lines $.writeln( variable ); at the relevant places in the message body construction…

  • Function to step through a View

    Hello All, I need to create a function that reads a view and exports the data into a fixed field formatted file. I believe I need to step through the view, and for each record, extract each field, rpad it to a specified length and concatenate the fields back together into a new record, perhaps dumping each new record into a temp table and once done, export the table into a file. Please let me know if this reasoning sounds logical and/or is the best approach. Thanks.

    If you want something a little more generic to take any query (whether from a view or regular tables), something along these lines will do...
    As sys user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /As myuser:
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;This allows for the header row and the data to be written to seperate files if required.
    e.g.
    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    PL/SQL procedure successfully completed.Output.txt file contains:
    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
    Adapt to output different datatypes and styles are required.

  • Step through code ....VB debugging

    Hi,
    What window can I use to watch the variables value as you step through the code?
    Fenix  

    Please move your post to VS forum for a better assistance on this, this forum is for VB code related issues only:
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=visualstudiogeneral
    Fouad Roumieh

Maybe you are looking for