473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Declaring string constant

I want to declare a somewhat larger string constant which doesn't fit on one
line. I tried several ways without luck. Is it even possible to declare it
on more than one line?

Thanks,
john
Jun 17 '07 #1
2 7796
You can break the string and use the line continuation charcter, e.g.:
Const gstrcString1 = "Line1 " & vbCrLf & _
"Line 2" & vbCrLf & _
"Line 3"

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" <jo@hn.comwrote in message
news:f5***********@textnews.wanadoo.nl...
>I want to declare a somewhat larger string constant which doesn't fit on
one line. I tried several ways without luck. Is it even possible to declare
it on more than one line?
Jun 17 '07 #2
Great! Thanks.
john

"Allen Browne" <Al*********@SeeSig.Invalidschreef in bericht
news:46***********************@per-qv1-newsreader-01.iinet.net.au...
You can break the string and use the line continuation charcter, e.g.:
Const gstrcString1 = "Line1 " & vbCrLf & _
"Line 2" & vbCrLf & _
"Line 3"

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" <jo@hn.comwrote in message
news:f5***********@textnews.wanadoo.nl...
>>I want to declare a somewhat larger string constant which doesn't fit on
one line. I tried several ways without luck. Is it even possible to
declare it on more than one line?

Jun 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Antony | last post by:
When I declared a constant in a class like: public Const attr As ClassB = nothing (ClassB is the user-defined Class) I get the compiler error: Constants must be an intrinsic or enumerated...
7
by: Iain Mcleod | last post by:
Hi This must be an often encountered problem. I want to declare an abstract class or an interface with nothing but several static constants so that I can use polymorphism when I call each of them...
15
by: Chris Saunders | last post by:
I have made a declaration like this: private const Complex I = new Complex(0.0, 1.0); When I try to build this I get the error: The expression being assigned to...
6
by: dndfan | last post by:
Hello, In the short time I have spent reading this newsgroup, I have seen this sort of declaration a few times: > int > func (string, number, structure) > char* string > int number >...
4
by: GnG | last post by:
Hello all, Someone posted a similar question a while ago but there was no response. Does anyone know the answer? I have a managed C++ DLL which is used by a C# project. In that DLL, I have...
3
by: farseer | last post by:
i am getting "error C2057: expected constant expression" with the following code: ifstream f( argv ); f.seekg( 0, ios::end ); const long fSize = f.tellg(); f.close(); char content;
5
by: frankleggett | last post by:
Hi Please excuse my ignorance. I am trying to declare an array with a variable amount but I'm having no luck. this is what I've tried Dim Number as string X = Val(Number) dim Array(X) as...
2
by: Pavan | last post by:
Hi, I need to create a consant array of larze size but however its elements can be calculated using an equation, say for example I need an int arry of 20 elements where each element will be arr...
3
by: longbrmb | last post by:
I'm new to C++/CLI and my main background is Java. I'm trying to create an array of constants as a static member of a class. An example is shown below: public ref class TestClass { public:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.