Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / December 2004

Tip: Looking for answers? Try searching our database.

Finding block begin/end in VBScript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Agoston Bejo - 18 Dec 2004 13:14 GMT
Hi!
I am using VS.NET 2003. In the editor with CTRL+] I can easily find the
closest opening/closing parenthesis. What I'm looking for is the same
functionality for VBScript blocks, e.g. when the cursor stands on an "If...
Then" statement and I press a certain key combination, the IDE should find
the corresponding "End If" statement. Is there something like that in the
VS.NET IDE? (I am editing ASP files actually, which may be a problem,
because e.g. in an ASP file automatic commenting does not work beause of
unkown reasons.)

Thx,
Agoston
Scott M. - 19 Dec 2004 22:26 GMT
VBScript is not used in VB.NET.

> Hi!
> I am using VS.NET 2003. In the editor with CTRL+] I can easily find the
[quoted text clipped - 9 lines]
> Thx,
> Agoston
Agoston Bejo - 20 Dec 2004 00:22 GMT
It's great to know that, but the VS.NET IDE parses and highlights VBScript
blocks, anyway. So, the question still stands: is there a way to find
program block beginnings/endings in ASP/VBScript code?

> VBScript is not used in VB.NET.
>
[quoted text clipped - 11 lines]
> > Thx,
> > Agoston
Scott M. - 20 Dec 2004 20:24 GMT
You have your answer.

> It's great to know that, but the VS.NET IDE parses and highlights VBScript
> blocks, anyway. So, the question still stands: is there a way to find
[quoted text clipped - 18 lines]
>> > Thx,
>> > Agoston
Agoston Bejo - 21 Dec 2004 08:22 GMT
Which is...?

> You have your answer.
>
[quoted text clipped - 20 lines]
> >> > Thx,
> >> > Agoston
Scott M. - 21 Dec 2004 14:18 GMT
VBScript is not used in VB.NET.

....And....so....No....

> Which is...?
>
[quoted text clipped - 29 lines]
>> >> > Thx,
>> >> > Agoston
Mikhail Arkhipov (Microsoft) - 22 Dec 2004 07:36 GMT
VBScript is fully supported in client script blocks as well as in server
script in classic ASP page. However, matching brace search is not supported
for VBScript or Jscript.

Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights

On 12/19/04 16:24, in article ##1H2oi5EHA.1392@tk2msftngp13.phx.gbl,

> It's great to know that, but the VS.NET IDE parses and highlights VBScript
> blocks, anyway. So, the question still stands: is there a way to find
[quoted text clipped - 17 lines]
>>> Thx,
>>> Agoston
Scott M. - 22 Dec 2004 14:14 GMT
It's supported in the sense that you can add it.  It's not supported in the
sense that VS.NET provides any IntelliSense for/with it, beyond color
coding.  VS.NET does not syntax check it, nor does the VB.NET compiler look
at all at this code.

> VBScript is fully supported in client script blocks as well as in server
> script in classic ASP page. However, matching brace search is not
[quoted text clipped - 29 lines]
>>>> Thx,
>>>> Agoston
Mikhail Arkhipov (Microsoft) - 23 Dec 2004 19:06 GMT
VS.NET does provide VBScript intellisense in client script blocks as well as
in server blocks in classic ASP pages. It is not as rich as VB.NET or C#
instellisense, but it is on par with what we do in Jscript/javascript.

You are correct, VBScript cannot be used in ASP.NET (i.e. Aspx/ascx) pages
except in client script blocks. Same applies to classic JScript (not
JSCript.NET).

My team owns VS HTML editor :-)

Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights

On 12/22/04 6:14, in article eH6LbAD6EHA.2196@TK2MSFTNGP14.phx.gbl, "Scott
M." <s-mar@nospam.nospam> wrote:

> It's supported in the sense that you can add it.  It's not supported in the
> sense that VS.NET provides any IntelliSense for/with it, beyond color
[quoted text clipped - 34 lines]
>>>>> Thx,
>>>>> Agoston
Scott M. - 23 Dec 2004 21:52 GMT
> VS.NET does provide VBScript intellisense in client script blocks as well
> as
> in server blocks in classic ASP pages. It is not as rich as VB.NET or C#
> instellisense, but it is on par with what we do in Jscript/javascript.

What intelliSense are you speaking of?  Color coding and what else?

> You are correct, VBScript cannot be used in ASP.NET (i.e. Aspx/ascx) pages
> except in client script blocks. Same applies to classic JScript (not
[quoted text clipped - 50 lines]
>>>>>> Thx,
>>>>>> Agoston
Mikhail Arkhipov (Microsoft) - 24 Dec 2004 00:58 GMT
1. Create new HTML page (or a Web Form)
2. Switch default client script to VBScript using document object in the
property grid.
3. Add a client script block.
4. In the script block type

document.

Observe intellisense dropdown with document properties.

You can add an HTML element, assign ID to it (say, ID="foo") and then type

Foo.

Observe properties available for this element.
5. Open existing ASP page or create a new HTML page and rename it to ASP.
(You may have to close and reopen the document). Add a server script block
or <% %> block.
6. Inside server script type

Server.

Observe properties of the ASP Server object.

7. You can also get intellisense for ActiveX control properties provided
control contains property structured and registered type library.

Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights

On 12/23/04 13:52, in article e5dBMlT6EHA.2032@tk2msftngp13.phx.gbl, "Scott
M." <s-mar@nospam.nospam> wrote:
Scott M. - 24 Dec 2004 02:25 GMT
But none of these examples have anything to do with VBScript.  You've shown
examples of how intelliSense is available with the Document Object Model and
the ASP 3.0 Object Model, not the VBScript language.

I could just as well be using JavaScript on the client and server and get
the same intelliSense.  What you've shown is language independent.
"Document" is not a part of the VBScript language, nor is "Server".

> 1. Create new HTML page (or a Web Form)
> 2. Switch default client script to VBScript using document object in the
[quoted text clipped - 29 lines]
> "Scott
> M." <s-mar@nospam.nospam> wrote:
Mikhail Arkhipov (Microsoft) - 24 Dec 2004 04:45 GMT
But it is not quite 'just color coding' right? ;-) It works like
intellisense, it looks like intellisense... :-)

Which elements are missing? String type does get intellisense. Type

Document.all.toString.

You will see String object methods and properties - they are part of the
language, not HTML DOM. Could you please provide an example what you expect?

Thanks

Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights

On 12/23/04 18:25, in article uKD4g9V6EHA.1188@tk2msftngp13.phx.gbl, "Scott
M." <s-mar@nospam.nospam> wrote:

> But none of these examples have anything to do with VBScript.  You've shown
> examples of how intelliSense is available with the Document Object Model and
[quoted text clipped - 37 lines]
>> "Scott
>> M." <s-mar@nospam.nospam> wrote:
Bob Barrows [MVP] - 24 Dec 2004 13:07 GMT
I would think that if the user gets prompted for the arguments for MsgBox
that would answer Scott's question. so I tried it.

After I added a vbscript script block, I typed Msg and hit ctrl-space, and
sure enough, the autocomplete completed the MsgBox word. Good sign. So I hit
space, and sure enough, i was prompted for the arguments. I entered the
prompt text, typed a space, expecting to see a dropdown containing the
vbscript constants for the buttons. However, it did not appear. However, I
typed vb and pressed ctrl-space, at which point I got a dropdown allowing me
to select from a lot of choices, unfortunately many of which were not
applicable. However, this is the same behavior seen in VI6, so I don't see
any lost functionality here.

I aslo tested InStr and got the same behavior.

Bob Barrows

> But it is not quite 'just color coding' right? ;-) It works like
> intellisense, it looks like intellisense... :-)
[quoted text clipped - 61 lines]
>>> "Scott
>>> M." <s-mar@nospam.nospam> wrote:

Signature

Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Scott M. - 24 Dec 2004 16:43 GMT
>I would think that if the user gets prompted for the arguments for MsgBox
>that would answer Scott's question. so I tried it.

Isn't MsgBox supported in VB.NET...I think it is.

> After I added a vbscript script block, I typed Msg and hit ctrl-space, and
> sure enough, the autocomplete completed the MsgBox word. Good sign. So I
[quoted text clipped - 7 lines]
>
> I aslo tested InStr and got the same behavior.

What I'm saying is that VS.NET is reacting to those various functions and
keywords because they are a part of the VB.NET language, not because they
are part of VBScript.

I just don't see anything in VS.NET that provides VBScript support.  I onlly
see VS.NET jumping to attention when a VB.NET keyword is used.  You,
yourself mentioned that VBScript specific items (like constants) are not
provided, while elements that are part of VB.NET are recognized.

> Bob Barrows
>
[quoted text clipped - 63 lines]
>>>> "Scott
>>>> M." <s-mar@nospam.nospam> wrote:
Bob Barrows [MVP] - 24 Dec 2004 16:53 GMT
>> I would think that if the user gets prompted for the arguments for
>> MsgBox that would answer Scott's question. so I tried it.
>
> Isn't MsgBox supported in VB.NET...I think it is.

Duh! My bad.

I just tried FormatDateTime (which definitely is not part of VB.Net - it's
not part of VB6 either) and intellisense worked correctly.

Bob Barrows
Signature

Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Scott M. - 25 Dec 2004 03:38 GMT
I hate to break it to you Bob, but FormatDateTime was, in fact, part of VB 6
and VBScript and has been carried into VB.NET as well.  So, you are showing
a different example of the same thing I referred to earlier.

>>> I would think that if the user gets prompted for the arguments for
>>> MsgBox that would answer Scott's question. so I tried it.
[quoted text clipped - 7 lines]
>
> Bob Barrows
Bob Barrows [MVP] - 25 Dec 2004 13:56 GMT
Sigh. I never used it (Format() was so handy) so I forgot it was there.
However, the Execute method definitely was not in VB/VBA (I checked the docs
to be sure this time), and intellisense in vs.net worked for it as well.

But I think we're beating a dead horse by now...

Bob Barrows

> I hate to break it to you Bob, but FormatDateTime was, in fact, part
> of VB 6 and VBScript and has been carried into VB.NET as well.  So,
> you are showing a different example of the same thing I referred to
> earlier.

Signature

Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Mikhail Arkhipov (Microsoft) - 25 Dec 2004 01:50 GMT
Trust me, VB.NET compiler has nothing to do with VBScript intellisense. It
is not even loaded. Intrinsic types come from vbscript.dll (VBScript engine,
same component as in IE). We (VS HTML editor) provide engine with
additional type libraries for the browser DOM and classic ASP server
components.

In VS 2003 VB.NET intellisense does not exist in ASPX pages, it only works
in code-behind VB files. It was technically impossible to get VB.NET
intellisense in Web Forms. In VS 2005 it was a major work item  to make VB
and C# intellisense work in server script blocks. Patents were filed on the
architecture.

Yes, VBScript support is unchanged since VID6. If you feel that anything is
missing, please file a bug on MSDN feedback site, we should not regress the
functionality. If you think support should be improved, again, file a bug.

As for Variant, actually variant carries type designator in it. Although all
variables seem to lok the same, intellisense engine in some cases is able to
detect type of the variant. For example, toString() actually returns BSTR
which is stored in a variant of type VT_BSTR.

In VS 2003 simple color coding is provided for C# and VB.NET in server
script blocks in ASPX/ASCX files. No intellisense of any kind is provided.

Thanks

Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights

On 12/24/04 8:43, in article eW#v4cd6EHA.2196@TK2MSFTNGP14.phx.gbl, "Scott
M." <s-mar@nospam.nospam> wrote:

>> I would think that if the user gets prompted for the arguments for MsgBox
>> that would answer Scott's question. so I tried it.
[quoted text clipped - 89 lines]
>>>>> "Scott
>>>>> M." <s-mar@nospam.nospam> wrote:
Scott M. - 25 Dec 2004 03:43 GMT
I'm not trying to argue Mikhail, so forgive me if I'm being too persistent
here.  I guess my point is this:

When you use VBScript in an .aspx page, you aren't utilizing the ASP.NET
architecture and this is why I say that VBScript is not a part of ASP.NET.

I'm sure that what you say about the VS HTML editor is true, but the bottom
line is that the only intelliSense I can see when using VBScript is
color-coding and parameter list tool-tips for items that just happen to also
exist in VB.NET.

The other items you spoke of "Server" and "Document.All" are not VBScript
elements, so I exclude them from the conversation.

Happy holidays!

> Trust me, VB.NET compiler has nothing to do with VBScript intellisense. It
> is not even loaded. Intrinsic types come from vbscript.dll (VBScript
[quoted text clipped - 134 lines]
>>>>>> "Scott
>>>>>> M." <s-mar@nospam.nospam> wrote:
Scott M. - 24 Dec 2004 16:38 GMT
> But it is not quite 'just color coding' right? ;-) It works like
> intellisense, it looks like intellisense... :-)

As far as I can tell, it is just color coding.

> Which elements are missing? String type does get intellisense. Type
>
[quoted text clipped - 3 lines]
> language, not HTML DOM. Could you please provide an example what you
> expect?

What part of "Document.all.ToString" is VBScript?  VBScript has only one
data type, variant.  There are sub-types in VBScript to be sure, but it
seems to me that whatever true intelliSense I get while in a script block is
reacting to the keywords and types from VB.NET, not VBScript.

> Thanks
>
[quoted text clipped - 52 lines]
>>> "Scott
>>> M." <s-mar@nospam.nospam> wrote:

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.