I am pulling 3 fields from a database using a vb script - article title, article date, and article body. I have an ASP page on our intranet where people are typing this info into the database.
I need to know what type of codes I can use inside the database content for line breaks. I tried "<br>" which Scala just printed out. When I hit "Enter" the database shows it as having a line break but Scala shows squares (probably unrecognized character). How can I allow people to put linebreaks in the article body so Scala knows it should jump to the next line when displaying it?
Thanks!
Jenn
Last time I had to do this, I used the following line in VBscript:
eventtext=Replace(eventtext,"{newline character}",vbNewLine)
Or try using the ^n characters when exchanging variables.
This doesn't work in textfiles though. You have to use a special piece of scalascripting for that.
Thanks! However, the "vbNewLine" is giving me the same issue as a hard return did. It jumps to the next line but puts a square before it does. I would like to use HTML, so to explain it better: (change all square brackets to GT/LT - kept rendering the br tags - lol)
In database:
Hello[br]World
In WinScript:
sParagraph = replace(objRs("sParagraph"),"[br]",vbNewLine)
While Playing the Slides:
Hello (square)
World
I guess I am looking for something that won't give me the square but will still give me the linebreak. Ideas?
Jenn
Strange... I don't get any squares. Migth be the font or some setting. Anyway, have you tried chr(13) instead of vbnewline?
And the ^n ? (Native Scala newline char)
When using newlines in textfiles, the solution would be something like this:
In Vbscript I do this:
' Create a maximum of twenty lines (adjust by demand)
' where /n should be >br<
' Varnames are in Dutch, sorry ;o)
tel=0
i=0
i=InStr(i+1,ItemTekst,"\n")
While i>0
tel=tel+1
i=InStr(i+1,ItemTekst,"\n")
Wend
For i=tel+1 To 20
ItemTekst=ItemTekst & "\n"
Next
ItemTekst=ItemTekst & " "
If Left(ItemTekst,2)="\n" Then
ItemTekst=" " & ItemTekst
End If
Now you have a text or variable with a maximum of twenty newlines.
In Scala we have to convert these newlines characters to the internal newline. We do this with the following script:
(adjust to nr of lines you want)
Sequence:
textvar1 = left(line3,search(line3,1,"\n")-1)+"^n"+right(line3,length(line3)-search(line3,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
textvar1 = left(textvar1,search(textvar1,1,"\n")-1)+"^n"+right(textvar1,length(textvar1)-search(textvar1,1,"\n")-1);
Hope this might help you out someday.
Sorry, I made a mistake. Use ^n in a variable (I forgot the n) and then it works just fine. I shouldn't be posting after midnight after enjoying a fine wine... I just lead you astray... ;o)
I couldn't get ^n to work - using it without quote in the replace funciton caused a VB error and using it with quotes in the replace function just stuck the ^n and part of my text.
However, the chr(13) worked - thank you so much!
Does scala have its own codes (like the ^n mentioned) that I can use inside content to do further formatting - like bold, italics, font sizing, font colors?
I would love to allow people to format their text going into the db using HTML tags then when I pull it out for Scala I could replace those tags with whatever Scala uses to do the same thing. Possible or pipe dream?
Jenn
Oh sure you can! But as far as I know only in a crawl...
Download this example (for IC3)
http://www.scala.com/advancedscripting/infochannel3/CrawlStyles.zip
I'll look through my docs to try and find an easy way to use this on normal text.
Marvin
Discussions 2005 Index |
Contact Scala about your end-to-end software solutions for creating and controlling Electronic Display Networks, whether you call it Dynamic digital signage, Narrowcasting, Captive Audience Networks, Kiosks, Point-of-Purchase Displays, Digital In-Store Merchandising, Out-of-Home Media Networks, Place-based Advertising, Display Marketing, Retail Digital Media Networks, Datacasting, Electronic Billboards, The Outernet or any of the other terms in use today. Scala conducts business through a worldwide network of Value Added Resellers. For more information on what this emerging industry is coming to be named, you can see how other people found this page. ©1993-2008 Scala, Inc. Scala, InfoChannel, and the Exclamation Point Logo are registered trademarks of Scala, Inc. All other trademarks are the property of their respective organizations. To see all the content on our Website, click Sitemap or check our blog for the latest updates. Read our Privacy Policy.