sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
megandelune@yahoo.com's Avatar

ASP simple explanation anyone


Question posted by: megandelune@yahoo.com (Guest) on July 24th, 2005 12:46 AM
I have been learning ASP from a book I bought a week ago and so far it
is very informative, but I seem to be confused on one simple term.
Variant. Now I learned how to declare a varible with the dim keyword,
and now I learned about subtypes and how to add values for my varible,
but everytime they show an example they go from varible to the word
variant. Now I know the definition of variant in the asp world, but I
am confused cause, are they refering to my varible as a variant? Are
they the same thing?

Can someone give me a yes or no answer.

thanks

meg

2 Answers Posted
Adrienne's Avatar
Guest - n/a Posts
#2: Re: ASP simple explanation anyone

Gazing into my crystal ball I observed Join Bytes! writing in
news:1110494435.112328.98330@g14g2000cwa.googlegro ups.com:
[color=blue]
> I have been learning ASP from a book I bought a week ago and so far it
> is very informative, but I seem to be confused on one simple term.
> Variant. Now I learned how to declare a varible with the dim keyword,
> and now I learned about subtypes and how to add values for my varible,
> but everytime they show an example they go from varible to the word
> variant. Now I know the definition of variant in the asp world, but I
> am confused cause, are they refering to my varible as a variant? Are
> they the same thing?
>
> Can someone give me a yes or no answer.
>
> thanks
>
> meg
>
>[/color]

This is a client side group, and you need an ASP server side group.
Followups set.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Andy Dingley's Avatar
Guest - n/a Posts
#3: Re: ASP simple explanation anyone

It was somewhere outside Barstow when Join Bytes! wrote:
[color=blue]
>I have been learning ASP[/color]

Good.
[color=blue]
> from a book I bought a week ago[/color]

Bad.

I really quite like ASP. But I've yet to see any good reference or
tutorial for it. When I first learned it it took a _long_ time before
I realised just how much of it to throw away, and what little of the
core was worth keeping hold of. The trouble is (like nearly all
M$oft products) it's a good core product weighed down by baggage
that's loaded onto it because it fitted some M$oft corporate agenda.

One vital thing to remember is that there's no "ASP language". ASP is
just a container for languages - any language engine that can
co-operate with a pretty simple COM interface can be used from ASP.
Out of the box it ships with VBScript and JavaScript (actually
JScript, a slight variation). Other useful ones to know of are
PerlScript, PythonScript and even COBOLScript (!)

As a general principle, throw VBScript away and just use JScript. It's
a much better language. There is _nothing_ you can do in VBScript that
you can't do (and better) in JScript. It's fundamental to ASP that
any of these languages can do everything external that the others can,
so you have a totally free choice depending on how good the language

M$oft usually have about half-a-dozen "VB" languages on the go at
once. There's VB (it makes Windows desktop apps), VBA (embedded into
Office) and the VBScript you're using with ASP. A few other dialects
too. When reading "VB books", make sure that they either apply to the
version you're using, or you understand the differences.

Of the three, VBScript is considerably cut down. One way it's cut
down is in variable typing. VB allows variable declaration with Dim
and also allows variables to be given types. VBScript doesn't - all
variables are of the "Variant" type (exactly the same as "Dim foo As
Variant" in VB). You can still declare them, or let them be
auto-declared when first used (you should _always_ use Option
Explicit and declare them yourself - it saves a lot of bugs).
[color=blue]
>Now I learned how to declare a varible with the dim keyword,
>and now I learned about subtypes and how to add values for my varible,
>but everytime they show an example they go from varible to the word
>variant.[/color]

So this description isn't an ASP thing, it's a VBScript thing. Be
wary of any book that doesn't realise there's an important difference
between these ! If you don't get their distinction quite clear in
your mind, you'll have a lot of trouble.

In VBScript, every variable is of Variant type. But it's still poorly
worded to mix these two words up in a textbook. A "variant" is not a
"variable" - they're different things; one's effectively an adjective
and the other is a noun. Just because every one of these nouns can be
described by that same adjective doesn't mean that they're "the same
thing".

[color=blue]
>Now I know the definition of variant in the asp world,[/color]

One useful thing about VBScript and ASP is that ASP's only variable
types are the Object and the Variant, and these are also VBScript's
native types (they're actually native types of COM, which underlies
the whole lot). This makes some tasks very simple, because you don;t
have to do any conversion. OTOH, it also makes some VBScript code
inelegant and inefficient, because you can't type more appropriately
if you otherwise could do.



--
Smert' spamionam
 
Not the answer you were looking for? Post your question . . .
196,816 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,816 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors