Jump to content

2 out of 3 of my regexp work ?!?


440LVB
 Share

Recommended Posts

Hello

I'm making a program where i need regexp. I use 3, but only 2 are actually working, while they're very similar...

This is the piece of code where the problem is :

; Read in lines of text until the EOF is reached
While 1
    $line = FileReadLine($fileRead)
    If @error = -1 Then 
        ExitLoop
    EndIf
    $energie = StringRegExp($line,'ISU;([GE]);',1)
    $readPDL = StringRegExp($line,'ISU;[GE];([0-9]{20});',1)
    $miseEnService = StringRegExp($line,';([0-9]{8})\n',1)
        
    If StringCompare($energie[0],"E") == 0 Then
        FileWriteLine($fileResultE,$readPDL[0] & ";" & $miseEnService[0])
    Else
        FileWriteLine($fileResultG,$readPDL[0] & ";" & $miseEnService[0])
    EndIf
Wend

It works well with $energie and $readPDL, but for $miseEnService, the compiler keeps telling me "Subscript used with non-Array variable" when I try to write the line.

Any idea why it works with the 2 other variables and not this one?

Thanks for help

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...