[thelist] ASP: DIM var AS ??

Anthony Baratta Anthony at Baratta.com
Wed Jul 2 16:45:09 CDT 2003


At 01:39 PM 7/2/2003, Casey Crookston wrote:
>Hello Listers,
>
>Question: what is the syntax to define a variable as an integer?
>
>I have a VERY simple if then statement:
>
>if cat = cat_id then
>    klass="navigation2"
>else
>    klass="navigation"
>
>Weird thing... ONLY the "else" gets triggered, even when cat and cat_id are
>equal.  I have checked and double checked (even response.wrote the two vars
>to the screen) but for what ever reason klass will never be equal to
>"navigation2".  Ever.  Even when cat = cat_id.
>
>About the only thing I can figure is that cat is being defined as a string
>and cat_id as a number (or vise versa).  So I need to know how to specifiy
>that both are integers.

CInt(cat) = CInt(cat_id)

But if you can't cast either variable, it will break your code.

---
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."



More information about the thelist mailing list