Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 30th, 2003, 12:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default Const Question

Dear All,
    I've got a Constant defined as a base URL, and am trying to use that in conjunction with some filenames to create other constants as follows :

Const BaseURL="http://www.greggriffiths.org/images/"
Const NewImg=BaseURL & "new.gif"

For some reason I get an error on the second line, even though I am using a Constant and not a Variable to create the second Constant. Has anyone got a workaround to this, apart from using Variables for NewImg ?
__________________
All the best

Greg
------------------
Greg Griffiths
Web & Livelink Developer
http://www.greggriffiths.org
 
Old June 30th, 2003, 01:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Greg,

You can use ONLY literal value for the constant's definition. You cannot assign a value from the other constant or variable.
NewImg entity in your code segment is one typical variable. If you need perform any operation on some entity then this entity cannot be a constant.

...but the Soon is eclipsed by the Moon





Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting BSTR to const char* wambozi C# 1 September 6th, 2006 05:37 AM
Const crmpicco VB How-To 2 May 18th, 2005 09:51 AM
how to make a const do something usefull allee_man VB How-To 2 January 4th, 2005 08:56 AM
passing a const reference in C#.NET texasraven C# 2 December 21st, 2004 06:48 PM
what's the diference between readonly and const?? gbianchi VB.NET 2002/2003 Basics 2 November 11th, 2004 02:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.