Discussion Locked

global variable

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

im building an intranet for the company that i work at, and on the site i need to be able to email the directions...

is there a way that i can ask the user for an email address and make that address a value for a global variable? i want to be able to take that email address and write it into a text file.

3 replies

by sergey kovzik

I assume you're using ASP? Well. If you mean global variable for small ASP module or Session object - it's Ok, but if for Application object - it's really bad, because there many sessions and you will overwrite it. If you have large program it's better to split it into Subs, this case you won't need global variables. You'll write something like that:
SendDirectionsTo(Reqest.Form("EMail"))
and inside SendDirectionsTo you'll use local private variable. This will help you to have module clean and simple without fear to overwrite already used variable or to loose something.

Sincerely, Sergey
Brainbench MVP for Win98 Administration

This discussion is closed to new replies.