Results 1 to 4 of 4

Thread: I need to

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Grand Rapids, MI
    Posts
    231

    Red face

    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)
    -Karl Blessing aka kb244{fastHACK}
    [email protected]

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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..

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Grand Rapids, MI
    Posts
    231

    <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.
    -Karl Blessing aka kb244{fastHACK}
    [email protected]

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Grand Rapids, MI
    Posts
    231
    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.
    -Karl Blessing aka kb244{fastHACK}
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width