Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline CMBI-IT  
#1 Posted : Thursday, May 23, 2019 1:09:24 PM(UTC)
CMBI-IT

Rank: Paid support

Joined: 1/31/2019(UTC)
Posts: 8
Hong Kong
Location: Hong Kong, Hong Kong

When I use the syntax: {STRING(IndexOf|{TASK(PrevTask|StdOut)}|T)}, I got "Error in argument".

However, {TASK(PrevTask|StdOut)} is a valid output.


Example: I set the following in task output
===================================
{STRING(IndexOf|{TASK(PrevTask|StdOut)}|F)}
{STRING(IndexOf|12345_20140101_FILE.PDF|_)}
{STRING(Substring|12345_20140101_FILE.PDF|0|5)}
{STRING(Substring|12345_20140101_FILE.PDF|0|{STRING(IndexOf|12345_20140101_FILE.PDF|_)})}

Whole File:
{TASK(PrevTask|StdOut)}





What I got is:
===========
Error in argument
5
12345
12345

Whole File:
10:12:09.358|[main]| INFO|com.cmbi.tap.recon.GenerateTapRecon |================================================================
10:12:09.381|[main]| INFO|com.cmbi.tap.recon.GenerateTapRecon |Start GenerateTapRecon 1.2
...

Edited by moderator Tuesday, June 4, 2019 10:59:42 AM(UTC)  | Reason: Not specified

Offline Support  
#2 Posted : Friday, May 24, 2019 5:01:43 PM(UTC)
Support

Rank: Official support

Joined: 2/23/2008(UTC)
Posts: 11,157

Thanks: 864 times
Was thanked: 440 time(s) in 418 post(s)
What exactly does {TASK(PrevTask|StdOut)} contain. Please attach txt file.
Henrik
Support
http://www.visualcron.com
Please like VisualCron on facebook!
Offline CMBI-IT  
#3 Posted : Friday, May 24, 2019 7:02:37 PM(UTC)
CMBI-IT

Rank: Paid support

Joined: 1/31/2019(UTC)
Posts: 8
Hong Kong
Location: Hong Kong, Hong Kong

Actually any text gives the same result of "Error in argument"

Example of {TASK(PrevTask|StdOut)}:

Whole File:
10:12:09.358|[main]| INFO|com.cmbi.tap.recon.GenerateTapRecon |================================================================
10:12:09.381|[main]| INFO|com.cmbi.tap.recon.GenerateTapRecon |Start GenerateTapRecon 1.2
End of testing text.


test.txt (1kb) downloaded 7 time(s).
Offline Gary_W  
#4 Posted : Monday, June 3, 2019 11:39:58 PM(UTC)
Gary_W

Rank: Paid support

Joined: 12/19/2016(UTC)
Posts: 193
United States
Location: Michigan, Dearborn

Thanks: 41 times
Was thanked: 66 time(s) in 57 post(s)
It's because the file contains pipe characters. The pipe is the delimiter for the VisualCron function arguments so when "{TASK(PrevTask|StdOut)}" gets replaced with the file contents containing pipes, the STRING function is then parsed and it seems there are a ton of extra arguments to it!

Luckily you can change the delimiter VisualCron uses by using the syntax below. Pick a character that is not in the file. I used a comma. Put the character you intend to use before the string function name, then use it as the delimiter. I believe this to be a time-bomb though and would not trust this for production, as it's a matter of time before a comma shows up in the file then this blows up. I would like to see this handled differently by VisualCron so this delimiter switching would not be needed.

{STRING(,IndexOf,{TASK(PrevTask|StdOut)},F)}
thanks 1 user thanked Gary_W for this useful post.
Support on 6/4/2019(UTC)
Offline CMBI-IT  
#5 Posted : Wednesday, June 5, 2019 4:01:38 AM(UTC)
CMBI-IT

Rank: Paid support

Joined: 1/31/2019(UTC)
Posts: 8
Hong Kong
Location: Hong Kong, Hong Kong

Great! It works now! Thanks a lot.

Agree that VisualCron should revise this design.

Users browsing this topic
Guest (2)
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Scroll to Top