response.write line number and variable name

Results 1 to 3 of 3

Thread: response.write line number and variable name

  1. #1
    Join Date
    Dec 1969

    Default response.write line number and variable name

    What I&#039;m looking for is a way to response.write the line number and the name of a variable:<BR><BR>&#060;%<BR>...<BR>My_Variable=rs( "field")<BR><BR>&#039; normally I do this:<BR><BR>response.write "line 112: My_Variable: " & My_Variable & "&#060;hr&#062;"<BR><BR>&#039;the html output for the above would be like this:<BR>%&#062;<BR><BR>line 112: My_Variable: Value_of_My_Variable<BR>__________________________ _________________<BR><BR>&#060;%<BR>&#039; what I want is a function which does the same thing<BR>&#039; just by writing:<BR><BR>wr(My_Variable)<BR>%&#062;<BR><BR> my problem is that I can&#039;t get the machine to write the LINE NUMBER (where the response.write is) or the NAME of the variable (in this case My_Variable) and not just the VALUE of the variable.<BR><BR>Am I asking the impossible?<BR><BR>thanks,<BR>Dan<BR> <BR>

  2. #2
    Join Date
    Dec 1969

    Default i can't think of an easy way to do this...

    but;<BR><BR>if you were to do<BR><BR>wr("My_Variable")<BR><BR>then you&#039;d be able to get the name of the variable (obviously), you could then use server.execute to get the value of your variable, and open the file up as a textstream, loop through it looking for the line "wr(""My_Variable"")", counting line numbers as you go along.<BR><BR>obviously, this isn&#039;t ideal; server.execute has quite a high overhead, and it would always find the first instance of "wr(""My_Variable"")" in the file.<BR><BR>I&#039;m assuming this is for some sort of debugging. If so why not just use Microsoft Script Debugger; does it all for you. Look on Google.<BR><BR>c<BR>

  3. #3
    Join Date
    Dec 1969

    Default Can't be done in VBScript

    The language just isn&#039;t sophisticated enough.<BR><BR>Sorry.<BR><BR>

Posting Permissions

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