ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Find And Run Robot

request: ignore #filecontents result line if file not found

(1/1)

Nod5:
FARR has the special string that lets us import one or more alias results line from a file. For example an alias can put the below string in the alias results setup and whatever is in C:\a.txt will be included in the results when a matching search is done.


--- Code: Text ---#filecontents C:\a.txt
But if the file is not found FARR instead shows this error message

--- Code: Text ---a.txt) --> file not foundError processing alias contents: C:\a.txt(C:\
Request: if the file isn't found FARR should simply ignore that line in the alias results instruction.

mouser:
I'm a little wary of not showing any message if file is not found.  But I could put the error in the status bar, or i could make a #filecontentsi command that is similar but ignores error..

Nod5:
I'm a little wary of not showing any message if file is not found.  But I could put the error in the status bar, or i could make a #filecontentsi command that is similar but ignores error..
-mouser (April 16, 2018, 10:55 PM)
--- End quote ---
You're right that is probably better. A new #filecontentsifexist (or something like that) would be useful.

One thing I use #filecontents for is to add a status/notification text line in some alias results. For example imagine an alias with 3 alternative backup commands as result. We can with #filecontents add an extra result line that reads a textfile generated by one of those three commands last time it ran. So the results can look something like:


--- ---backup command b1
backup command b2
backup command b3
Last run: b1 2018-02-15 success

mouser:
That's pretty nice.. makes sense.. I will add.

Navigation

[0] Message Index

Go to full version