creeping Posted April 17, 2007 Share Posted April 17, 2007 (edited) Ok, this code fails on the line: Return StringSplit($aTemp[$E_LAST_EMAIL_TIME][1], $cDateDelim) It tells me $E_LAST_EMAIL_TIME is not decleared in the function GetLastEmailTime(), but I use the variable in the function WriteEmailTime() without an error before GetLastEmailTime() is called. So.. Is this allowed: Enum $E_LAST_EMAIL_TIME = 1 ? I pasted my .ini file below. Am I missing something stupid here? Thanks. expandcollapse popup#include <Array.au3> Const $sIniConfig = 'config.ini', $sIniSecEmail = 'email', $sIniSecEventlogs = 'eventlogs', $sIniSecLog = 'log' Const $cTimeDelim = ':', $cDateDelim = '/' Dim $aIniSecEmail = IniReadSection($sIniConfig, $sIniSecEmail) Dim $aIniSecEventLogs = IniReadSection($sIniConfig, $sIniSecEventlogs) Dim $aIniSeclog = IniReadSection($sIniConfig, $sIniSecLog) Dim $iSendEmailHour = 0, $iSendEmailMin = 0 Dim $aLstEmailTime = GetLastEmailTime() Dim $aTemp = 0 Enum $E_TIME = 1, $E_SMTP_SERVER, $E_FROM_NAME ,$E_FROM_ADDRESS, $E_SUBJECT Enum $E_APPLICATION = 1, $_SECURITY, $E_SYSTEM Enum $E_LAST_EMAIL_TIME = 1 Enum $E_DAY_OF_MONTH = 1, $E_MONTH, $E_YEAR $aTemp = StringSplit($aIniSecEmail[$E_TIME][1], $cTimeDelim) $iSendEmailHour = $aTemp[1] $iSendEmailMin = $aTemp[2] WriteEmailTime() GetLastEmailTime() Func WriteEmailTime() $aTemp = IniReadSection($sIniConfig, $sIniSecLog) $aTemp[$E_LAST_EMAIL_TIME][1] = @MDAY & $cDateDelim & @MON & $cDateDelim & @YEAR IniWriteSection($sIniConfig, $sIniSecLog, $aTemp) EndFunc Func GetLastEmailTime() $aTemp = IniReadSection($sIniConfig, $sIniSecLog) MsgBox(0, '', $aTemp[0][0]) MsgBox(0, '', $aTemp[1][0]) MsgBox(0, '', $aTemp[1][1]) Return StringSplit($aTemp[$E_LAST_EMAIL_TIME][1], $cDateDelim) EndFunc Sample config.ini time=17:00 smtpServer=smtp.xtra.co.nz fromName=EventRobo fromAddress=EventRobo@jit.co.nz subject=webco - @hostname [eventlogs] application=1;1;0 security=1;1;0 system=1;1;0 [log] lastSendTime=17/04/2007 Edited April 17, 2007 by creeping Link to comment Share on other sites More sharing options...
MHz Posted April 17, 2007 Share Posted April 17, 2007 You are calling GetLastEmailTime() before you declare $E_LAST_EMAIL_TIME in your script. Move your $E_LAST_EMAIL_TIME declaration before calling GetLastEmailTime(), and the error should not show. Link to comment Share on other sites More sharing options...
creeping Posted April 17, 2007 Author Share Posted April 17, 2007 You are calling GetLastEmailTime() before you declare $E_LAST_EMAIL_TIME in your script. Move your $E_LAST_EMAIL_TIME declaration before calling GetLastEmailTime(), and the error should not show. :"> How stupid do I feel... Thanks Link to comment Share on other sites More sharing options...
BrettF Posted April 17, 2007 Share Posted April 17, 2007 :"> How stupid do I feel... ThanksHehehe. Don't feel stupid. We all learn from our mistakes. Heck! Once upon a time I tried to put ':' into a file name..... I have been stupider Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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