| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 77172 | 2007-03-01 09:18:00 | "Out-of-left-field" question for any ASP/VBScript Gurus ... | davehartley (3487) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 529097 | 2007-03-03 08:15:00 | Thanks for all your help, everyone. Beama, you've hit it on the head ... your comment about 'variant' got me thinking and searching. It turns out, as you said, ASP has no typing of variables. Period. Everthing is a 'variant', which VBScript kind of "works out on the fly" if it can use in a particular expression or not. Having been brought up programming in strict languages like Pascal and C++, where everything has to be declared and typed, I've discovered VBScript to be a bit annoying in this regard! Anyway, the final word from the MSDN website (msdn2.microsoft.com): Declares constants for use in place of literal values. You can use constants anywhere you can use an expression. However, you can't use an expression to dimension an array. So, while I can declare a constant, it's not really a constant, just a variable that you can't change. :badpc: Go figure. (Hence my code will never work. Sigh. Oh well, I'll do something different :stare: ) |
davehartley (3487) | ||
| 529098 | 2007-03-03 08:17:00 | Does this help? For what it's worth, I declare a Const in VBA like this: (Note the word Dim" isn't used) Const five as Integer = 5 <quote> VBScript . 2 . Implicit Declaration - A variable name is used on the left side of an assignment statement without being declared previously . The data type of an implicitly declared variable is "Variant" . Visual Basic Scripts Restriction: Visual Basic scripts used in IE or IIS only supports "Variant" type of variables . So you: Can use implicit variable declaration . Can use explicit variable declaration without "As" and data type keywords . Can NOT use explicit variable declaration with "As" and data type keywords . </quote> Cheers, MistyCat |
MistyCat (11583) | ||
| 1 2 | |||||