IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Script stops when IF-branch on negativ condition
newtagger
post Jun 25 2012, 07:16
Post #1


Member


Group: Full Members
Posts: 8
Joined: 8-November 06
Member No.: 3951
Mp3tag Version: 2.51



Hi all,
I got stuck with an If operation. The script just stops without error (genrating output) but omitting code behind endif at least is case is negativ. Don't know behavior in positiv case since this is not reached.

Would be great you experts might have a look- most probably I'm just blind. Since code is for the "prohibited" source, I don't like to post the almost complete script. So find attached just the relevant part with the corresponding debug.

Thanks in advance!

CODE
Added some of the original line numbers in abbrev. for sync:

        FindLine "sample" 1 1                                                        # Kriterium für letzen Track finden (244)
        MoveLine -1
        unspace
        IfNot "</html>"                                                                    # ja:EOF (247)
            MoveLine +2
            Unspace
            If "<th"                                                                            # ja:weitere CD (250)
                MoveLine -10
                FindLine "<h2>tracks"
                FindInLine "tracks"
                outputto "CurDisc"                                                    # Discnummer zwischenspeichern
                RegexpReplace "<.*?>" ""
                SayRegexp "\d+"
            EndIf
        EndIF

#----------------------------------------------------------------------------
#Disc-Number & Totaldisc ausgeben
#----------------------------------------------------------------------------
        outputto "Discnumber" #(263)
        SayOutput "CurDisc"
#        say "|"
        
        Set "TOTALDISCS"            # alten Wert löschen
        outputto "TOTALDISCS"
        SayOutput "CurDisc"
        MoveLine +1
        Unspace
    While "<div class="ui360">"                                                # ja: weitere Tarcks (272)
#endif

Trace dazu:
------------------------------------------------------------

Script-Line    : 242
Command        : say
Parameter 1    : >|<

Output         : >Koko Taylor|<

Line and position:
Koko Taylor
           ^

------------------------------------------------------------

Script-Line    : 244
Command        : findline
Parameter 1    : >sample<
Parameter 2    : >1<
Parameter 3    : >1<

Output         : >Koko Taylor|<

Line and position:
                <td class="sample pick" title="AllMusic Pick">
^

------------------------------------------------------------

Script-Line    : 245
Command        : moveline
Parameter 1    : >-1<

Output         : >Koko Taylor|<

Line and position:
                    <tr>
^

------------------------------------------------------------

Script-Line    : 246
Command        : unspace

Output         : >Koko Taylor|<

Line and position:
<tr>
^

------------------------------------------------------------

Script-Line    : 247
Command        : ifnot
Parameter 1    : ></html><

Output         : >Koko Taylor|<

Line and position:
<tr>
^

------------------------------------------------------------

Script-Line    : 248
Command        : moveline
Parameter 1    : >+2<

Output         : >Koko Taylor|<

Line and position:
                                    <div class="ui360">
^

------------------------------------------------------------

Script-Line    : 249
Command        : unspace

Output         : >Koko Taylor|<

Line and position:
<div class="ui360">
^

------------------------------------------------------------

Script-Line    : 250
Command        : if
Parameter 1    : ><th<

Output         : >Koko Taylor|<

Line and position:
<div class="ui360">
^

------------------------------------------------------------

Total output:


This post has been edited by newtagger: Jun 25 2012, 07:25
Go to the top of the page
 
+Quote Post
pone
post Jun 25 2012, 08:49
Post #2


Member


Group: Full Members
Posts: 1572
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.50



Maybe

outputto "Discnumber" #(263)
SayOutput "CurDisc"

is a problem when "CurDisc" does not exist. Try to workaround this by writing

outputto "CurDisc"
say ""

in front of the first if command.
Go to the top of the page
 
+Quote Post
newtagger
post Jun 25 2012, 09:50
Post #3


Member


Group: Full Members
Posts: 8
Joined: 8-November 06
Member No.: 3951
Mp3tag Version: 2.51



Hi pone,
thanks for looking at it.
I don't think this is the reason, you can't know but there is this part before:
CODE
FindLine "<h2>tracks"
FindInLine "tracks"
outputto "CurDisc"        # Discnummer zwischenspeichern
RegexpReplace "<.*?>" ""
SayRegexp "\d+"

Ouput for "CurDisc" is "1" when it stops, this is set first time when the first disc was found by the code above.

Thanks again anyway.
Go to the top of the page
 
+Quote Post
dano
post Jun 25 2012, 10:26
Post #4


Moderator


Group: Moderators
Posts: 5524
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.55a



Add an else (empty) statement to that if block.


--------------------
Go to the top of the page
 
+Quote Post
newtagger
post Jun 25 2012, 17:20
Post #5


Member


Group: Full Members
Posts: 8
Joined: 8-November 06
Member No.: 3951
Mp3tag Version: 2.51



Hi dano,
thanks - but does not work for me.
Played around with else before but now double checked again with 2 (as below) or just one in inner or outer branch.
CODE
        IfNot "</html>"                                                                    # Wenn td class nicht gefunden EOF
            MoveLine +2
            Unspace
            If "<th"
                MoveLine -10
                FindLine "<h2>tracks"
                FindInLine "tracks"
                outputto "CurDisc"        # Discnummer zwischenspeichern
                RegexpReplace "<.*?>" ""
                SayRegexp "\d+"
                Else
            EndIf
        Else
        EndIF

That why I'm so confused. If you like I can send you the complete script, this would might make it easier.
Greets
Go to the top of the page
 
+Quote Post
dano
post Jun 25 2012, 18:48
Post #6


Moderator


Group: Moderators
Posts: 5524
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.55a



Ok send the script.

Solution:
endif must be lower case

This post has been edited by dano: Jun 26 2012, 11:34


--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th June 2013 - 17:24