IntelliSense and #Included VBS file
It's perhaps not the end of the World, but I find it annoying
that I lose IntelliSense when I reference Subs and Functions
I have moved to an #Included file.
Does anyone know of a reasonable way to restore the IntelliSense
feature in this case?
Thanks for your thoughts...
Jim Rodgers
Re: IntelliSense and #Included VBS file
=?Utf-8?B?SmltIFJvZGdlcnM=?= wrote on 14 aug 2007 in
microsoft.public.inetserver.asp.general:
> It's perhaps not the end of the World, but I find it annoying
> that I lose IntelliSense when I reference Subs and Functions
> I have moved to an #Included file.
>
> Does anyone know of a reasonable way to restore the IntelliSense
> feature in this case?
On your server, Jim?
Do servers have IntelliSense features in any case?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Re: IntelliSense and #Included VBS file
"Jim Rodgers" wrote:
> It's perhaps not the end of the World, but I find it annoying
> that I lose IntelliSense when I reference Subs and Functions
> I have moved to an #Included file.
>
> Does anyone know of a reasonable way to restore the IntelliSense
> feature in this case?
Use .asp to name your includes. We use a naming convention like this:
<!-- #include file="MyInclude.VBS.inc.asp" -->
This has many benefits beyond Intellisense. You can see by the filename that
is it an include file written in VBScript. The ASP extension ensures that
asp.dll parses the script if someone correctly guesses the name and path of
the include (in IIS5 and earlier, the default configuration would just
stream the contents of a .inc file as plain text to the requesting browser).
--
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.
Re: IntelliSense and #Included VBS file
"Evertjan." wrote:
> =?Utf-8?B?SmltIFJvZGdlcnM=?= wrote on 14 aug 2007 in
> microsoft.public.inetserver.asp.general:
> On your server, Jim?
>
> Do servers have IntelliSense features in any case?
> --
> Evertjan.
> The Netherlands.
Yes.
I develop ASP Classic files using VBScript and Microsoft
Visual Web Developer 2005 Express Edition ("VWD"). (It's very
much like Visual Studio 2005 -- except it has some additional
features and many, many flaws and bugs. But it's free, and I
can get it on all of the PCs in my lab.)
Anyway, VWD quits giving me IntelliSense for a specific function
or sub written in VBScript as soon as I put it in my "library" file,
which is an ASP file that I reference with an #Include directive.
Eventually, I will decide which of these functions and subs are
"core" utilities, which are somewhat more application-specific,
etc., before I compile them into VB6 DLLs for the betterment of
my life in general.
Meanwhile, I have to keep opening these [included] asp files to
remember the call lists, etc.
It's just now occuring to me -- partly due to the first responses
I got -- that maybe no one else is having this problem. If not,
it may be because no one else is using VWD 2005 Express. So,
is everyone using Visual Studio 2005 ???
There are numerous anomalies with VWD 2005 Express. For
example, IntelliSense will quit working for ADODB-declared
variables if I reference them too many times in the code. And
some objects won't do IntelliSense even when their enumerated
constants -ARE- working okay. It seems not to matter whether
I put the typelib declarations in the [parent] asp file or in the
global.asa file.
As I recall from a ten minute test at 4:00am one morning, the
Visual Studio 2005 design environment doesn't do IntelliSense
for CSS files.
So, does anyone know whether Intellisense should be working
on functions and subs once they have been moved into an
included asp file? Frankly, I don't see how they could unless
there is a declaration process at work -- but I guess that is what
I thought the design environment would do using the #Include
statement as a gianormous clue.
Is my question more clear?
Thank everybody.
Re: IntelliSense and #Included VBS file
"Jim Rodgers" wrote:
> It's just now occuring to me -- partly due to the first
> responses I got -- that maybe no one else is having this
> problem.
Of course we are.
> If not, it may be because no one else is using VWD 2005
> Express. So, is everyone using Visual Studio 2005 ???
No way. VWD 2005 Express rocks for classic ASP. It has great Intellisense
(when it works), the ability to validate against many DOCTYPEs, extremely
customizable auto-formatting, and many other strengths. And the price is
right. So is the disk requirement.
> IntelliSense will quit working for ADODB-declared variables
> if I reference them too many times in the code.
I only get that problem inside the catch {} segments (I do ASP in JScript).
But I have seen it.
> As I recall from a ten minute test at 4:00am one morning, the
> Visual Studio 2005 design environment doesn't do IntelliSense
> for CSS files.
Try it again. It does not do it for <style type="text/css"> declarations,
but files with the CSS extension do trigger Intellisense. Try hitting
[Enter] or [space] inside a rule. I lost the ability to do it with [Enter]
for a couple of months, then accidentally whacked my preferences, and got it
back.
> So, does anyone know whether Intellisense should be working
> on functions and subs once they have been moved into an
> included asp file? Frankly, I don't see how they could unless
> there is a declaration process at work -- but I guess that is
> what I thought the design environment would do using the
> #Include statement as a gianormous clue.
Like I said before, use the .asp extension. If it's used in too many places
to do this immediately, you can always make your .inc file a shell that
#includes one with the .asp extension.
My guess is that they wanted to push the use of ASP.NET, and did not put a
great deal into supporting ASP. Note that there is no way to create a new
ASP script from {File : New File]. You can edit the NewFileItems.vsdir file
in your [Visual Studio 8 : Web : WebNewFileItems] folder. Better still, you
can put your own customized ASP template there. Mine creates an empty
document built around our intranet template, complete with a JScript
directive.
--
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.
Re: IntelliSense and #Included VBS file
"Dave Anderson" wrote:
> "Jim Rodgers" wrote:
> > It's just now occuring to me -- partly due to the first
> > responses I got -- that maybe no one else is having this
> > problem.
>
> Of course we are.
>
> > If not, it may be because no one else is using VWD 2005
> > Express. So, is everyone using Visual Studio 2005 ???
>
> No way. VWD 2005 Express rocks for classic ASP. It has great Intellisense
> (when it works), the ability to validate against many DOCTYPEs, extremely
> customizable auto-formatting, and many other strengths. And the price is
> right. So is the disk requirement.
Great feedback. Thanks, I am encouraged. I will now followup
with some admittedly basic questions, the answers to which will
drastically improve my productivity!
============
> > IntelliSense will quit working for ADODB-declared variables
> > if I reference them too many times in the code.
>
> I only get that problem inside the catch {} segments (I do ASP in JScript).
> But I have seen it.
Thanks, so I am not going crazy (vis-a-vis this issue, anyway.)
==========
> > So, does anyone know whether Intellisense should be working
> > on functions and subs once they have been moved into an
> > included asp file? Frankly, I don't see how they could unless
> > there is a declaration process at work -- but I guess that is
> > what I thought the design environment would do using the
> > #Include statement as a gianormous clue.
>
> Like I said before, use the .asp extension. If it's used in too many places
> to do this immediately, you can always make your .inc file a shell that
> #includes one with the .asp extension.
Dave, I -DO- use the asp extension. Since, I assume, the file
contents are simply inserted into the parent file, I always have
the parent file and the included asp file in "HTML" mode at the
point of inclusion (i.e., at the #Include).
Are you saying I -SHOULD- be getting IntelliSense in the parent
file's VBScript for the subs and functions in the script portions of
the included asp file? This is what I need, but this is not what I
am getting.
In the included asp file, I typically start with <% and end with %>.
Again, this is because I assume the included file is simply inserted
by IIS. Should I, instead, be doing this another way? For example,
(and I never ever do this) should I use this --
...optional HTML elements
<script type="text/vbscript" runat="Server">
...VBScript statements...
</script>
...optional HTML elements
rather than this --
...optional HTML elements
<%
...VBScript statements...
%>
...optional HTML elements
in the included asp file?
The latter is what I do, and it works fine except for the
IntelliSense is 100% NONfunctional.
==============
> Note that there is no way to create a new ASP script from
> {File : New File]. ... Better still, you can put your own
> customized ASP template there. Mine creates an empty
> document built around our intranet template...
Wow. I sure have been doing this the hard way. I was
wondering about that, too. Especially after you said "VWD
2005 Express rocks for classic ASP."
SO, succintly, how do I create and install a custom template
of any sort? (I would like to have multiple templates for plain
HTML and for ASP files.)
============
Thanks, Dave for helping me out!
Jim Rodgers
Re: IntelliSense and #Included VBS file
"Jim Rodgers" wrote:
> Are you saying I -SHOULD- be getting IntelliSense in the parent
> file's VBScript for the subs and functions in the script portions
> of the included asp file?
That is what I am saying. If the file extension is .asp, you should get
Intellisense. My major gripe here is slightly different -- VWD assumes
VBScript in such files, and I have figured out no way to force it to make
JScript the default for <% %> blocks in documents without language
declarations. The irony in this case is that JScript is better suited for
Intellisense, as it uses methods instead of functions.
> This is what I need, but this is not what I am getting.
I do not understand that.
> ...Wow. I sure have been doing this the hard way. I was
> wondering about that, too. Especially after you said "VWD
> 2005 Express rocks for classic ASP."
>
> SO, succintly, how do I create and install a custom template
> of any sort? (I would like to have multiple templates for
> plain HTML and for ASP files.)
Save your favorite ASP template to the NewWebFileItems folder. Using
notepad, copy one of the lines in NewFileItems.vsdir and replace the
filename with the name of the file you just created. Then start playing with
the parameters to figure out what they do (the parameters are
pipe-delimited).
IIRC, the one with values 20,30,40,50,90,110... specifies the order in which
they appear in the list, and the one that preceeds it affects the choice of
icon. I have not figured out how to get unique names for different
templates, but I can get different icons, and if you add an ASP file, it
does call it an "Active Server Page".
--
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.