473,326 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how can I find what value is in my variable?

At first glance, the question in the subject line seems way too easy. But I
am finding some situations in my app where the value in a variable is some
sort of blank-like value, such as Null or " " or "", but I cannot tell
which.

Of course, in order to find out the value, I did a response.write, and added
a nonsense word afterward, to help make sure it is writing it out for me.

First, I tried to check for null:

if IsNull(strOrigValue) then

response.Write strOrigValue & "if"

response.End

else

response.Write trim(strOrigValue) & "else"

response.End
end if

==================

If not NULL, then perhaps it's blank, or a space. I tried this:

if Trim(strOrigValue) = "" then

response.Write strOrigValue & "if"

response.End

else

response.Write trim(strOrigValue) & "else"

response.End
end if

=====================

In both cases, I ended up with "else" being displayed. I am at a loss here.
Is there something else I can check for that will make it fall into the "if"
part of the statement?
Sep 11 '06 #1
3 2518
Middletree wrote:
In both cases, I ended up with "else" being displayed. I am at
a loss here. Is there something else I can check for that will
make it fall into the "if" part of the statement?
I would start here:

Response.Write(TypeName(strOrigValue))

http://msdn.microsoft.com/library/en...cc0e94dae0.asp
You don't really say where this variable is coming from. Could you offer up
some detail on how this variable gets populated?

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 11 '06 #2

Middletree wrote:
At first glance, the question in the subject line seems way too easy. But I
am finding some situations in my app where the value in a variable is some
sort of blank-like value, such as Null or " " or "", but I cannot tell
which.

Of course, in order to find out the value, I did a response.write, and added
a nonsense word afterward, to help make sure it is writing it out for me.

First, I tried to check for null:

if IsNull(strOrigValue) then

response.Write strOrigValue & "if"

response.End

else

response.Write trim(strOrigValue) & "else"

response.End
end if

==================

If not NULL, then perhaps it's blank, or a space. I tried this:

if Trim(strOrigValue) = "" then

response.Write strOrigValue & "if"

response.End

else

response.Write trim(strOrigValue) & "else"

response.End
end if

=====================

In both cases, I ended up with "else" being displayed. I am at a loss here.
Is there something else I can check for that will make it fall into the "if"
part of the statement?
Try Response.Write TypeName(strOrigValue)

If that doesn't light a bulb somewhere, show the code that generates
the variable's value.

--
Mike Brind

Sep 11 '06 #3

Mike Brind wrote:
Middletree wrote:
At first glance, the question in the subject line seems way too easy. But I
am finding some situations in my app where the value in a variable is some
sort of blank-like value, such as Null or " " or "", but I cannot tell
which.

Of course, in order to find out the value, I did a response.write, and added
a nonsense word afterward, to help make sure it is writing it out for me.

First, I tried to check for null:

if IsNull(strOrigValue) then

response.Write strOrigValue & "if"

response.End

else

response.Write trim(strOrigValue) & "else"

response.End
end if

==================

If not NULL, then perhaps it's blank, or a space. I tried this:

if Trim(strOrigValue) = "" then

response.Write strOrigValue & "if"

response.End

else

response.Write trim(strOrigValue) & "else"

response.End
end if

=====================

In both cases, I ended up with "else" being displayed. I am at a loss here.
Is there something else I can check for that will make it fall into the "if"
part of the statement?

Try Response.Write TypeName(strOrigValue)

If that doesn't light a bulb somewhere, show the code that generates
the variable's value.
Oh, and if the result of the above is Empty, check the spelling of the
variable name where it gets its value assigned.

--
Mike Brind

Sep 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Thomas Mlynarczyk | last post by:
Hi, I want to pass a variable to a function and that function should display both the value and the name of that variable. As for the value - no problem, but the name? So far I've come up with ...
22
by: Richard | last post by:
I've really tried searching for this before I thought of bother you guys with this question. It's such a simple thing, but it's driving me nuts! Is it possible to check if an int (or any other...
13
by: mike | last post by:
I have ListArray with number in Eg: 1, 1.456, 2.43, 4, 6.78 next i have a decimal variable containing one number EG: 1.786 Could someone please tell me how i find the "closest match" number...
10
by: ksrajalakshmi | last post by:
Hai , in a textbox am having text as "(20/100)+pay1*pay2" .it's a formula. and stored in a particular variable. string strformula="(20/100)+pay1*pay2" ; i've to substitute the value of the...
2
by: Sean | last post by:
I am using a GridView to display and edit rows of data. I am having problems with one of my GridViews that has a Calendar control in it. If the data coming back from the DB doesn't have a date for...
3
by: skbaskar | last post by:
Hi All, I am new to vb and i tried a macro in word to find the paragraph indents and insert some tag for that indented text for e.g. indent 0.5 to 0.75 to be coded as <indent1> and 0.76 to 1.00 as...
5
by: YaoBao | last post by:
Is any ColdFusion script I can put on my webpage that will create a search bar so people can type keywords to match it on the current page in my website? It will be exactly like the finder search bar...
3
by: Abhinavnaresh | last post by:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. ...
6
by: =?Utf-8?B?UGhpbA==?= | last post by:
I have seen the samples for Find that explain how to use the predicate, but they are always searching for a pre-defined value. What I don't understand is how to search for a random value stored in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.