Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am having a problem with multiple includes.

Status
Not open for further replies.

bitrot

Programmer
Jun 3, 2004
13
US
I am working on a cart system right now. I have finished the Control Layer and I am in the Visual Layer or my coding. But here is my problem.

In the Cart.asp(This is the Visual File with the HTML formatting) I include Cart_Code.asp(the control layer of the design). In Cart_Code.asp I include Coupon_Code.asp (a module I wrote that determines the values of coupons using a different table in the database). In Coupon_Code.asp there is a variable called alertUserOfThis (which is a string). I am trying to print it in Cart.asp, to alert the user of whatever the error was. However, this doesn't work and I get a "Variable is Undefined" error. Even though alertUserOfThis is both defined and initialized in Coupon_Code.asp.

So I guess my question is, "Can you access variables that are included in included files, in asp ?"

 
yes you can, if the variable is dimmed in a function it's local, you need to dim it outside of a function and preferably public, then it's passable in any direction.
 
I finally figured out the problem. The include file was included after the opening <% tag. So it wasn't getting inserted and parsed correctly. Thanks for your help though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top