mbkowns Posted April 29, 2008 Share Posted April 29, 2008 What does this mean when I get this error? I run it in autoit and it works but gives the error in the console. I run it compiled it works but gives the -1 error at the end. Array variable has incorrect number of subscripts or subscript dimension range exceeded.: Link to comment Share on other sites More sharing options...
nobbe Posted April 29, 2008 Share Posted April 29, 2008 hi then the array is setup wrong probably you try to access element eg. 20 where the array is setup to hold space for only 19 elements (for example) Link to comment Share on other sites More sharing options...
mbkowns Posted April 30, 2008 Author Share Posted April 30, 2008 Func _EMAILCONTACTWO() ;==>_Send Emails with WO and USER NAME // Manually hit send for each global $Address $EMAILBODY = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILBODY", "INI FILE MISSING EMAILBODY") $EMAILSIGLN1 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN1", "INI FILE MISSING EMAILSIGLN1") $EMAILSIGLN2 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN2", "INI FILE MISSING EMAILSIGLN2") $EMAILSIGLN3 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN3", "INI FILE MISSING EMAILSIGLN3") $EMAILSIGLN4 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN4", "INI FILE MISSING EMAILSIGLN4") $EMAILSIGLN5 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN5", "INI FILE MISSING EMAILSIGLN5") $EMAILSIGLN6 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN6", "INI FILE MISSING EMAILSIGLN5") $EMAILSIGLN7 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN7", "INI FILE MISSING EMAILSIGLN5") $EMAILSIGLN8 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN8", "INI FILE MISSING EMAILSIGLN5") $EMAILSIGLN9 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN9", "INI FILE MISSING EMAILSIGLN5") $var = IniReadSection(@ScriptDir & "\" & "data.ini", "NEW-CONTACT") $var2 = IniReadSection(@ScriptDir & "\" & "data.ini", "NEW-WO") ;~ Dim $Address($var[$i][1]) ;~ msgbox(4096, "", $var[$i][1]) If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else For $i = 1 To $var[0][0] & $var2[0][0] _INetMail($var[$i][1], "NIS W.O. #" & $var2[$i][1], $EMAILBODY & @CRLF & @CRLF & $EMAILSIGLN1 & @CRLF & $EMAILSIGLN2 & @CRLF & $EMAILSIGLN3 & @CRLF & $EMAILSIGLN4 & @CRLF & $EMAILSIGLN5 & @CRLF & $EMAILSIGLN6 & @CRLF & $EMAILSIGLN7 & @CRLF & $EMAILSIGLN8 & @CRLF & $EMAILSIGLN9) Next EndIf EndFunc Thats my code my data.ini looks like this[Setup] LASTWO=106155 NOTESWO=This is what will be put on each work order. EMAILBODY=What the email will have for each one. EMAILSIGLN1=MY-NAME-HERE EMAILSIGLN2=MY-TITLE-HERE EMAILSIGLN3=MY-DEPT-HERE EMAILSIGLN4=MY-NUMBER-HERE EMAILSIGLN5=MY-EMAIL-HERE EMAILSIGLN6=EXTRA EMAILSIGLN7=EXTRA EMAILSIGLN8=EXTRA EMAILSIGLN9=EXTRA [NEW-WO] WO1=122308 WO2=106330 [NEW-CONTACT] NAME1=JIM JONES NAME2=JAYZSo I am not sure why I get that error. Please help Link to comment Share on other sites More sharing options...
mbkowns Posted May 2, 2008 Author Share Posted May 2, 2008 bump Link to comment Share on other sites More sharing options...
Developers Jos Posted May 2, 2008 Developers Share Posted May 2, 2008 bumpSupport forum is to get .... support.Moved SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Squirrely1 Posted May 2, 2008 Share Posted May 2, 2008 mbkowns - this worked fine for me to open two Outlook-Word emails and write to them using your data.ini file: #include <INet.au3> _EMAILCONTACTWO() Func _EMAILCONTACTWO();==>_Send Emails with WO and USER NAME // Manually hit send for each Global $Address $EMAILBODY = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILBODY", "INI FILE MISSING EMAILBODY") $EMAILSIGLN1 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN1", "INI FILE MISSING EMAILSIGLN1") $EMAILSIGLN2 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN2", "INI FILE MISSING EMAILSIGLN2") $EMAILSIGLN3 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN3", "INI FILE MISSING EMAILSIGLN3") $EMAILSIGLN4 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN4", "INI FILE MISSING EMAILSIGLN4") $EMAILSIGLN5 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN5", "INI FILE MISSING EMAILSIGLN5") $EMAILSIGLN6 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN6", "INI FILE MISSING EMAILSIGLN5") $EMAILSIGLN7 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN7", "INI FILE MISSING EMAILSIGLN5") $EMAILSIGLN8 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN8", "INI FILE MISSING EMAILSIGLN5") $EMAILSIGLN9 = IniRead(@ScriptDir & "\" & "data.ini", "Setup", "EMAILSIGLN9", "INI FILE MISSING EMAILSIGLN5") $var = IniReadSection(@ScriptDir & "\" & "data.ini", "NEW-CONTACT") $var2 = IniReadSection(@ScriptDir & "\" & "data.ini", "NEW-WO") ; UBound($var) should equal UBound($var2) given your data.ini For $i = 1 To UBound($var) - 1; subtract 1 because ubound returns the number of elements ; in an array where the first element has a subscirpt of 0 _INetMail($var[$i][1], "NIS W.O. #" & $var2[$i][1], $EMAILBODY & @CRLF & @CRLF _ & $EMAILSIGLN1 & @CRLF & $EMAILSIGLN2 & @CRLF & $EMAILSIGLN3 & @CRLF _ & $EMAILSIGLN4 & @CRLF & $EMAILSIGLN5 & @CRLF & $EMAILSIGLN6 & @CRLF _ & $EMAILSIGLN7 & @CRLF & $EMAILSIGLN8 & @CRLF & $EMAILSIGLN9) Next EndFunc ;==>_EMAILCONTACTWO Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
DaRam Posted May 2, 2008 Share Posted May 2, 2008 (edited) mbkowns - this worked fine for me to open two Outlook-Word emails and write to them using your data.ini file: And, here is a more efficient way of doing the same: #include <INet.au3> _EMAILCONTACTWO() Func _EMAILCONTACTWO();==>_Send Emails with WO and USER NAME // Manually hit send for each Const $INI_Section = "Section" Const $INI_SigKeys = "EMAILSIGLN" Const $INI_MaxKeys = 9 Local $i, $INI_Filename Global $Address $INI_Filename = @ScriptDir & "\" & "data.ini" $EMAILBODY = IniRead($INI_Filename, $INI_Section, "EMAILBODY", "INI FILE MISSING EMAILBODY") & @CRLF For $i = 1 to $INI_MaxKeys $EMAILBODY = $EMAILBODY & @CRLF & IniRead($INI_Filename, $INI_Section, $INI_SigKeys & $i, "INI FILE MISSING EMAILSIGLN" & $i) Next $i $var = IniReadSection($INI_Filename, "NEW-CONTACT") $var2 = IniReadSection($INI_Filename, "NEW-WO") _INetMail($var[$i][1], "NIS W.O. #" & $var2[$i][1], $EMAILBODY) EndFunc;==>_EMAILCONTACTWO Edited May 2, 2008 by DaRam Link to comment Share on other sites More sharing options...
mbkowns Posted May 5, 2008 Author Share Posted May 5, 2008 Dang you guys rock! Thanks it was driving me nuts I see why it was doing it though now good deal. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now