PDA

Click to See Complete Forum and Search --> : I need to


kb244
Sep 25th, 2000, 11:45 AM
I have a bunch of constants(being loaded from a file through an activeX dll so users can edit/preview the values), and I Want the user to be able to preview their value, however, since the value retrived looks like this

"bgcolor=" & chr(34) & "#000000" & chr(34)

I cannot sucessfully get it to work in

Response.Write "<TD " & SplitThem(1) & "> </TD>" & vbcrlf

which in turn would make my HTML look like this.

<TD "bgcolor=" & chr(34) & "#ffffff" & chr(34)> </TD>


is there any way to "VB"Encode the string, so that the text meant to be processed when normally used in a constant, gets encoded when I put it into a preview like above.
(HTMLEncode becomes useful when I Want show the value out to the screen before previewing)

monte96
Sep 25th, 2000, 12:39 PM
First off, you don't need the quotes around the color code. HTML will understand it without them.

That would probably solve the problem. Where is the bgcolor=... string coming from? You should not convert it to Chr(34) unless you are doing it in the response.write or doing it when concatenating the string variable

kb244
Sep 25th, 2000, 12:44 PM
Yer the second person that didnt understand the concept, that "STRING" is from a constant, and it is not being hardcoded, it is instead being loaded into a variable, but because if it's string nature, I Cannot get VBscript to process it, here a sniplet of the code to see what I am talking about, currently I am using a crapload of "Replace" Statements just to get a preview of the color, I want a VB-Encode type of command, something that'll process the string as if it were code, I have had no luck all day, and least 4 people were completely clueless as to what I Was trying to explain.


if InStr(1, UCase(SplitThem(0)), "COLOR") > 0 then
Response.Write "<TD " & Replace(Replace(Replace(SplitThem(1),Chr(34),""),"chr(34)", Chr(34)),"&","") & ">*</TD>" & vbcrlf
else
Response.Write "<TD>*</TD>" & vbcrlf
end if


forgive me if I sound a little grouchy, but it's been getting on my nerves, especially if I cant explain to people what I am trying to do.

kb244
Sep 27th, 2000, 08:30 AM
Well two reasons actually, one it's comming from a file that stores constants, and two I Am not the one who writes the values for these constants, so I have to try to work with what they write.