473,785 Members | 2,767 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JScript and VBscript

If I have a .ASP page that runs JScript code - is it possible to include an
..ASP page that runs VBscript???
Jul 19 '05
29 6032
"Dave Anderson" wrote:
"Roland Hall" wrote:

If you do not know there is an execution order and you DO NOT
put all non-default language script in subroutines called from
inline script then you can get in trouble.
Define trouble.

Code not executing in the order you wanted it to?
I think anyone with rudimentary troubleshooting skills can mix languages in ASP without "getting in trouble". I would further suggest that someone
willing to use two languages is already savvy enough to explore the inherent issues to a point of reasonable understanding. One does not define the other however, you did say 'suggest.' Using two
languages does not prove you know them. Also, knowing the two languages, in
this case JScript/Javascript and VBScript does not mean you understand the
order of execution of the ASP processor.
But more to the point, order of execution is just SOMETHING TO KNOW about
ASP. That's all I have been saying. It is better to know than not know. From
now on, I'm drawing pictures. (O:=
If you create an instance of something with VBScript and don't know
that you're supposed to later set the variable reference to Nothing, you can get in trouble. Define trouble. (O:=
The same is true if you don't wear a condom.
If you put objects into session or application variables,
you can get in trouble, Define trouble. (O:=
The same is true if you don't call her the next day.
whether you know it or not. n/a
If you don't understand
the difference between an object and its default property, you can get in
trouble. Define trouble. (O:=
The same is true if you don't know the difference between your *ss and a
hole in the ground.
BFD. It could be.
Mixing scripting languages doesn't have to be intuitive, it merely
should be documented. The Bible has been around for many years but how many cannot recite the 10
commandments?
There is a lot of documentation out there you and I have not read. Just
because it is documented doesn't mean it is known by the person trying to
implement it. None of my ASP books actually reference the execution order,
AFAIK. I read a post in here long ago and found out that way. I don't use
runat=server so I have never experienced this issue but it was by chance,
not by knowledge, even though it has been documented since 1998.
And it is:
http://msdn.microsoft.com/library/de..._vbnjscrpt.asp
Perhaps Microsoft thought it was necessary for people to KNOW?!
My point is that people should understand the technology they are using, I agree but you cannot know everything. This NG demonstrates that even the
most seasoned developer sometimes has to ask for help.
and
the existence of the FAQ is not inconsistent with that or anything else I
have said in this thread.

It's not just a river in Egypt anymore. (O:=

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.

-Technet Script Center-
http://www.microsoft.com/technet/tre...er/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #21
"Roland Hall" "wrote":

Define trouble. Code not executing in the order you wanted it to?


That can happen in many programming scenarios. This "order of execution"
setting is not unique in that regard.

Using two languages does not prove you know them.
Yawn. My point remains. If you're willing to use a tool without knowing what
it does, that's your problem. If you can't spend a little time learning
about the technology you're using, then I certainly have little sympathy for
you when things turn out unexpectedly.

In my opinion, a programmer without curiousity is a drone.

That's all I have been saying. It is better to know than not know.


That's NOT all you have been saying. You started by questioning my assertion
that execution order can be rendered moot with a simple approach. Remember
this?

DAVE: Curiously enough, this can be "circumvent ed". A
function (or Function or Sub) can be called from
any block regardless of which one defines it --
and regardless of the "execution order".

ROLAND: Ok but wouldn't that require having knowledge
of the order of execution?

MARK SCHUPP: No.

I outlined a means by which you can eliminate the entire issue of execution
order, and by which virtually all of the potential shortcomings of mixed
languages could be solved. You didn't bother to test my assertion before
throwing out a "rebuttal"* *. Doing so would have saved us all the rest of
this conversation.
**In this case, a "Yeah-buttal", and a weak one at that. I *did* phrase it
quite unambiguously. What do you suppose I meant by [regardless of the
"execution order"]?

Mixing scripting languages doesn't have to be intuitive, it
merely should be documented.


The Bible has been around for many years but how many cannot
recite the 10 commandments?


Please cease the non sequitur barrage.
--
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. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #22
> you can get in trouble. How difficult is that for you to understand?
Mark
obviously knows about the execution order and thus uses this coding
methodology. Where is the crime in letting others know WHY you should try
Actually I don't know the actual execution order and I don't care. Always
TELL the computer what YOU want it to do, never hope that things will just
work out.

It should be simple enough to determine the actual execution order by
experimentation (documentation is not always correct anyway). Probably could
have been done in 10% of the time spent on this discussion thread.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Roland Hall" <nobody@nowhere > wrote in message
news:ee******** ******@TK2MSFTN GP10.phx.gbl... "Dave Anderson" wrote:
And your point is wrong. If you follow Mark's advice, you CANNOT get in
trouble, regardless of whether you know the order of execution or not.
If you do not know there is an execution order and you DO NOT put all
non-default language script in subroutines called from inline script then
you can get in trouble. How difficult is that for you to understand?

Mark obviously knows about the execution order and thus uses this coding
methodology. Where is the crime in letting others know WHY you should try
to do it the way Mark suggested? I know you prefer the "Dave Anderson, Just Follow Me Blindly Method" but where is the education in that? Your
methodology doesn't work.

301 Error.
Dave's Response: Problem with your keyboard, go into the BIOS setup and
disable checking for the keyboard. You'll never experience this error
again. Don't ask questions. This is a need to know basis and I don't think you need to know. You'll never need to know why if you just do as I say.

User replaces keyboard and still experiences same error. Perhaps it's not
plugged in? Educating the user in this case might be beneficial?! Perhaps the color-coded ps/2 ports, the mouse and keyboard are plugged into, might
be reversed?! Or maybe the user's keyboard is wireless and the batteries
are dead?!

Educating someone as to WHY something should try to be done a certain way to avoid possible errors is a good thing. Not educating someone as to WHY and the possible errors that could occur is just plain dumb. If Aaron has a FAQ re: this issue, perhaps there are a lot of people that need some education
regarding issues with the execution order of mixed-language server-side
script blocks with inline script and how to avoid them?!

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.

Jul 19 '05 #23
"Mark Schupp" wrote:
you can get in trouble. How difficult is that for you to understand? Mark
obviously knows about the execution order and thus uses this coding
methodology. Where is the crime in letting others know WHY you should

try
Actually I don't know the actual execution order Since it was in my first post in this thread, that is a false statement.
and I don't care. Always
TELL the computer what YOU want it to do, never hope that things will just
work out. Telling the computer runat=server in the default lang. before the
non-default lang. will not work because the ASP processor has its own
execution order so it must be in a sub/function and called from inline
script to avoid issues.
It should be simple enough to determine the actual execution order by
experimentation (documentation is not always correct anyway).

Ah! Ok. Words of wisdom. Well, then why ask questions in a NG if
experimentation will make you all-knowing...and forget about the docs,
they're unreliable.

Order of execution is important even on the client-side and not everyone is
a seasoned developer. It's BS to tell someone, "Just keep pluggin' away,
you'll get it and forget about the docs, they're unreliable."

Ex.
This doesn't work - mismatch error

<SCRIPT LANGUAGE="VBScr ipt">
function doubledNumber(a Number)
doubledNumber = doubleMe(aNumbe r)
end function
document.write( "The answer is " & doubledNumber(" 2"))
</SCRIPT>

<SCRIPT LANGUAGE="JScri pt">
function doubleMe(aNumbe r){
return aNumber * 2;
}
</SCRIPT>

Change the order of the script blocks and it works:

<SCRIPT LANGUAGE="JScri pt">
function doubleMe(aNumbe r){
return aNumber * 2;
}
</SCRIPT>
<SCRIPT LANGUAGE="VBScr ipt">
function doubledNumber(a Number)
doubledNumber = doubleMe(aNumbe r)
end function
document.write( "The answer is " & doubledNumber(" 2"))
</SCRIPT>

It's modified a bit but not much. It's from some documentation from
Microsoft. It must be unreliable.

http://msdn.microsoft.com/library/en...rpt_servscript

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.

-Technet Script Center-
http://www.microsoft.com/technet/tre...er/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #24
"Roland Hall" "wrote":

This doesn't work - mismatch error

[client-side example]
That's irrelevant. This is an ASP forum, and the discussion has focused on
the behavior of asp.dll, not on that of a client-side browser. I note that
your code generates no errors for the following browsers (vacuously, of
course):

Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.5) Gecko/20031007
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2) Opera 7.11 [en]

In any case, it's unreasonable to assume you know the implemetation of
scripting support for every version of every browser. We *do* know and have
reasonable expectation of continued support for the behavior of asp.dll, and
that is the only thing that matters in here.

Change the order of the script blocks and it works:
Same fallacy...
It's modified a bit but not much. It's from some documentation
from Microsoft. It must be unreliable.


Cute. You quote an article titled "Using VBScript and JScript on a Web
Page", which specifically warns that this example ill not work. Rather than
show mixed scripting behavior to be "unreliable ", you provide the evidence
that the documentation is correct for both the asp.dll behavior and for
Internet Explorer's client-side behavior.

Offering evidence that your argument is wrong is perhaps not the textbook
way of persuading people, but it *does* have the attraction of novelty.

--
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. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #25
You know what Dave, you exhaust me. I just deleted all my responses because
it's a dead horse and you obviously have an agenda. So, Happy New Year.

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.

-Technet Script Center-
http://www.microsoft.com/technet/tre...er/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #26
Dave Anderson wrote:
"Roland Hall" wrote:
Be aware of the execution order...


Curiously enough, this can be "circumvent ed". A function (or Function or
Sub) can be called from any block regardless of which one defines it -- and
regardless of the "execution order".


[posted after Roland became "exhausted"]

The above is a good methodology to follow to prevent confusion. However...

If one were given working code already in production and written by
developer(s) who freely mixed code in different languages without doing
what you describe above, then it would be _necessary_ to be aware of the
subtleties of execution order. Were one to encounter such code a good
first step would be to refresh one's memory on execution order and then
_possibly_ set about refactoring the code in the manner you describe
above. I say "possibly" because there's _always_ a cost and some danger
in modifying working code!

[Meta-observation about this thread:]
This was a very interesting thread for me because I hadn't revisited the
topic in some time and also because of the delightful fact that _all_
parties were presenting correct information and and useful examples but
nonetheless were arguing. For that reason I'm glad that they persisted
even though they seemed somewhat puzzled by each other's posts.

I think Dave's post (above) marks a point whereafter the thread becomes
inadvertently contentious. As the topic unfolds, Roland, Dave and Mark
present useful and interesting information and examples. Had all three
been in the same room discussing the question, any differences would
have been quickly resolved, assumptions more clearly laid out and
misunderstandin g more easily avoided. But those of us not in that same
room would never have heard the discussion and would have remained less
enlightened. So thank you!
[End Meta-observation]

Good Luck and Happy New Year to all,
Michael D. Kersey

Programmer's Threat(accompan ied by musical theme from "The Good, The
Bad, and the Ugly"): "Touch that code and you own it!"

Jul 19 '05 #27
"Michael D. Kersey" wrote:

If one were given working code already in production and
written by developer(s) who freely mixed code in different
languages without doing what you describe above, then it
would be _necessary_ to be aware of the subtleties of
execution order.


If you are suggesting that it would be necessary to be aware of those
subtleties beforehand, I'm not sure I agree, but you do underscore my point
that we should understand the technology we use.

Were I in such a situation, my A PRIORI analysis would almost certainly
alert me to the fact that such subtleties exist, and I would either search
for documentation or test my assumptions to reach clarity on the issue.

In any case, I agree that such awareness necessarily must precede the work.
--
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. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #28
"Michael D. Kersey" wrote:
: Dave Anderson wrote:
: > "Roland Hall" wrote:
: >
: >>Be aware of the execution order...
: >
: > Curiously enough, this can be "circumvent ed". A function (or Function or
: > Sub) can be called from any block regardless of which one defines it --
and
: > regardless of the "execution order".
:
: [posted after Roland became "exhausted"]
:
: The above is a good methodology to follow to prevent confusion. However...
:
: If one were given working code already in production and written by
: developer(s) who freely mixed code in different languages without doing
: what you describe above, then it would be _necessary_ to be aware of the
: subtleties of execution order. Were one to encounter such code a good
: first step would be to refresh one's memory on execution order and then
: _possibly_ set about refactoring the code in the manner you describe
: above. I say "possibly" because there's _always_ a cost and some danger
: in modifying working code!
:
: [Meta-observation about this thread:]
: This was a very interesting thread for me because I hadn't revisited the
: topic in some time and also because of the delightful fact that _all_
: parties were presenting correct information and and useful examples but
: nonetheless were arguing. For that reason I'm glad that they persisted
: even though they seemed somewhat puzzled by each other's posts.
:
: I think Dave's post (above) marks a point whereafter the thread becomes
: inadvertently contentious. As the topic unfolds, Roland, Dave and Mark
: present useful and interesting information and examples. Had all three
: been in the same room discussing the question, any differences would
: have been quickly resolved, assumptions more clearly laid out and
: misunderstandin g more easily avoided. But those of us not in that same
: room would never have heard the discussion and would have remained less
: enlightened. So thank you!
: [End Meta-observation]
:
: Good Luck and Happy New Year to all,
: Michael D. Kersey
:
: Programmer's Threat(accompan ied by musical theme from "The Good, The
: Bad, and the Ugly"): "Touch that code and you own it!"

Hi Michael...

Good observation. I think we actually agreed more than we disagreed. Dave
thinks it is good to 'know the code you are developing in' and I think
informing someone of how something works is part of that. That sounds the
same to me but what do I know?

Had we been in the same room, perhaps it would have been more academic and
more evident or perhaps more adjectives would have been used?! So,
whichever your perspective, Dave is wrong! *roar* ...runs out laughing...
Happy New Year!

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.

-Technet Script Center-
http://www.microsoft.com/technet/tre...er/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp

Jul 19 '05 #29
"Roland Hall" wrote:

...whichever your perspective, Dave is wrong!


My New Year's resolution is to stop being wrong, no matter what your
perspective.

--
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. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #30

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

Similar topics

20
5974
by: Harag | last post by:
Hi All. I'm stating out doing some web developing. I was wondering which of the server side languages should I concentrate on and learn. I Know CSS, HTML, T-SQL I can look at the client javascript code and work out what it does but I can't really write it from scratch.
4
5865
by: Harag | last post by:
Hi All I currently thinking of converting from my little knowledge of VBscript to jScript ASP. With this in mind I'm looking at my current code to see how it will convert over to Jscript. One thing I have spotted that I can't think of a way round is the ADO recordset.GetRows command.
15
5465
by: Laser Lu | last post by:
In ASP and CGI, which one would be executed more fast and has the better execution efficiency in IIS? And how about writing CGI in VB? -- Best regards, Laser Lu
3
2248
by: Christopher Brandsdal | last post by:
Hi! Maby this is wring newsgroup.. I'm using ASP / VBscript on my own cms system, but I needed to use some jscript to make something work... I'm new to jscript, so here is a simple question: (1) I want to count how many characters there is in a string. In ASP I just use <%=Len(Variabel)%> How do I do this in Jscript?
10
2059
by: Christopher Brandsdal | last post by:
I have this string: /sites/binaer/demo/fil/Winnie-the-Pooh 1024x768.jpg If I wanted to cut everything before Winnie-the-Pooh 1024x768.jpg, how would I do this? In VBScript I could find the first "/" from the back of the sentence, and cut everything before that, but I'm not shore how to do this in JScript...
7
1557
by: joe | last post by:
I am having problems checking for the value of an XMLDOM object . Lets say my XMLDOM object was successfully created as objXMLDoc, and that has several nodes on it. In the case of a VBScript loop like below: '------------------- For x = 1 To 10 Set oItemPrice = objXMLDoc.selectSingleNode("//Item/Price")
7
1433
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - What is JScript? ----------------------------------------------------------------------- JScript is Microsoft's implementation of ECMAScript. Questions that are specific to Microsoft's JScript may also be appropriately asked at: microsoft.public.scripting.jscript
2
4566
by: tunk | last post by:
I dont know where to start my question so let me tell you my story :) The ASP that cause me trouble is running on IIS that set ASP default language to JScript instead of VBScript. This ASP page is popped up by another ASP page and there are authentication, privilege and security stuff involved. And yes this page contain a lot of javascript. there is a <DIV></DIV> in this page for me. And my job is as simple as put another page between...
1
3477
by: Andrew Wan | last post by:
How can VBScript code access JScript code variables in the same ASP page? <SCRIPT LANGAUGE="VBScript"> Dim a a = 10 </SCRIPT> <SCRIPT LANGUAGE="JScript"> Response.Write(a); </SCRIPT>
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10329
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10152
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.