Jump to content
Sign in to follow this  
Jury

ERROR: syntax error

Recommended Posts

Why I'm I suddenly getting these error messages on a program I've been using for some time?

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\joe.ury\My Documents\AutoIt_code\A_IE_gettr_Vikys_hp3.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

+>09:39:36 Starting AutoIt3Wrapper v.2.0.0.1 Environment(Language:0409 Keyboard:00000809 OS:WIN_XP/Service Pack 3 CPU:X64 OS:X86)

>Running AU3Check (1.54.14.0) from:C:\Program Files\AutoIt3

C:\Documents and Settings\joe.ury\My Documents\AutoIt_code\A_IE_gettr_Vikys_hp3.au3(84,116) : ERROR: syntax error

$title = $array[5] & "[" & $array[4] & "] IEHC " & "#" & "(" & $array[42 & " " & $array[3] & " " & $array[4] & ")"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\joe.ury\My Documents\AutoIt_code\A_IE_gettr_Vikys_hp3.au3(85,44) : ERROR: syntax error

InetGet('http://www.courts.ie' & $array[0],

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\joe.ury\My Documents\AutoIt_code\A_IE_gettr_Vikys_hp3.au3(85,75) : ERROR: syntax error

InetGet('http://www.courts.ie' & $array[0], $processing & "\" & $filename)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\joe.ury\My Documents\AutoIt_code\A_IE_gettr_Vikys_hp3.au3(86,57) : ERROR: syntax error

ConsoleWrite('http://www.courts.ie' & $array[0] & @CRLF)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\joe.ury\My Documents\AutoIt_code\A_IE_gettr_Vikys_hp3.au3 - 4 error(s), 0 warning(s)

!>09:39:36 AU3Check ended.rc:2

The second error message is on a line which si really:

InetGet('http://www.courts.ie' & $array[0],

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

the program:

#include <file.au3>
#include <INet.au3>
#include <GUIConstantsEx.au3>
#include <Array.au3>
#include <Date.au3>
;http://www.courts.ie
Dim $szDrive, $szDir, $szFName, $szExt
Global $a, $b, $title[10], $h, $len
Global $array[6]
; Get drive add paths
$TestPath = _PathSplit(@ScriptFullPath, $szDrive, $szDir, $szFName, $szExt)
$drivedir = $szDrive & $szDir
$getter = $drivedir & "getter\"
$processing = $drivedir & "getter\processing\"
$out = $drivedir & "\getter\processing\out\"
$resources = $drivedir & "\getter\resources\"
$JulDate = _DateToDayValue(@YEAR, @MON, @MDAY)
ConsoleWrite($JulDate & @CRLF)
ConsoleWrite($processing & @CRLF)
If DirGetSize($getter) = -1 Then
GUICreate("Working Directories", 300, 100)
GUICtrlCreateLabel("Create directory: " & $processing, 30, 10)
$okbutton = GUICtrlCreateButton("OK", 30, 50, 40)
$nobutton = GUICtrlCreateButton("NO", 90, 50, 40)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $okbutton
DirCreate($getter & "processing\out\")
DirCreate($getter & "resources\")
GUIDelete(); ; will return 1
ExitLoop
Case $msg = $nobutton
MsgBox(0, "GUI Event", "without these working directories this program can't work", 2)
ExitLoop
Case $msg = $GUI_EVENT_CLOSE
MsgBox(0, "GUI Event", "without these working directories this program can't work", 2)
ExitLoop
EndSelect
WEnd
EndIf

InetGet("http://www.courts.ie/Judgments.nsf/Webpages/HomePage?OpenDocument&Start=1&Count=100", $processing & "IErecent.html")
$file = FileOpen($processing & "IErecentx.html", 0)
; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to retrieve IErecent.txt: stage 2" & @CRLF)
Exit
EndIf
; Read file into memory
$filewhole = FileRead($file)
FileClose($file)
;RegExp Option 1, using offset
$nOffset = 1
While 1
; $array = StringRegExp($filewhole, '(\/Judgments\.nsf/\d+.*?OpenDocument).*?Arial">(.*?)<.*?Arial">(Court of Criminal Appeal|High Court|Supreme Court).*?(\d{2})\/(\d{2})\/(\d{4})', 1, $nOffset)
$array = StringRegExp($filewhole, '(\/Judgments\.nsf/\d+.*?OpenDocument).*?(\d{2})\/(\d{2})\/(\d{4}).*?Arial.>(.*?)<', 1, $nOffset)
If @error = 0 Then
$nOffset = @extended
Else
MsgBox(0, "RegExp Test with Option 1 - ", "Oops")
ExitLoop
EndIf
For $i = 0 To UBound($array) - 1
ConsoleWrite($i & @CRLF & $array[$i] & @CRLF & @CRLF)
;msgbox(0, "RegExp Test with Option 1 - " & $i, $array[$i])
Next
$a = $a + 1
$filename = StringRegExpReplace($array[2], " ", "_") & $a & ".html"
$title = $array[5] & "[" & $array[4] & "] IEHC " & "#" & "(" & $array[42 & " " & $array[3] & " " & $array[4] & ")"
InetGet('http://www.courts.ie' & $array[0], $processing & "\" & $filename)
ConsoleWrite('http://www.courts.ie' & $array[0] & @CRLF)
; EndIf
WEnd

Share this post


Link to post
Share on other sites

$title = $array[5] & "[" & $array[4] & "] IEHC " & "#" & "(" & $array[42 & " " & $array[3] & " " & $array[4] & ")"

$title = $array[5] & "[" & $array[4] & "] IEHC " & "#" & "(" & $array[42 & " " & $array[3]

$title = $array[5] & "[" & $array[4] & "] IEHC " & "#" & "(" & $array[42

"#" & "(" & $array[42

$array[42

~~~~~~~^

You're missing the "]"

Share this post


Link to post
Share on other sites

Shouldn't this line

$title = $array[5] & "[" & $array[4] & "] IEHC " & "#" & "(" & $array[42 & " " & $array[3] & " " & $array[4] & ")"
be
$title = $array[5] & "[" & $array[4] & "] IEHC " & "#" & "(" & $array[42] & " " & $array[3] & " " & $array[4] & ")"


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-30 - Version 1.6.2.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

Thanks - I must've inadvertently pressed the delete key - strange how different eyes spot things (i did look) :idiot:

Share this post


Link to post
Share on other sites

It also helps following the ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ thing.

It usually points to the error location

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...