Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Any plugin displays a text file content and check update?

Discuss anything to do with plugins

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
bjzhanghao
Posts: 2
Joined: October 19th, 2007, 6:52 am

Any plugin displays a text file content and check update?

Post by bjzhanghao »

Hi,
I'm new to lcd smartie. I'm seeking a plugin that can display certain file's content to lcd, and if the file's content changes, lcd display can update in given interval. Thanks for any instruction.

Regards,
Hao

limbo
Plugin Author
Posts: 1604
Joined: February 13th, 2005, 7:38 pm
Location: Athens - Greece
Contact:

Post by limbo »

Text file read is a build in function and of course you can use some other plugin to make this function to fit your needs.

See warnif regex

If you need something more custom be more specific... give the details of the document and the text contents

:)

bjzhanghao
Posts: 2
Joined: October 19th, 2007, 6:52 am

Post by bjzhanghao »

I don't know how to develop a custom plugin which can call build-in $File() function, so what I'm planning to do is to write some value to a certain text file from another program, and let lcd smartie display the value to my LCD screen.

Does $File() check for update by default? Can I implement what I said without a custom plugin?

Thanks!

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

I think $file() and $LogFile() either read the file every screen refresh (refresh interval as set in Smartie's Program Settings, usually something like 200ms) or check for changes every refresh, so you will always get the current contents of the file.

Info on all the Smartie built-in commands is here: http://lcdsmartie.sourceforge.net/commands.html

If you only need to display the text in the 1st (or 2nd or 3rd etc) line of the file, then you can use $File(). To display the last line (or 2nd-to-last etc) you can use $LogFile().

If there is only 1 line in the file, either of these gives you the entire file. A line is all characters up to a carriage return (ie the "Enter" key).

You can probably use one of the text-processing plugins (search, split, regexp, right, etc) to extract whatever you need from the line out of the file.

If you need something more complicated than that, you may have to find/write a new plugin to do the job.

Post Reply