Dim this include that?

Results 1 to 2 of 2

Thread: Dim this include that?

  1. #1
    Join Date
    Dec 1969

    Default Dim this include that?

    Im wondering if that a) it would be good practise and b) Is it going to be more efficient or a waste of 30 lines of code (I havnt counted) but anyway what do you think..<BR><BR>I have just been reading about using option explicit. I&#039;d admit Im a bit lazy with using it but thats about to change. However my idea consists of declaring your variables in one single include file, so the first line of any asp page would be <BR>&#060;!--include file ="/thisfile.asp"--&#062;<BR><BR>This file would look like this..<BR>------START of CODe&#039;Y BIT-------------<BR><BR>&#060;% <BR>Option Explicit <BR><BR>Dim any variable that im ever going to use<BR><BR><BR>%&#062;<BR> ------END CODe&#039;Y BIT-------------<BR><BR>This would be handy for development if you plan your scripts you can name all your variables in one place and break them using comments into sections like &#039;editing vars &#039;validation etc<BR>Am i just being lazy? or would it work ok? Knowing me this is an ancient &#039;Basic Programming Practise 101&#039; i missed that class. It might be more like &#039;The top 10 worst ever ideas&#039; anyway. <BR><BR>later<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Dim this include that?

    Personally, when I was using VBScript I declared them all at the start of the block they were used in. I could control scope much better that way, so if I didn&#039;t need a var to be global, it wasn&#039;t global.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts