|
PurposeA small application to strip control codes or linefeeds from text files that may have been transferred from PC applications to the Acorn. TextTidy will also convert non-HTML friendly characters into the correct HTML entities, so that you can convert text files into HTML files. | ||||||||||||||

The Choices window.
|
Last edit: 15th Dec 2009 at 6:40pm |
| Viewed 4109 times since 27th Jun 2006, | ||||||||||
|
| ||||||||||||||||||||||||
Last bit of code I want to show is the flashing animation for the arrows. To get that effect, I used the JQuery animate effect with a callback function pointing to the same method, so it gets called infinitely. When the mouse is away from the arrow, we call the JQuery stop effect to stop all animations.
function StopFlashing(obj) {
$(obj).stop(true).css("opacity", "show");
}
function StartFlashing(obj) {
$(obj).animate({ "opacity": "toggle" }, "slow", "linear", function() { StartFlashing(obj); });
}
It’s a rather simplistic example but I’ve had good fun exploring the power of JQuery. With my limited knowledge, I’m pretty happy with this example. I’m sure there’s better implementations of the same functionality, and if you do find some, please let me know. Happy Coding.
I have solved my problem with adding two line of code
The new funciton will be…
static public string CleanString(string s)
{
if (s != null && s.Length > 0)
{
StringBuilder sb = new StringBuilder(s.Length);
foreach (char c in s)
{
//sb.Append(Char.IsControl(c) ? ' ' : c);
if(Char.IsSymbol(c))
{
continue;
}
sb.Append(Char.IsLetterOrDigit(c) ? c : ' ');
}
s = sb.ToString();
}
return s;
}
use php. Change the extension of your .html file to .php, and paste the following code where you want your text to appear.
$filename="text_file.txt";
$handle=fopen($filename,"r");
$contents=fread
($handle,filesize($filename));
echo($contents);
?>
change $filename to your text file, include the directory inside the quotes. eg. "text_folder/my_text_file.txt"
and I had to put the $contents=fread on two lines because it was breaking. Put those two lines back on one.