Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Trying to generate an error

Reply
Thread Tools

Trying to generate an error

 
 
Ray at
Guest
Posts: n/a
 
      09-18-2003
Response.Write CInt("x")


Do you have an "On Error Resume Next" in your code?

Ray at work

"DrewM" <> wrote in message
news:%...
> This is a strange request - but I'm trying to generate a Type Mismatch
> error. It's for an example in some documentation.
>
> I was looking for something that would error (like a mathematical equation
> using a string) that could be simply fixed using CInt(). However, the
> strings are getting converted at run time so I can't get the error to

throw!
>
> Any ideas?
>
> Drew
>
>



 
Reply With Quote
 
 
 
 
DrewM
Guest
Posts: n/a
 
      09-18-2003
This is a strange request - but I'm trying to generate a Type Mismatch
error. It's for an example in some documentation.

I was looking for something that would error (like a mathematical equation
using a string) that could be simply fixed using CInt(). However, the
strings are getting converted at run time so I can't get the error to throw!

Any ideas?

Drew


 
Reply With Quote
 
 
 
 
DrewM
Guest
Posts: n/a
 
      09-18-2003
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:...
> Response.Write CInt("x")
>
> Do you have an "On Error Resume Next" in your code?


Thanks Ray. There's no OERN in my page - it's just pretty much an empty
document.

I can get the error by doing something like:

Dim myInt, myString
myInt = 3
myString = "three"

if myInt + myString = 6 Then
response.write "match!"
end if

but I really wanted to do it with numbers so i could then show how CInt
solves the problem.

Any thoughts?

Drew


 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      09-18-2003
Well CInt won't solve the problem if you're using strings, unless you have
numeric strings.

Dim x, y
x = 1
y = "5"
Response.Write x + y

That will work without the need for cint'ing.

What are you trying to do here?

Ray at work



"DrewM" <> wrote in message
news:...
> "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
> news:...
> > Response.Write CInt("x")
> >
> > Do you have an "On Error Resume Next" in your code?

>
> Thanks Ray. There's no OERN in my page - it's just pretty much an empty
> document.
>
> I can get the error by doing something like:
>
> Dim myInt, myString
> myInt = 3
> myString = "three"
>
> if myInt + myString = 6 Then
> response.write "match!"
> end if
>
> but I really wanted to do it with numbers so i could then show how CInt
> solves the problem.
>
> Any thoughts?
>
> Drew
>
>



 
Reply With Quote
 
DrewM
Guest
Posts: n/a
 
      09-18-2003
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:...

> What are you trying to do here?


Heh - fair question

I think endless hours of document writing have fried my brain.
Let me go away and get my thoughts straight.

Thanks for the help.

Drew


 
Reply With Quote
 
Dan Brussee
Guest
Posts: n/a
 
      09-18-2003
On Thu, 18 Sep 2003 17:09:46 +0100, "DrewM" <>
wrote:

>"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
>news:...
>
>> What are you trying to do here?

>
>Heh - fair question
>
>I think endless hours of document writing have fried my brain.
>Let me go away and get my thoughts straight.
>
>Thanks for the help.
>



If you are calling a COM object and do the following:

dim obj, x

set obj = server.createobject("object.thing")
x = 5
obj.SendAnInteger x

This will fail if the parameter in SendAnInteger requries an integer.
This is because all variables in ASP are variants. In this case you
would need to use cint() to satisfy the method interface.


 
Reply With Quote
 
PB4FUN
Guest
Posts: n/a
 
      09-18-2003
Try this
<%
Err.Raise 13,"Type Mismatch"
%>

Gets you this :

Technical Information (for support personnel)

Error Type:
Type Mismatch (0x800A000D)
Type mismatch



Meindert, MCP


> This is a strange request - but I'm trying to generate a Type Mismatch
> error. It's for an example in some documentation.
>
> I was looking for something that would error (like a mathematical equation
> using a string) that could be simply fixed using CInt(). However, the
> strings are getting converted at run time so I can't get the error to

throw!
>
> Any ideas?
>
> Drew
>
>




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to generate a user instance of SQL Server. Only an integratedconnection can generate a user instance. Harlan Messinger ASP .Net 2 03-28-2010 06:51 PM
How to generate warnings when How generate a warning when int is converted to bool or vice versa? PengYu.UT@gmail.com C++ 3 04-06-2006 11:24 PM
How to generate variable labels for same component within a generate loop Weng Tianxiang VHDL 5 02-16-2006 01:45 PM
Trying to generate a list of the subclasses of C Charles Krug Python 5 01-18-2006 11:59 PM
JNI problem - linkage problems trying to generate DLL for Win32 functions... Mary Java 1 10-11-2004 12:31 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57