running ASP inside VBscript

J

Jacques Koorts

hi,

is it possible?

i tried this and it does not work:

sub main()

<%

%>

end sub


I want to run ASP in a subroutine if that is possible.

thanks
jacques
 
S

Steven Burn

VBScript IS ASP (in a sense anyway)...... tis what you use to write asp
pages ;o)

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Personal favourites

WebGrid - www.webgrid.co.uk
Freeware Arena - www.freewarearena.com
Freeware Home - www.freewarehome.com
Freeware Outpost -
http://free.hostdepartment.com/f/freewareoutpost/index2.html
ZeroPlus2 - http://zp2.it-mate.co.uk
Fort Freeware - http://freeware.quantum.2ya.com/
Pricelessware - http://www.pricelessware.org
El-Mambo - http://www.el-mambo.net/
Practically Nerded - http://mvps.org/PracticallyNerded/
Bugs, Glitches n stuff - http://mvps.org/inetexplorer/Darnit.htm
Calendar of Updates - http://www.dozleng.com/updates/index.php?&act=calendar
Seniority - http://www.seniority.co.uk
Remembering Dunblane - http://www.dunblane.braveheart.com/
Echo Echo - http://www.echoecho.com/
 
C

Chris Barber

In what context?

ASP code is only executed by a webserver processing an .asp page - it recognises the extension and
passes it to the ASP script parser that then executes the code and passes the resultant document
back for further processing and to be served to the web client.

Chris,

hi,

is it possible?

i tried this and it does not work:

sub main()

<%

%>

end sub


I want to run ASP in a subroutine if that is possible.

thanks
jacques
 
A

Aaron Bertrand [MVP]

You can't mix server- and client-side script like that. In addition, this
has absolutely NOTHING to do with databases. Please use more care in
choosing your groups.
 
S

SpaceGirl

Steven Burn said:
VBScript IS ASP (in a sense anyway)...... tis what you use to write asp
pages ;o)

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Well... no... Vbscript is one language that ASP supports. There are two...
VBS and JScript. With ASP.NET, you have C#.NET, J++.NET, VB.NET, C++ and C
to play with as well.
 
A

Aaron Bertrand [MVP]

Well... no... Vbscript is one language that ASP supports. There are two...
VBS and JScript.

Actually, it is more than two (e.g. perlscript, basically any COM-compliant
language)... but only those two are in mainstream use.
 
A

Andy Dingley

is it possible?
Yes.

i tried this and it does not work:

sub main()

<%

%>

end sub

You have the ASP code markers the wrong way round. Here's an example
that works. :


<html>
<body>

<p>With Response.Write
<%

Sub f1
Response.Write "Woof bark donkey"
End Sub

f1
%>


<p>With nesting
<%

Sub f2
%>
Woof bark donkey
<%
End Sub

f2
%>

</html>


Be warned though that this coding style can esily become unreadable.

PS - and ditch VBScript in favour of JScript
 
A

Aaron Bertrand - MVP

PS - and ditch VBScript in favour of JScript

You might want to explain why. Or else you might as well tell him to ditch
his ranch for a colonial and his Toyota for a Honda.
 
J

Jacques Koorts

Thanks Andy for the quite funny example.

I'll go try it out tonight.

cheers
jk
 
A

Aaron Bertrand - MVP

How about this: Only Internet Exploror supports VBScript.

Sorry, the browser doesn't care what language you use in ASP, because the
browser doesn't see ASP.
 
A

Andy Dingley

Well, I really see no convincing argument that dictates that everyone
running VBScript should ditch it for JScript.

It's like knowing why RSS 1.0 is better than RSS 2.0 -- if you don't
get it, you don't get it.

"Personally, I prefer VBScript. I like its more English-like syntax,
its error handling, and collection enumeration".

So since when did VBScript have error handling that's even as good as
VB ?

And when did JScript lose its collection enumerator ?

Neither VBScript nor JScript do collection enumeration anyway -
Collections are a COM artefact, not a language feature, and the
enumerator comes along with the deal. You can enumerate collections in
any language that can bind itself to the collection.
 
C

Chris Barber

Ahh - but when you can write perfect code you don't need error handling.

LoL.

Chris.

Well, I really see no convincing argument that dictates that everyone
running VBScript should ditch it for JScript.

It's like knowing why RSS 1.0 is better than RSS 2.0 -- if you don't
get it, you don't get it.

"Personally, I prefer VBScript. I like its more English-like syntax,
its error handling, and collection enumeration".

So since when did VBScript have error handling that's even as good as
VB ?

And when did JScript lose its collection enumerator ?

Neither VBScript nor JScript do collection enumeration anyway -
Collections are a COM artefact, not a language feature, and the
enumerator comes along with the deal. You can enumerate collections in
any language that can bind itself to the collection.
 
A

Aaron Bertrand [MVP]

So since when did VBScript have error handling that's even as good as

When did the comparison become between VBScript and VB? Do you write ASP
pages in VB? Tell us about JavaScript's or JScript's error handling
abilities in ASP?
And when did JScript lose its collection enumerator ?

Where did I say JScript didn't have one? I said I prefer VBScript's. For
each x in something is a lot more intuitive than var(crap = new enumerator;
blah blah). Remember, the article is my opinion, ignore it if you want, but
don't come outright and say "you should trash VBScript and use JScript
instead" without expecting to be challenged and to back it up.
You can enumerate collections in
any language that can bind itself to the collection.

Again, my point is not about whether enumeration exists. Any language would
be dead without it, of course. The proof is in the pudding. Ask any
developer which enumeration syntax he/she can remember off the top of
his/her head...
 
A

Aaron Bertrand [MVP]

I will not post again in this thread, it is obviously futile. To reiterate
the point of the article I pointed out, instead of defending someone's
effort to tear it to pieces, here are the truths you should glean from it:

(a) VBScript is not empirically "better" than JScript
(b) JScript is not empirically "better" than VBScript

Both languages have a set of pros and cons, each of which may have its own
priority in your major web house or home office or anything in between. So
what's "better" for you might not necessarily be

Again, a statement like "JScript is better than VBScript" is quite obtuse
and heavily biased, and without pointing out the reasons behind your
opinion, you're giving the amateur reader a very unfair representation.

The point of the article is that the choice is subjective and is geared more
towards your preference and background/experience than to some guy on a
newsgroup trying to tell you to drop VBScript because JScript is so much
cooler.
 
S

SpaceGirl

Aaron Bertrand said:
When did the comparison become between VBScript and VB? Do you write ASP
pages in VB? Tell us about JavaScript's or JScript's error handling
abilities in ASP?


Where did I say JScript didn't have one? I said I prefer VBScript's. For
each x in something is a lot more intuitive than var(crap = new enumerator;
blah blah). Remember, the article is my opinion, ignore it if you want, but
don't come outright and say "you should trash VBScript and use JScript
instead" without expecting to be challenged and to back it up.


Again, my point is not about whether enumeration exists. Any language would
be dead without it, of course. The proof is in the pudding. Ask any
developer which enumeration syntax he/she can remember off the top of
his/her head...

You should be aware then, that VB is being phased out by Microsoft. Their
preffered platform is C#.NET (ASP.NET), or if you must VB.NET (ASP.NET)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top