Jump to content
Macro Express Forums

The array is too small - error


Recommended Posts

I made a copy of an existing macro that was working well.  I only need to make a small change; instead of searching for %T[2]% on line 18, I needed to search for %T[3].  When I made that change, Macro Express is giving me error "The array is too small "%T%", Line Number 18.  I am not sure what is causing it.  %T% was left alone, with a default of 99.  Any help will be greatly appreciated.

 

<COMMENT Value="Launchpad - Edit users.  Delete contents of CC: box as well."/>
<COMMENT Value="Searches for Recurring Schedule rather than Report"/>
<COMMENT Value="  "/>
<COMMENT Value="%T[1]% Users"/>
<COMMENT Value="%T[2]% Report"/>
<COMMENT Value="%T[3]% Schedule"/>
<COMMENT Value="  "/>
<COMMENT Value="%T[4]% Clipboard contents"/>
<COMMENT Value="%T[5]% Current Date Time"/>
<COMMENT Value="%T[6]% Write string to text file"/>
<COMMENT Value="  "/>
<COMMENT Value="Uses: h:\\rw3\\MacroExpress\\Records Skipped.txt\r\n"/>
<COMMENT Value="h:\\RW3\\MacroExpress\\Records Processed.txt\r\n"/>
<COMMENT Value="Turn on Keystroke Speed"/>
<KEYSTROKE SPEED Delay="45"/>
<CAPS LOCK Action="Off"/>
<DELAY Flags="\x01" Time="0.2"/>
<ASCII FILE BEGIN PROCESS Filename="H:\\A\\Search for Schedule 06-27-2019.csv" Format="CSV" Start_Record="2" Process_All="TRUE" Records="1" Variable="%T%" Start_Index="1" Parse_Blank_Lines="FALSE" Clear_Array="TRUE"/>
<COMMENT Value="F5 - Home screen"/>
<TEXT TYPE Action="0" Text="<F5>"/>
<DELAY Flags="\x01" Time="1"/>
<COMMENT Value="Wait for Pixel Color to turn gray"/>
<MOUSE MOVE Option="\x02" X="566" Y="172" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.2"/>
<REPEAT UNTIL Variable="%N[2]%" Condition="\x00" Value="14338236"/>
<GET PIXEL COLOR Option="\x00" Rel_To_Screen="TRUE" Destination="%N[2]%"/>
<END REPEAT/>
<COMMENT Value="Click Search - bottom left"/>
<MOUSE MOVE Option="\x02" X="58" Y="984" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.2"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.2"/>
<COMMENT Value="Search box"/>
<MOUSE MOVE Option="\x02" X="61" Y="299" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.2"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.2"/>
<COMMENT Value="Type Report Name"/>
<TEXT TYPE Action="0" Text="\"%T[3]%" _COMMENT="First double quote"/>
<WAIT FOR TEXT PLAYBACK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="\"" _COMMENT="Second double quote"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x01" Time="0.2"/>
<MOUSE MOVE Option="\x02" X="1114" Y="253" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.2"/>
<COMMENT Value="Wait for Pixel Color to turn blue"/>
<REPEAT UNTIL Variable="%N[2]%" Condition="\x00" Value="13395490"/>
<GET PIXEL COLOR Option="\x00" Rel_To_Screen="TRUE" Destination="%N[2]%"/>
<END REPEAT/>
<COMMENT Value="Was right report picked?"/>
<COMMENT Value="Properties"/>
<MOUSE RIGHT CLICK/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<ARROW DOWN>"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ARROW DOWN>"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x01" Time="0.5"/>
<COMMENT Value="Title"/>
<CLIPBOARD EMPTY/>
<DELAY Flags="\x01" Time="1"/>
<MOUSE MOVE Option="\x02" X="742" Y="250" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<CONTROL>a"/>
<DELAY Flags="\x01" Time="1"/>
<CLIPBOARD COPY/>
<DELAY Flags="\x01" Time="1"/>
<VARIABLE SET STRING Option="\x02" Destination="%T[4]%" NoEmbeddedVars="FALSE"/>
<COMMENT Value="If not the right report skip it"/>
<IF VARIABLE Variable="%T[2]%" Condition="\x01" Value="%T[4]%" IgnoreCase="FALSE"/>
<COMMENT Value="Skipped report Start"/>
<DATE/TIME Format="yyyy-mm-dd  hh:nn" Flags="\xB0" Date="2/8/2019 12:33:46 PM" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="0" Variable="%T[5]%" IsDateVar="FALSE"/>
<VARIABLE SET STRING Option="\x00" Destination="%T[6]%" Value="%T[5]%|%T[3]%|%T[1]%" NoEmbeddedVars="FALSE"/>
<DELAY Flags="\x01" Time="1"/>
<VARIABLE MODIFY STRING Option="\x12" Destination="%T[6]%" Filename="H:\\RW3\\MacroExpress\\Records Skipped.txt" Strip="TRUE" NoEmbeddedVars="FALSE"/>
<COMMENT Value="Skipped report End"/>
<GOTO Name="Skip" _COMMENT="Skip it"/>
<END IF/>
<COMMENT Value="Cancel"/>
<DELAY Flags="\x01" Time="0.2"/>
<MOUSE MOVE Option="\x02" X="1426" Y="914" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.5"/>
<COMMENT Value="History"/>
<MOUSE MOVE Option="\x02" X="742" Y="250" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE RIGHT CLICK/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<ARROW DOWN>"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<ARROW DOWN>"/>
<DELAY Flags="\x01" Time="0.2"/>
<TEXT TYPE Action="0" Text="<ARROW DOWN>"/>
<DELAY Flags="\x01" Time="0.2"/>
<TEXT TYPE Action="0" Text="<ARROW DOWN>"/>
<DELAY Flags="\x01" Time="0.2"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x01" Time="2"/>
<COMMENT Value="Wait for Pixel Color to turn gray"/>
<MOUSE MOVE Option="\x02" X="614" Y="269" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.2"/>
<REPEAT UNTIL Variable="%N[2]%" Condition="\x00" Value="15788516"/>
<GET PIXEL COLOR Option="\x00" Rel_To_Screen="TRUE" Destination="%N[2]%"/>
<END REPEAT/>
<COMMENT Value="Recurring status"/>
<MOUSE MOVE Option="\x02" X="658" Y="296" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE MOVE Option="\x02" X="477" Y="392" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<TAB>"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x01" Time="4"/>
<COMMENT Value="Filter Title"/>
<MOUSE MOVE Option="\x02" X="466" Y="298" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<TAB>"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="%T[3]%"/>
<WAIT FOR TEXT PLAYBACK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<TAB>"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x01" Time="2"/>
<COMMENT Value="Check to see if more than 1 schedule was found by clicking on the 2nd row"/>
<MOUSE MOVE Option="\x02" X="643" Y="342" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="1"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="1"/>
<GET PIXEL COLOR Option="\x00" Rel_To_Screen="TRUE" Destination="%N[2]%"/>
<DELAY Flags="\x01" Time="0.5"/>
<IF VARIABLE Variable="%N[2]%" Condition="\x00" Value="13395490" IgnoreCase="FALSE" _COMMENT="If there is more than 1 schedule with the same name"/>
<COMMENT Value="Skipped report Start"/>
<DATE/TIME Format="yyyy-mm-dd  hh:nn" Flags="\xB0" Date="2/8/2019 12:33:46 PM" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="0" Variable="%T[5]%" IsDateVar="FALSE"/>
<VARIABLE SET STRING Option="\x00" Destination="%T[6]%" Value="%T[5]% - %T[3]% Duplicate" NoEmbeddedVars="FALSE"/>
<DELAY Flags="\x01" Time="1"/>
<VARIABLE MODIFY STRING Option="\x12" Destination="%T[6]%" Filename="H:\\RW3\\MacroExpress\\Records Skipped.txt" Strip="TRUE" NoEmbeddedVars="FALSE"/>
<COMMENT Value="Skipped report End"/>
<GOTO Name="Skip" _COMMENT="Skip it"/>
<END IF/>
<COMMENT Value="Highlight 1st recurring schedule"/>
<MOUSE MOVE Option="\x02" X="636" Y="320" _PROMPT="0x000A"/>
<DELAY Flags="\x01" Time="1"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="2" _COMMENT="Wait for hovering window to go away"/>
<COMMENT Value="Wait for Pixel Color to turn blue"/>
<REPEAT UNTIL Variable="%N[2]%" Condition="\x00" Value="13395490"/>
<GET PIXEL COLOR Option="\x00" Rel_To_Screen="TRUE" Destination="%N[2]%"/>
<END REPEAT/>
<COMMENT Value="Edit Users"/>
<MOUSE RIGHT CLICK/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="<ARROW UP>"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Reschedule"/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="<ARROW DOWN>"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Replace"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<TAB>"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<TAB>"/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT TYPE Action="0" Text="<ARROW UP>" _COMMENT="Replace existing schedule"/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE MOVE Option="\x02" X="116" Y="430" _PROMPT="0x000A" _COMMENT="Destinations"/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="1"/>
<MOUSE MOVE Option="\x02" X="354" Y="379" _PROMPT="0x000A" _COMMENT="CC:"/>
<DELAY Flags="\x01" Time="1"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="<CONTROL>a"/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="<DELETE>"/>
<DELAY Flags="\x01" Time="1"/>
<MOUSE MOVE Option="\x02" X="355" Y="358" _PROMPT="0x000A" _COMMENT="To:"/>
<DELAY Flags="\x01" Time="1"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="<CONTROL>a"/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="<DELETE>"/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="%T[1]%"/>
<DELAY Flags="\x01" Time="1"/>
<COMMENT Value="Capture From:"/>
<MOUSE MOVE Option="\x02" X="528" Y="341" _PROMPT="0x000A" _COMMENT="From:"/>
<DELAY Flags="\x01" Time="1"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="<CONTROL>a"/>
<DELAY Flags="\x01" Time="1"/>
<CLIPBOARD COPY/>
<VARIABLE SET STRING Option="\x02" Destination="%T[7]%" NoEmbeddedVars="FALSE"/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE MOVE Option="\x02" X="532" Y="343" _PROMPT="0x000A" _COMMENT="Remove highlighting of From:"/>
<DELAY Flags="\x01" Time="1"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="1"/>
<MOUSE MOVE Option="\x02" X="1360" Y="901" _PROMPT="0x000A" _COMMENT="Schedule"/>
<DELAY Flags="\x01" Time="0.5"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.5"/>
<COMMENT Value="Processed report Start"/>
<DATE/TIME Format="yyyy-mm-dd  hh:nn" Flags="\xB0" Date="2/8/2019 12:33:46 PM" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="0" Variable="%T[5]%" IsDateVar="FALSE"/>
<VARIABLE SET STRING Option="\x00" Destination="%T[6]%" Value="%T[5]%|%T[3]%|%T[1]%|%T[7]%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x12" Destination="%T[6]%" Filename="H:\\RW3\\MacroExpress\\Records Processed.txt" Strip="TRUE" NoEmbeddedVars="FALSE"/>
<COMMENT Value="Processed report End"/>
<LABEL Name="Skip"/>
<VARIABLE SET STRING Option="\x01" Destination="%T[99]%" Prompt="Stop macro at the bottom" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0" _ENABLED="FALSE" _COMMENT="* * * * * * * * * * * * Prompt to pause macro * * * * * * * * * * * *"/>
<ASCII FILE END PROCESS/>
<COMMENT Value="Turn off Keystroke Speed"/>
<KEYSTROKE SPEED Delay="0"/>
<BEEP/>
<DELAY Flags="\x01" Time="0.5"/>
<BEEP/>
<DELAY Flags="\x01" Time="0.5"/>
<BEEP/>
<DELAY Flags="\x01" Time="0.5"/>
<TEXT BOX DISPLAY Title="End of Macro" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n{\\colortbl ;\\red0\\green0\\blue255;}\r\n\\viewkind4\\uc1\\pard\\cf1\\b\\f0\\fs16      \r\n\\par \r\n\\par                 \\fs24 End of Macro\\cf0\\b0\\f1\\fs16 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
 

Data:

 

SandersC1 Provider Suspensions for Chart Deficiency CVMM - Provider Suspensions for Chart Deficiency (Daily)
ChurchMA Provider Suspensions for Chart Deficiency SADV - Provider Suspensions for Chart Deficiency - Monthly
SusoefJS Provider Suspensions for Chart Deficiency SAMC - Provider Suspensions for Chart Deficiency (Daily)
guinnn Surgical Site Infections Extract for Midas (NHSN) EHAA - Surgical Site Infections Extract for Midas - Monthly
guinnn Surgical Site Infections Extract for Midas (NHSN) EHAA - Surgical Site Infections Extract for Midas - Weekly
navak Surgical Site Infections Extract for Midas (NHSN) EHEM - SSI Extract for Midas All Procedures - Monthly
CabanC Referral Log WBDE OCCHEALTH Referral Log - Incoming Department (Monthly)
BornstJX Distress Screening CPMC - Distress Screening - Monthly
christkd Appointments by Status and Visit Type EHHC Onc Appts by Status and Visit Type Monthly

 

 

Array is too small.jpg

Link to comment
Share on other sites

I don't know much about arrays, but I'm trying to recreate this...   Line 18 in your code refers to a comma-separated values (.csv) file.  I'm guessing that's what the bottom part of your post is(?)  If I paste it into a text editor though, it appears to be tab-delineated...  Maybe MacExPro treats those the same (I don't know?)  If not though, it could be that the entire csv file is treated as one value, since there are no commas...  Maybe? 

 

EDIT:  Actually I see that MacExPro has options for CSV or Tab-Delineated .TXT.  I tried both, putting your data on my desktop and pointing line 18 to the files.   There was no error message, but it didn't do anything else either...  At least nothing that I could see.     (FYI I was able to convert you data to CSV by pasting it into Excel, then doing Save As csv.)

Link to comment
Share on other sites

  • 3 months later...

I recommend one not use T variables. Make your own variables with useful names. The 4 basic variables are just to help people transition macros from older versions, 3, where one didn't have the ability to create named variables. And when you do, make sure to make it an array if an array is needed with the appropriate number of elements. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...