473,327 Members | 1,892 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,327 software developers and data experts.

ansistring,ansistring get's by compiler

I have a program that i changed over from using char *'s to using
ansistrings. Previously it had been:

char string1[255];
char string2[255];
strcpy(string1,string2);
now i use:

AnsiString string1;
AnsiString string2;
string1 = string2;

The problem is, i made a mistake and didn't completely convert a line,
and it was like this:

AnsiString string1;
AnsiString string2;
string1,string2;

I did not get any error for this. I found it by stepping through the
code and noticing that this line was completely jumped over, almost
like it was a comment. I'm not sure if this is IDE specefic or
language specific, but can anyone tell me if they know why this makes
it by the compiler? I use Borland C++ Builder 6. Thanks in advance
for your help,

Ben

Jul 12 '07 #1
2 1786
On Jul 12, 5:03 pm, crash <b_outwa...@yahoo.comwrote:
I have a program that i changed over from using char *'s to using
ansistrings. Previously it had been:

char string1[255];
char string2[255];
strcpy(string1,string2);

now i use:

AnsiString string1;
AnsiString string2;
string1 = string2;

The problem is, i made a mistake and didn't completely convert a line,
and it was like this:

AnsiString string1;
AnsiString string2;
string1,string2;

I did not get any error for this. I found it by stepping through the
code and noticing that this line was completely jumped over, almost
like it was a comment. I'm not sure if this is IDE specefic or
language specific, but can anyone tell me if they know why this makes
it by the compiler? I use Borland C++ Builder 6. Thanks in advance
for your help,
Because the , is an operator, so the line is quite valid, it does the
following;

it will evaluated it's arguments from left to right and the total
expression evaluates to the last argument; The goal is to be able to
combine multiple expressions as one.

example:

int j = length;
for(int i = 0; i < length; i++, j--) {
}

Jul 12 '07 #2
On Thu, 12 Jul 2007 08:03:18 -0700, crash wrote:
I have a program that i changed over from using char *'s to using
ansistrings.
What's Ansistring? Any particular reason for not using the C++
std::string class?

[...]
The problem is, i made a mistake and didn't completely convert a line,
and it was like this:

AnsiString string1;
AnsiString string2;
string1,string2;

I did not get any error for this.
No, because it's valid[1] C++ (although it probably[1] doesn't do
anything).

[1] assuming Ansistring is not completely insane

--
Lionel B
Jul 12 '07 #3

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

Similar topics

2
by: Mendon?a | last post by:
I cant seem to find on borland help files anything about AnsiString to char conversion. Just the opposite. Can u help me?
5
by: JNY | last post by:
Hi, I'm using a GUI Edit box to allow the user to enter a number. This data is stored as an AnsiString. I need it in Integer format, but cannot convert between the two. I found...
9
by: Franz Seidl | last post by:
Hello, how can i convert a AnsiString to double? I'm using C++ Builder 5 from Borland... Greets, Franz --
10
by: Jonathan Wilson | last post by:
Firstly, to get msvcrt.lib, install the .NET framework SDK. The version of msvcrt.lib included there is the exact same one as comes with Visual Studio ..NET 2003. There are some other things that...
6
by: afraze | last post by:
Hi! My problem is that: When i declare an AnsiString function in my Form.h("Form.h" is an ex. name) i am getting this error: :Unresolved external ' __fastcall System::TObject::ToString()...
3
by: larcrik | last post by:
i have to convert a string into an AnsiString. Is there a way to do that?
5
by: Michael Bell | last post by:
I have just done (but done badly in) the Open University course "MT262: Putting computers to work". Borland Builder 5 is supplied as part of the course. It uses the data-type AnsiString for strings...
1
codexparse
by: codexparse | last post by:
I am writing a browser program in C++ Builder 6 that loads a web page using the following code: void __fastcall TForm1::ToolButton1Click(TObject *Sender) { wchar_t buff; ...
4
by: jpenguin | last post by:
I'm writing an MCF prog, and I need to convert an ansistring to a cstring, but it seems to lose the last letter-- char* S = input->Text.c_str(); Label1->Caption = S;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.