# Script Line numbers in log file

**URL:** https://resource.dopus.com/t/script-line-numbers-in-log-file/32971
**Category:** Help & Support
**Created:** [June 28, 2019, 6:57am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971 "2019-06-28T06:57:46Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![opw62](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/5e9695/32.png) [@opw62](https://resource.dopus.com/u/opw62)
#### Post date: [June 28, 2019, 6:57am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/1 "2019-06-28T06:57:47Z")

</div>

The log under script output tells me there is an error in a specific line. However, I have difficulties in finding that line. I already removed all empty lines and lines and 'remark' lines (i.e. lines that start with a ' character).

When checking that line (in this case line 215, a ')' is expected), I can't see anything wrong.

The script starts with

```nohighlight
//
Rename PATTERN="*" TO="*"
@script vbscript
Option Explicit
Function Rename_GetNewName ( strFileName, strFilePath, _
          fIsFolder, strOldName, ByRef strNewName )
//
then.
     Dim re1
..etc..

```

Maybe the above 5 lines counted as line-numbering or does the line-numbering start with the 'Dim'..

Thanks.

---

<div class="post-metadata">

### Author: ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)
#### Post date: [June 28, 2019, 7:09am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/2 "2019-06-28T07:09:33Z")

</div>

Press **Ctrl-L** to toggle the display of line numbers in the edit control.

---

<div class="post-metadata">

### Author: ![opw62](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/5e9695/32.png) [@opw62](https://resource.dopus.com/u/opw62)
#### Post date: [June 28, 2019, 8:00am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/3 "2019-06-28T08:00:34Z")

</div>

Many thanks.

Just for good order's sake, what I meant to say is :  
does the checking skip/ignore lines that are empty or with 'comments' (starting with a ' symbol), i.e. it check lines with codes only?

For example: a script of 20 lines, including 10 'comment-lines and there is an error on line 15, will then the log show error on line 5 (because comment-lines are ignored) or indeed on line 15 ?

---

<div class="post-metadata">

### Author: ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)
#### Post date: [June 28, 2019, 8:14am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/4 "2019-06-28T08:14:28Z")

</div>

The line number reported in the error will be the same line number as shown in the editor with line numbering turned on.

---

<div class="post-metadata">

### Author: ![opw62](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/5e9695/32.png) [@opw62](https://resource.dopus.com/u/opw62)
#### Post date: [June 28, 2019, 8:40am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/5 "2019-06-28T08:40:46Z")

</div>

The reason for asking this so specifically is that I can't detect the error. Regretfully so. The line with the error is in fact a repeat of some two of lines before, however, just with a minor change in the regex only. The regex as such is okay (tested), but Opus reports a missing ")"

Now, what I just did, I added empty comment lines to see how that would work out with the line-numbering.  
According to the line number it now is an error in a comment line... (position remained the same)

 ![2019-06-28_10-29-33](https://resource.dopus.com/uploads/default/original/3X/c/d/cd37c5a02a239456975845629ba704ca4c67506f.jpeg)

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [June 28, 2019, 9:21am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/6 "2019-06-28T09:21:44Z")

</div>

What's the pattern in re1?

---

<div class="post-metadata">

### Author: ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)
#### Post date: [June 28, 2019, 9:26am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/7 "2019-06-28T09:26:56Z")

</div>

I think line 1 is the one that contains `Function`.

---

<div class="post-metadata">

### Author: ![opw62](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/5e9695/32.png) [@opw62](https://resource.dopus.com/u/opw62)
#### Post date: [June 28, 2019, 9:50am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/8 "2019-06-28T09:50:51Z")

</div>

re1 reads as follows:

"  
Dim re1  
Set re1 = new RegExp  
re1.Pattern = "^(._)[-\_\s]_(17[0-9][0-9]|18[0-9][0-9]|19[0-9][0-9]|20[0-2][0-9])[\s-\_.]?(0[1-9]|1[0-2])[\s-\_.]?(0[1-9]|[12][0-9]|3[01])[-\s\_]?([0-1]\d|[2][0-3])[\s-\_]?([0-5]\d)[\s-\_]?([0-5]\d).(\w{3,4}$"

"

---

<div class="post-metadata">

### Author: ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)
#### Post date: [June 28, 2019, 10:12am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/9 "2019-06-28T10:12:14Z")

</div>

The last `(` has no match.

---

<div class="post-metadata">

### Author: ![opw62](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/5e9695/32.png) [@opw62](https://resource.dopus.com/u/opw62)
#### Post date: [June 28, 2019, 10:40am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/10 "2019-06-28T10:40:01Z")

</div>

Ah!  
**Thank** you very much indeed!  
There were a few of these lines in the beginning . I copied the line a few times, made changes to the regex, but didn't notice the missing ")".  
The log pointed to a line that was correct, so quite some time I have been focussing on the wrong thing. The error was in line 10 and some following lines.  
It is okay now.

Again, thanks!

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [June 28, 2019, 10:43am UTC](https://resource.dopus.com/t/script-line-numbers-in-log-file/32971/11 "2019-06-28T10:43:32Z")

</div>

The error was coming from line 228 when re1 was first used. Looks like the line count was out by one for some reason. Maybe the `//` comment at the top of the button isn't being counted.
