Source language: Translate to:

strReplace won't replace |

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

strReplace won't replace |

Postby Wrangler » Wed Jan 24, 2007 12:05 pm

I'm working with generating some html. First I read in a file containing:

<table border="0" cellpadding="5" cellspacing="0" align="center"><tr><td>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-1415280414877571";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "000080";
google_color_url = "999999";
google_color_text = "000001";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></td></tr></table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td width="20"><img src="spacer.gif" width=20 height=1 border="0"></td>
<td width="100%">
<br>

Neobook inserts | wherever there is a line break. OK. But for some reason, this code won't replace it:

FileRead "[pubdir]topgoogle.inc" "All" "[topgoogle]"
StrReplace "[topgoogle]" "[#124]" "<BR>" "[topgoogle2]"

Tried using filetovar, and using | instead of [#124]. No luck. For some reason, the google script code above needs to be on individual lines for it to show in the browser. So I need to insert <BR> where the pipe symbol is.

What's up with this? Anyone think of a workaround?
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Sam Cox » Wed Jan 24, 2007 1:16 pm

This seems to work:
Code: Select all
FileRead "[pubdir]topgoogle.inc" "All" "[topgoogle]"
StrReplace "[topgoogle]" "[#13]" "<BR>" "[topgoogle2]"
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

Postby Wrangler » Wed Jan 24, 2007 1:21 pm

Thanks, Sam! You know, I knew it was something simple. But I just couldn't come up with it. I figured that at the point the data hit the variable, that NB wouldn't read it as a carriage return anymore, but as a character. :oops:
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron