[Solved] Question syntax XML-script concerning loc class

Moderator: dadolphs

Post Reply
agre30
Posts: 777
Joined: 24.12.2011, 20:41
Location: Netherland (Noordwest Overijssel)
Contact:

[Solved] Question syntax XML-script concerning loc class

Post by agre30 » 15.09.2017, 16:23

I'm look for the right syntax for:
If the class of the loc in block Hlx-01Up = Gdn then...

I tried this:
<if class="lc bkid Hlx-01Up=Gdn">
<then>

but the outcome is always true.
I searched the wiki and some examples but cannot find the right syntax

thanks in advance,

Albert.
Last edited by agre30 on 17.09.2017, 08:35, edited 1 time in total.

cds
Moderator
Posts: 4955
Joined: 03.02.2012, 19:24
Location: Tullnerbach, Austria

Re: Question about syntax XML-script concerning loc class

Post by cds » 15.09.2017, 16:51

Hello Albert!

Try this:

Code: Select all

<if class="bk4711 = AB">

agre30
Posts: 777
Joined: 24.12.2011, 20:41
Location: Netherland (Noordwest Overijssel)
Contact:

Re: Question about syntax XML-script concerning loc class

Post by agre30 » 15.09.2017, 18:15

Hi Claus,
Thanks.
I created this code:

Code: Select all

  <if class="bk Hlx-01Up = Gdn">
    <then>
but the outcome is always false no mather which loco is in the block. I'm sure the class of the loco is Gdn.
I attached the xml-script.

Just found out why it doesn't work. Your script tests the class of the block under permissions, not the class of the loco in the block.

Albert.
Attachments
add-schedule.xml
(1.3 KiB) Downloaded 1 time

agre30
Posts: 777
Joined: 24.12.2011, 20:41
Location: Netherland (Noordwest Overijssel)
Contact:

Re: Question about syntax XML-script concerning loc class

Post by agre30 » 17.09.2017, 08:12

I solved the problem myself with another approach.

The action is triggered when the block Hlx01-Up is occupied. So I first tried this:

Code: Select all

  <if class="lc %lcid% = Gdn">
    <then>
But that doesn't work when the name of the loc has blanks in it like: Arriva Spurt
And that's written in the wiki: Here :oops:
So I filled the ShortID of the loc with the loc adress, while there is no variable that contains the loc adress like %lcadress% (would be usefull)
And I came up with this solution:

Code: Select all

  <if class="lc %lcshortid% = Gdn">
    <then>
And that works.

Albert.

Post Reply

Return to “Basic topics”