CoverYourASP --> Snippets |
| "Snippets" are mini-articles - they allow me to very quickly add answers to your frequently asked questions, and add brief explanations for topics that you've searched for without success. So, everytime you send an email or perform a search, chances are a new snippet will be the result!11 Jan: Porting my JScript code to VBScriptI'm glad Robert Egan wrote to me recently, because his question made me aware that I don't make it obvious enough that my code is all JScript, not the more common VBScript. Here's his question:Hope you can help with this question of mine, I've downloaded your site code, and I'm looking to use a portion of it in a site I'm building. However, when I use your code I get: Microsoft VBScript compilation error '800a0401' Expected end of statement ^ pointing to ; What do I do to get this to function correctly James? I don't get asked this much, but perhaps that's because most people just give up, think "crappy code" and move on! Since I converted some of my code to VBScript recently I thought I'd share my findings - you'll see that it isn't that difficult to port my code to VBScript. (To see why you may want to work in one language or the other, see Why use JavaScript instead of VBScript?) Here's what I did: surround strings with " rather than ' This isn't a complete list, but it'll get you a long way. I recommend making a quick pass through the code first making these changes, then running the page. The browser will show you what still doesn't make sense. I'll update this page as I remember other necessary changes. |
|