views:

87

answers:

1

I was able to build one application up to this morning, then I don't know what happened as I try to build I have

[DCC Error] myunit.pas(1710): E2056 String literals may have at most 255 element`

Why this if this was working? (1710) was not edited in last month. I checked with a colleague project options and environement options one by one and they are the same. (the only difference is that i installed all Delphi updates, while he didn't anyway I didn't install them today).

moreover if I fix the above "erroor" by splitting the string in 2, doing something like

S := 'firstpart' + 'secondpart';

instead of

S := 'firstpartsecondpart';
// this is an example of course firstpartsecondpart 
//is a string of more than 255 chars

I have another problem:

[DCC Error] myunit.pas(1797): E2283 Too many local constants.  Use shorter procedures

Why this? I didn't change this procedure today. It is a long procedure indeed, but it used to compile up to this morning. I tried to split tjhe procedure in 2 and I was able to compile...

And Finally...

Breakpoints doesn't work anymore. If I try to set a breakpoint, after compiling and linking the RED cirlce of breaxpoint becomes green with an X, like when you try to debug a line of code that cannot be debugged.

I tried all, including rebooting and setting Debug Info to True in project options.

FINAL NOTE: It seems that for some reason some strange settings have been applied. I can't recall having done something strange. Recently I installed CnPack, but I could use it effectively for days. This problem started today.

Can anyone give me an hand? I am in real trouble, I lost half day and I still don't see a way out.

+2  A: 

It seems you've changed the "Huge strings" project option. Did you add a {$H} to your code? Or did you fiddle with the project options? ("Compiler options/Huge strings" need to be checked to default to strings longer than 255 characters.)
The green breakpoint thingie means that this specific code is not compiled, thus it will not be called. Check if your code is calling this code, or perhaps it's looking at some other (pre-compiled?) unit.


My comments from below to complete the answer:

If all breakpoints are green, it appears you have a problem setting the project options. If you remove the YourProject.dproj and YourProject.dproj.local files (Move somewhere else, don't delete) and then open the YourProject.dpr, your project should have the default options. Check if it works in that case. If not, move the old files back.
The E2056 error is because strings inside Delphi code cannot be longer than 255 characters. Splitting it by including '+' in your string can fix this. See qc.embarcadero.com/wc/qcmain.aspx?d=71575 for why your collegue doesn't get this warning.

Workshop Alex
I searched all my code and I don't have $H, I tried to add {$H+} on top of the unit that gives me problems but I have the same error. ({$H+} is the default setting, but I tried anyway).
Moreover for the breakpoint issue the code gets compiled, I can put a breakpoint in any line of my code an dI get the "green breakpoint".
If all breakpoints are green, it appears you have a problem setting the project options. If you remove the YourProject.dproj and YourProject.dproj.local files (Move somewhere else, don't delete) and then open the YourProject.dpr, your project should have the default options. Check if it works in that case. If not, move the old files back.
Workshop Alex
YES removing those 2 files fixed the problem, anyway the 255 error is still there. Any idea? I mean where can I check for a setting that has been changed? My colleague CAN BUILD THE SAME CODE and doesn't have that error.
The E2056 error is because strings inside Delphi code cannot be longer than 255 characters. Splitting it by including '+' in your string can fix this. See http://qc.embarcadero.com/wc/qcmain.aspx?d=71575 for why your collegue doesn't get this warning.
Workshop Alex
VERY MUCH HELPFUL. I really appreciate your assistance. Thanks.