Variable: Difference in full path or variable

Discuss RoboTask here
Post Reply
Rukbunker
Posts: 194
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Variable: Difference in full path or variable

Post by Rukbunker »

Hey Oleg,

I've noticed something weird recently.

I have a task, triggered with File Monitor. Every day just 1 XML-file comes into a folder, task should start. That works. The filename which is found is saved into a variable XMLFILE, the content is correct, see screenshot. Later in the task, that variable is used to declare a variable XMLTEXT with the content of XMLFILE. However, when the task is executed, errors appear.
Robotask03.png
Robotask03.png (186.12 KiB) Viewed 7192 times

But, when I use the complete path of the file manually in XMLTEXT, the task continues without any error, despite the fact it should be theoretically the same, right? What do I miss?

Robotask02.png
Robotask02.png (59.04 KiB) Viewed 7192 times
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Variable: Difference in full path or variable

Post by Oleg »

Problem here:
File monitor saves lists of files as multiline text because it can detect several files. One file name at the line
Each line end with End-Of-Line (EOL) symbols.
Even if it detects only one file.

So you shoud precess these variable in Text loop. If File monitor detects only one file you will have only one iteration
Oleg Yershov
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Variable: Difference in full path or variable

Post by Oleg »

One note:
To see the content of variable put the variable expression beween some border symbols
For example:
"{XMLFILE}"
|{XMLFILE}|
[{XMLFILE}]
The variable can contain some invisible symbols (spaces, EOL, TAB)
Oleg Yershov
Rukbunker
Posts: 194
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Re: Variable: Difference in full path or variable

Post by Rukbunker »

Oleg wrote: Fri Sep 29, 2023 9:40 am One note:
To see the content of variable put the variable expression beween some border symbols
For example:
"{XMLFILE}"
|{XMLFILE}|
[{XMLFILE}]
The variable can contain some invisible symbols (spaces, EOL, TAB)
I always use "Show Message" for this purpose ;)

But thanks for the heads-up. I will use the File Loop.
Post Reply