|
-
Sep 25th, 2000, 11:45 AM
#1
Thread Starter
Addicted Member
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
Code:
"bgcolor=" & chr(34) & "#000000" & chr(34)
I cannot sucessfully get it to work in
Code:
Response.Write "<TD " & SplitThem(1) & "> </TD>" & vbcrlf
which in turn would make my HTML look like this.
Code:
<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)
-
Sep 25th, 2000, 12:39 PM
#2
Frenzied Member
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
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Sep 25th, 2000, 12:44 PM
#3
Thread Starter
Addicted Member
<grr>
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.
Code:
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.
-
Sep 27th, 2000, 08:30 AM
#4
Thread Starter
Addicted Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|