Finding That Line Of Code

Here’s the problem.  I have a line of code that I want to locate containing the words:

                             open-quote      files were not found

magnifying_glass_laptop_17652If you put all of your JSL code into a single file, then you can just use the script editor search (CTRL+F) to find specific elements of your code.  But I like to split my code by organisation units, each in their own include file.  Here is an example of what my script might look like before I start executing the Main block of code:

In this example I have about a dozen individual JSL files.  If I want to locate a segment of code then usually I know where to look because of the logical organisation of the files.  But not always.  There may be an error message that I want to look for, or a particular variable.

So I have written a script that will allow me to search all of my JSL files within a specific folder:

preview scripts
From here I just specify what I am looking for:

preview scripts2

Now it’s easy.  I can open the file (there is even an open button!) and search (CTRL+F) for the specific text.

Here’s the code to perform the script preview:

4 thoughts on “Finding That Line Of Code”

  1. This is a handy tool, especially for anyone who is writing any sort of nontrivial scripts.

    Another way to approach this problem that might be useful would be a tool that “expands” the includes — so when you run the tool, a new script window shows up that has the original script except that all the includes have been replaced by the included files. You’d just want to make sure that none of the script(s) get evaluated when you’re putting the overall script into a new script window.

    1. Thanks for your comments Michael. I agree there are times where it would be useful to perform a one-click operation to consolidate all of the code into a single file.

  2. I have a code developed with sql and tranferred into jsl. I am trying to set up a text input box, that runs the code for a specifc lot number. I got the following code online that creates a text box. Any help with getting this code to run the specific line in my code that calls for lot number?

    CODE FROM JMP
    Names Default To Here( 1 );
    dt = Current Data Table();

    nw = New Window( “Input”,
    H List Box( Text Box( “Input Lot number ” ), binnum = Text Edit Box() ),
    Button Box( “OK”,
    theLotNumber = lotnum << get text;
    dt << select where( dt:LOT_NO == theLotNumber );
    dtSubset = dt << subset( selected columns( 0 ), selected rows( 1 ) );
    nw << close window;
    )
    );

    CODE I OULD LIKE TO UPDATE
    SELECT DISTINCT serial [Serial],
    ser2.lot [Wafer Lot],
    ser.lot [Parent Diode Lot],
    RLTM.FromLot [Child Diode Lot],
    ser.item [Diode PN],
    RLTM.Lot [DA Lot],
    jb.item [DA PN]

    FROM dbo.SOL_RunLotTran_mst AS RLTM
    INNER JOIN dbo.SOL_RunLotTranDetail_mst AS RLTDM
    ON RLTDM.RefRowPointer = RLTM.RowPointer
    INNER JOIN serial_mst ser
    ON ser.Uf_IssuedLot = RLTM.FromLot
    INNER JOIN serial_mst ser2
    ON ser2.Uf_IssuedLot = ser.lot
    INNER JOIN job_mst jb
    ON jb.job = RLTM.Job
    INNER JOIN item_mst it
    ON it.item = jb.item

    WHERE RLTM.FromLot IS NOT NULL
    –AND product_code LIKE '%DIO%'
    AND ser.lot = 'LOTNUMBER' — Enter Parent lot number
    –AND RLTM.Fromlot = '439731' — Enter lot number
    –AND RLTM.Lot = '439660' — Enter Diode Assembly lot number
    –AND ser2.lot='84962-07'

    ORDER BY
    RLTDM.serial,RLTM.Lot";

    DataTableName = "Parent_Child";

    dtMoves = Open Database(ConnectionString, SQL_QUERY, DataTableName);

Leave a Reply

Your email address will not be published. Required fields are marked *