Jump to content
Macro Express Forums

kris.p.brown

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by kris.p.brown

  1. Hi Rberq,

    Thanks again for your help.  Sorry I got pulled onto another project that needed a fire put out.  Now, I am back to this issue and need to figure it out worse than ever.  I tried your latest code with no luck.  I seem to get to line 20 and it goes haywire.  The line is: If variable %T[1]% Does Not Equal %T[99]%.  I'm not real clear what this piece of code is trying to do honestly.  Everything works good until this step.  At this point I need it to evaluate T[1] and if the next row is the same mnemonic, I need it to repeat T[2] & T[3].  If the next row of T[1] is not the same mnemonic then I need it to file [F12] and start over again with the new T[1] mnemonic.  I feel like a small piece is still missing, but I am not really sure. 

    Here is the latest code:

    <VARIABLE SET INTEGER Option="\x00" Destination="%N[99]%" Value="1" _COMMENT="first-time-through switch"/>
    <VARIABLE SET STRING Option="\x00" Destination="%T[99]%" NoEmbeddedVars="FALSE" _COMMENT="clear save area for last-processed-record's mnemonic"/>
    <ASCII FILE BEGIN PROCESS Filename="C:\\Users\\kpb44\\Dropbox\\Hospitals\\Lawrence\\IF Statement TEst_3.csv" Format="CSV" Start_Record="1" Process_All="TRUE" Variable="%T%" Start_Index="1" Parse_Blank_Lines="FALSE" Clear_Array="TRUE"/>
    <IF VARIABLE Variable="%N[99]%" Condition="\x00" Value="1" IgnoreCase="FALSE" _COMMENT="First time through, save mnemonic of first record"/>
    <VARIABLE MODIFY STRING Option="\x00" Destination="%T[1]%"/>
    <VARIABLE MODIFY STRING Option="\x08" Destination="%T[99]%" Variable="%T[1]%" NoEmbeddedVars="FALSE" _COMMENT="save mnemonic"/>
    <TEXT TYPE Action="0" Text="%T[1]%<ENTER>" _COMMENT="Get screen for first mnemonic"/>
    <END IF/>
    <TEXT TYPE Action="0" Text="<F8>E<TAB>" _COMMENT="Enter Edit Tab"/>
    <COMMENT Value="Type in details for current mnemonic"/>
    <TEXT TYPE Action="0" Text="%T[2]%<ENTER>" _COMMENT="Line#\r\n"/>
    <TEXT TYPE Action="0" Text="%T[3]%<ENTER>" _COMMENT="Item Number\r\n"/>
    <TEXT TYPE Action="0" Text="<ENTER><ENTER><ENTER><ENTER><ENTER><ENTER><ENTER>"/>
    <IF VARIABLE Variable="%T[1]%" Condition="\x01" Value="%T[99]%" IgnoreCase="FALSE" _COMMENT="Still working on the same mnemonic?"/>
    <TEXT TYPE Action="0" Text="<F12>" _COMMENT="close out previous mnemonic"/>
    <END IF/>
    <VARIABLE SET INTEGER Option="\x00" Destination="%N[99]%" Value="0" _COMMENT="clear first-time-through switch"/>
    <VARIABLE MODIFY STRING Option="\x08" Destination="%T[99]%" Variable="%T[1]%" NoEmbeddedVars="FALSE" _COMMENT="save mnemonic"/>
    <ASCII FILE END PROCESS/>
    <TEXT TYPE Action="0" Text="<F12>" _ENABLED="FALSE" _COMMENT="close out previous (last) mnemonic"/>
    <MACRO RETURN/>
    <COMMENT Value="  "/>
    <COMMENT Value="  "/>
    <COMMENT Value="  "/>
     

  2. I understand.  I appreciate the effort.  I chose process 1 record because I thought that is what your script said.  I have fixed that issue.  I also moved the END IF up three lines and now I am getting T[2] & T[3] after every T[1].  How do I get T[1] not to repeat until after all the lines corresponding T[2] & T[3] have been entered? 

    This is what it is doing now:

    ALS BLS ALIMED

     1
    0007806

    ALS BLS ALIMED- (This should be ALS BLS ARMSTRNG)
    1
    0002796

    ALS BLS ARMSTRG
    2
    0002797

    ALS BLS ARMSTRG (This should be ALS BLS BTBULBS)
    1
    0010695

    ALS BLS BTBULBS
    2
    0010696

     

     

    What I want it to do is:

    ALS BLS ALIMED

    1
    0007806

    ALS BLS ARMSTRNG
    1
    0002796
    2
    0002797

    ALS BLS BTBULBS
    1
    0010695
    2
    0010696

     

    Here is the data:

    T[1] T[2] T[3]
    ALS BLS ALIMED 1 0007806
    ALS BLS ARMSTRG 1 0002796
    ALS BLS ARMSTRG 2 0002797
    ALS BLS BTBULBS 1 0010695
    ALS BLS BTBULBS 2 0010696
    ALS BLS BTBULBS 3 0010697
    ALS BLS BTBULBS 4 0010698
    ALS BLS BTBULBS 5 0010699
    ALS BLS BNDTREE 1 0001717
    ALS BLS BNDTREE 2 0002702
    ALS BLS BNDTREE 3 0002703
    ALS BLS BNDTREE 4 0002786
    ALS BLS BNDTREE 5 0002787
    ALS BLS BNDTREE 6 0002800
    ALS BLS BNDTREE 7 0002801
    ALS BLS BNDTREE 8 0002949
    ALS BLS BNDTREE 9 0003967
    ALS BLS BNDTREE 10 0007756
    ALS BLS BNDTREE 11 0007758
    ALS BLS BNDTREE 12 0007759
    ALS BLS BNDTREE 13 0007761
    ALS BLS BNDTREE 14 0007780
    ALS BLS BNDTREE 15 0007852
    ALS BLS BNDTREE 16 0007886
    ALS BLS BNDTREE 17 0007887
    ALS BLS BNDTREE 18 0008516
    ALS BLS BNDTREE 19 0008630
    ALS BLS BNDTREE 20 0008671

     

    Here is the latest code:

    <VARIABLE SET INTEGER Option="\x00" Destination="%N[99]%" Value="1" _COMMENT="First Time Through Switch"/>
    <VARIABLE SET STRING Option="\x00" Destination="%T[99]%" NoEmbeddedVars="FALSE" _COMMENT="clear save area for last-processed-record's mnemonic"/>
    <ASCII FILE BEGIN PROCESS Filename="C:\\Users\\kpb44\\Dropbox\\Hospitals\\Lawrence\\IF Statement TEst_2.csv" Format="CSV" Start_Record="1" Process_All="TRUE" Variable="%T%" Start_Index="1" Parse_Blank_Lines="FALSE" Clear_Array="FALSE"/>
    <IF VARIABLE Variable="%N[99]%" Condition="\x00" Value="1" IgnoreCase="FALSE" _COMMENT="First time through, save mnemonic of first record"/>
    <VARIABLE MODIFY STRING Option="\x08" Destination="%T[99]%" Variable="%T[1]%" NoEmbeddedVars="FALSE" _COMMENT="Save Mnemonic"/>
    <TEXT TYPE Action="0" Text="%T[1]%<ENTER>" _COMMENT="Get Screen for Mnemonic"/>
    <TEXT TYPE Action="0" Text="<F8>E<TAB>" _COMMENT="Enter Edit Screen"/>
    <END IF/>
    <TEXT TYPE Action="0" Text="%T[2]%<ENTER>" _COMMENT="Line#r n"/>
    <TEXT TYPE Action="0" Text="%T[3]%<ENTER>" _COMMENT="Item Number"/>
    <TEXT TYPE Action="0" Text="<ENTER><ENTER><ENTER><ENTER><ENTER><ENTER><ENTER>"/>
    <IF VARIABLE Variable="%T[1]%" Condition="\x01" Value="%T[99]%" IgnoreCase="FALSE" _COMMENT="Still working on same mnemonic?"/>
    <TEXT TYPE Action="0" Text="<F12>" _COMMENT="Close out previous mnemonic"/>
    <END IF/>
    <COMMENT Value="Type in details for current mnemonic"/>
    <VARIABLE SET INTEGER Option="\x00" Destination="%N[99]%" Value="0" _COMMENT="Clear first time through switch"/>
    <VARIABLE MODIFY STRING Option="\x08" Destination="%T[99]%" Variable="%T[1]%" NoEmbeddedVars="FALSE" _COMMENT="Save Mnemonic"/>
    <WINDOW ACTIVATE Title="Variable TEst - Notepad" Exact_Match="FALSE" Wildcards="FALSE"/>
    <TEXT TYPE Action="0" Text="%T[1]%<ENTER>" _COMMENT="Get screen for next mnemonic"/>
    <ASCII FILE END PROCESS/>
    <TEXT TYPE Action="0" Text="<F12>" _COMMENT="Close Previous Mnemonic"/>
     

    Thanks again

  3. Thanks rberq.  I still don't seem to be passing the value of the second row from my ASCII file.  Do I need to increment N?  I had to rearrange your suggestion a bit to get the data to input correctly.  However, when the script gets to the bottom and files the data, it starts over at line one again.  Any other suggestions?  I've deleted my delays to save space in the post.


    <VARIABLE SET INTEGER Option="\x00" Destination="%N[99]%" Value="1" _COMMENT="First Time Through Switch"/>
    <VARIABLE SET STRING Option="\x00" Destination="%T[99]%" NoEmbeddedVars="FALSE" _COMMENT="clear save area for last-processed-record's mnemonic"/>
    <ASCII FILE BEGIN PROCESS Filename="C:\\File   IF Statement TEst_2.csv" Format="CSV" Start_Record="1" Process_All="FALSE" Records="1" Variable="%T%" Start_Index="1" Parse_Blank_Lines="FALSE" Clear_Array="FALSE"/>
    <IF VARIABLE Variable="%N[99]%" Condition="\x00" Value="1" IgnoreCase="FALSE" _COMMENT="First time through, save mnemonic of first record"/>
    <VARIABLE MODIFY STRING Option="\x08" Destination="%T[99]%" Variable="%T[1]%" NoEmbeddedVars="FALSE" _COMMENT="Save Mnemonic"/>
    <TEXT TYPE Action="0" Text="%T[1]%<ENTER>" _COMMENT="Get Screen for Mnemonic"/>
    <TEXT TYPE Action="0" Text="<F8>E<TAB>" _COMMENT="Enter Edit Screen"/>
    <TEXT TYPE Action="0" Text="%T[2]%<ENTER>" _COMMENT="Line#r n"/>
    <TEXT TYPE Action="0" Text="%T[3]%<ENTER>" _COMMENT="Item Number"/>
    <TEXT TYPE Action="0" Text="<ENTER><ENTER><ENTER><ENTER><ENTER><ENTER><ENTER>"/>
    <END IF/>
    <IF VARIABLE Variable="%T[1]%" Condition="\x01" Value="%T[99]%" IgnoreCase="FALSE" _COMMENT="Still working on same mnemonic?"/>
    <TEXT TYPE Action="0" Text="<F12>" _COMMENT="Close out previous mnemonic"/>
    <END IF/>
    <COMMENT Value="Type in details for current mnemonic"/>
    <VARIABLE SET INTEGER Option="\x00" Destination="%N[99]%" Value="0" _COMMENT="Clear first time through switch"/>
    <VARIABLE MODIFY STRING Option="\x08" Destination="%T[99]%" Variable="%T[1]%" NoEmbeddedVars="FALSE" _COMMENT="Save Mnemonic"/>
    <TEXT TYPE Action="0" Text="%T[1]%<ENTER>" _COMMENT="Get screen for next mnemonic"/>
    <ASCII FILE END PROCESS/>
    <TEXT TYPE Action="0" Text="<F12>" _ENABLED="FALSE" _COMMENT="Close Previous Mnemonic"/>

     

  4. Hello,

    I am trying to get a loop to work inside a loop.  I can't seem to get the script to do what I want.  Basically, I don't need to reenter the first column until all the lines for that mnemonic have been entered.  I then need to file that entry and move to the next mnemonic to input all it's corresponding lines.  I'm pretty close, but no matter what I do I end up getting caught in the lines usually.  Can anyone provide a suggestion for me?

    Thanks in advance.

    image.png.7ba9bccb96552f60d51e80f04d61fc17.png

     

    <ASCII FILE BEGIN PROCESS Filename

    Variable="%T%" Start_Index="1" Parse_Blank_Lines="FALSE" Clear_Array="FALSE"/>
    <TEXT TYPE Action="0" Text="%T[1]%<ENTER>" _COMMENT="Mnemonic"/>
    <TEXT TYPE Action="0" Text="<F8>E<TAB>" _COMMENT="Enter Edit Tab"/>
    <VARIABLE SET INTEGER Option="\x00" Destination="%N[1]%" Value="0"/>
    <REPEAT UNTIL Variable="%T[1]%" Condition="\x00" Value="0"/>
    <TEXT TYPE Action="0" Text="%T[2]%<ENTER>" _COMMENT="Line#\r\n"/>
    <TEXT TYPE Action="0" Text="%T[3]%<ENTER>" _COMMENT="Item Number\r\n"/>
    <TEXT TYPE Action="0" Text="<ENTER><ENTER><ENTER><ENTER><ENTER><ENTER><ENTER>"/>
    <VARIABLE MODIFY INTEGER Option="\x07" Destination="%N[1]%"/>
    <END REPEAT/>
    <TEXT TYPE Action="0" Text="<F12>"/>
    <ASCII FILE END PROCESS/>

     

×
×
  • Create New...