"a <> b;" can be compiled in Delphi 2007

Hi:

The code below can't compiled in Delphi 5 but can be compiled in Delphi 
2007:

procedure TForm1.Button1Click(Sender: TObject);
var
  a, b : string;
begin
  a <> b;
end;

Any thoughts?

Roland
0
Roland
2/18/2009 11:39:52 PM
embarcadero.delphi.ide 3925 articles. 0 followers. Follow

12 Replies
821 Views

Similar Articles

[PageSpeed] 20
Get it on Google Play
Get it on Apple App Store

Roland Zhang wrote:

> The code below can't compiled in Delphi 5 but can be compiled in
> Delphi 2007:
> 
> procedure TForm1.Button1Click(Sender: TObject);
> var
>  a, b : string;
> begin
>  a <> b;
> end;
> 
> Any thoughts?

I haven't looked if this is in QC, but this is fixed in Delphi 2009.
With Delphi 2007 this repeats, but only at the beginning of a proc.

That

  begin
    a <> b;
    a <> b;
  end;

doesn't compile.


Since the code for

  a <> b;

is equal to

  if a <> b then;

except the additional

  setnz al

I see no big problem with this bug.
-- 
Uwe
0
Uwe
2/19/2009 12:06:27 AM
>> The code below can't compiled in Delphi 5 but can be
>> compiled in Delphi 2007:
>> 
>> procedure TForm1.Button1Click(Sender: TObject);
>> var
>>  a, b : string;
>> begin
>>  a <> b;
>> end;

"Uwe Schuster" <jedivcs@bitcommander.de> wrote
> I haven't looked if this is in QC, but this is fixed in Delphi 2009.
> With Delphi 2007 this repeats, but only at the beginning of a proc.
> ...
> I see no big problem with this bug.

I see a little problem. --JohnH
0
John
2/19/2009 1:23:24 AM
Thank you for your input.

We got big problem with this bug, with this, the value was not assigned. Of 
course not big problem if we test thoroughly.

Roland


"Uwe Schuster" <jedivcs@bitcommander.de> wrote in message 
news:82707@forums.codegear.com...
> Roland Zhang wrote:
>
>> The code below can't compiled in Delphi 5 but can be compiled in
>> Delphi 2007:
>>
>> procedure TForm1.Button1Click(Sender: TObject);
>> var
>>  a, b : string;
>> begin
>>  a <> b;
>> end;
>>
>> Any thoughts?
>
> I haven't looked if this is in QC, but this is fixed in Delphi 2009.
> With Delphi 2007 this repeats, but only at the beginning of a proc.
>
> That
>
>  begin
>    a <> b;
>    a <> b;
>  end;
>
> doesn't compile.
>
>
> Since the code for
>
>  a <> b;
>
> is equal to
>
>  if a <> b then;
>
> except the additional
>
>  setnz al
>
> I see no big problem with this bug.
> -- 
> Uwe
0
Roland
2/19/2009 1:26:26 AM
Roland Zhang wrote:

> Uwe Schuster wrote:
>
> > Roland Zhang wrote:
> > 
> > > The code below can't compiled in Delphi 5 but can be compiled in
> > > Delphi 2007:
> > > 
> > > procedure TForm1.Button1Click(Sender: TObject);
> > > var
> > >   a, b : string;
> > > begin
> > >   a <> b;
> > > end;
> > > 
> > > Any thoughts?
> > 
> > I haven't looked if this is in QC, but this is fixed in Delphi 2009.
> > With Delphi 2007 this repeats, but only at the beginning of a proc.
> 
> We got big problem with this bug, with this, the value was not
> assigned.

Huh? The code above does almost nothing, what didn't get assigned?


-- 
Pieter

"Getting an education was a bit like a communicable sexual disease. 
 It made you unsuitable for a lot of jobs and then you had the urge
 to pass it on." -- Terry Pratchett, Hogfather
0
Pieter
2/19/2009 1:32:59 AM
We supposed to write a := b; while accidentely write a <> b and not noticed 
it(never thought this could compile successfully);

Roland


"Pieter Zijlstra" <p.zylstra.notthis@hccnet.nl> wrote in message 
news:82737@forums.codegear.com...
> Roland Zhang wrote:
>
>> Uwe Schuster wrote:
>>
>> > Roland Zhang wrote:
>> >
>> > > The code below can't compiled in Delphi 5 but can be compiled in
>> > > Delphi 2007:
>> > >
>> > > procedure TForm1.Button1Click(Sender: TObject);
>> > > var
>> > >   a, b : string;
>> > > begin
>> > >   a <> b;
>> > > end;
>> > >
>> > > Any thoughts?
>> >
>> > I haven't looked if this is in QC, but this is fixed in Delphi 2009.
>> > With Delphi 2007 this repeats, but only at the beginning of a proc.
>>
>> We got big problem with this bug, with this, the value was not
>> assigned.
>
> Huh? The code above does almost nothing, what didn't get assigned?
>
>
> -- 
> Pieter
>
> "Getting an education was a bit like a communicable sexual disease.
> It made you unsuitable for a lot of jobs and then you had the urge
> to pass it on." -- Terry Pratchett, Hogfather
0
Roland
2/19/2009 4:13:06 AM
Roland Zhang wrote:

> We supposed to write a := b; while accidentely write a <> b and not
> noticed it (never thought this could compile successfully);
> 

Looking at my keyboard, I'm still trying to figure out how someone
could accidently type "<>" instead of ":=" even thinking about just "="
or an ex-C programmer wanting to type "!=". I can only assume that it
was a Monday morning action.

The compiler can do a lot, but it won't safe you from these Monday
morning actions ;-)

-- 
Pieter

"The dangerous patriot ... is a defender of militarism and its
 ideals of war and glory."
 -- Colonel James A. Donovan, Marine Corps
0
Pieter
2/21/2009 2:01:02 AM
Roland Zhang wrote:

> We got big problem with this bug, with this, the value was not
> assigned.

In this case you should have provided a better example, because
  
  var
    a, b: string;
  begin
    a := b;

would make no sense. Strings are always empty.

A bit more realistic would be

  procedure DoSomething(const AInputStr: string);
  var
    TempStr: string;
  begin
    TempStr <> AInputStr;
  end;
-- 
Uwe
0
Uwe
2/22/2009 10:55:17 PM
I just want show that this is a compiler bug, that's all. The code is 
meaningless.

Roland

"Uwe Schuster" <jedivcs@bitcommander.de> wrote in message 
news:84158@forums.codegear.com...
> Roland Zhang wrote:
>
>> We got big problem with this bug, with this, the value was not
>> assigned.
>
> In this case you should have provided a better example, because
>
>  var
>    a, b: string;
>  begin
>    a := b;
>
> would make no sense. Strings are always empty.
>
> A bit more realistic would be
>
>  procedure DoSomething(const AInputStr: string);
>  var
>    TempStr: string;
>  begin
>    TempStr <> AInputStr;
>  end;
> -- 
> Uwe
0
Roland
2/23/2009 3:08:25 AM
Pieter:

It's quite often we do like this:

if aaaaaaaaaaaaaaaaaaaaa <> bbbbbbbbbbbbbbbbbbbbbbbbbb then
  aaaaaaaaaaaaaaaaaaaaa := bbbbbbbbbbbbbbbbbbbbbbbbbb;

what we did is copy "aaaaaaaaaaaaaaaaaaaaa <> bbbbbbbbbbbbbbbbbbbbbbbbbb"
and past "aaaaaaaaaaaaaaaaaaaaa <> bbbbbbbbbbbbbbbbbbbbbbbbbb" but forgot 
change the operator.

You can blame programmers make such silly mistake, but the compiler itself 
is the core problem.

Roland



"Pieter Zijlstra" <p.zylstra.notthis@hccnet.nl> wrote in message 
news:83796@forums.codegear.com...
> Roland Zhang wrote:
>
>> We supposed to write a := b; while accidentely write a <> b and not
>> noticed it (never thought this could compile successfully);
>>
>
> Looking at my keyboard, I'm still trying to figure out how someone
> could accidently type "<>" instead of ":=" even thinking about just "="
> or an ex-C programmer wanting to type "!=". I can only assume that it
> was a Monday morning action.
>
> The compiler can do a lot, but it won't safe you from these Monday
> morning actions ;-)
>
> -- 
> Pieter
>
> "The dangerous patriot ... is a defender of militarism and its
> ideals of war and glory."
> -- Colonel James A. Donovan, Marine Corps
0
Roland
2/23/2009 3:13:14 AM
"Roland Zhang" 
> what we did copy "aaaaa <> bbbbb"
> and paste "aaaaa <> bbbbb" 
> but forgot change the operator.

I have done that. 
 
That the compiler would compile "a<>b;" is a problem that should be 
looked at, if it has not examined already.  It might be a symptom of
a problem causing less obvious, but more important bad results.    
--JohnH
0
John
2/23/2009 11:20:21 AM
Roland Zhang wrote:

> I just want show that this is a compiler bug, that's all. The code is
> meaningless.

Generally I don't share this opinion, but I don't want to discuss this
now. I have the impression that there are enough threads in this
newsgroups which discuss how bugs should be reported.
-- 
Uwe
0
Uwe
2/23/2009 2:33:46 PM
Roland Zhang wrote:

> It's quite often we do like this:
> 
> if a <> b then
>  a := b;
> 
> what we did is copy "a <> b" and past "a <> b" but forgot change
> the operator.

Ah I see, I usually have it the other way around with, by class
completion generated, property setters, not that I really forget them
because error insight has already put a swiggly line underneath it.

> You can blame programmers make such silly mistake, but the compiler
> itself is the core problem.

BTW this is already fixed in D2009.

-- 
Pieter

"For if he like a madman lived, At least he like a wise one died."
 -- Cervantes.
0
Pieter
2/24/2009 8:48:57 PM
Reply:

Similar Artilces:

"<table></table>" and "<frameset><frame></frame></frameset>" in perl/tk
Dear my friends... Anybody would be so kind telling me what is similar in perl/tk to arrange the location of a form written in perl/tk? I want a nice look for my perl/tk application. Somewhat like this below: 1. Name : <place to type-in> 2. Address : <place to type-in> 3. Telephone : <place to type-in> I have made the main menu of my application with "Menubutton". And I want if the user click on the menu that what the user see is only the aimed application displayed on the determined area (under the main menu) but the menu has no change in po...

How can i capture the event of "<a href=\"freetextbox.rar\"></a>" in serverside
   I am doing the download system,and i don't know how to get the download number if userclick the <a href="freetextbox.rar">download</a> if anyone who knows about  it please tell me.Thank you very much! you can use LinkButton control have alook at my website i have the same thing but not a LinkButton   i used imageButton http://www.fadilalnassar.com/Resources/TabControl.aspxif you need any help, get back to me !!! Fadil Alnassar www.fadilalnassar.com | FREE Nodil Tab Controlhttp://www.mefranchising.com You can write the code as sc...

Can <deny users="*"/> be overwritten by <allow users="admin1,admin2"> ??
If I want to allow only a few usernames in my database to access the /admin directory, will the code below work or will <deny users="*"/> keep everyone out? Thanks <location path="admin"> <system.web> <authorization> <deny users="*"/> <allow users="username1,username2"> </authorization> </system.web> </location> The first rule from top to down that matches the particular user is used, meaning that in this case all use...

can I delete <form id="form1" runat="server"> and </form>
Hi: Our website is written by using simple html code, one of the page has some virtual shopping cart code with <form> ....</form>, (for example here: http://www.centercoin.com/coin_supplies/coin_collecting_starter_set.htm ), if I have 10 products, I will have 10 of <from> ...</form> in this page, that is ok. Now, I am trying to redesign the website using asp.net2.0, I notice all the asp page will automatically create a <form id="form1" runat="server"> ...</form>, such as: <html xmlns="http://www.w3.org/19...

Why is "<MyControl ... />" different to "<MyControl ...> </MyControl>"
Hi I have made a CompositeControl and had it working fine. The sequence of events was: Page -> Page_Load(), MyControl -> CreateChildControls(). This was fine because I had to set a certain property in my control during page load before CreateChildControls was called. Anyway.... suddenly it all stopped working and it turned out that the sequence of events changed to MyControl -> CreateChildControls(), Page -> Page_Load(). This caused it to blow up because the property was not set. After a few hours of pulling my hair out and undoing all the recent changes I had made it turns out...

What is this for? "<label style=""display:none;"" for=""" & cboFieldType.ClientID.ToString & """>Type</label>"
I'm digging through the code of DNN and I found many ocurrences of this type of code: lblFieldType.Text = "<label style=""display:none;"" for=""" & cboFieldType.ClientID.ToString & """>Type</label>" What is that code for? The label is never displayed and I could not figure out what DDN uses it for. thank you This is for ADA compliance. The guidelines require that form elements have an associated label. This helps the text readers out with identifying the different parts of the form. BruceDynamic...

what's the different from "<page src="">" and "<page codeBehind="">"
what's the different from "<page src="">" and "<page codeBehind="">" Thank YOU how to make session' life longer? Thank You This very question was asked only 5 days ago. Searching the forums would have yielded the answer you require. However, see this thread. Steven BeyRecursion: see Recursion You can set a new value for the Session Timeout in your web.config file. Or, you can do it in a page through this property: Session.Timeout Note that if you choose the second method, the timeout will only be modified on this page,...

"<->" as "->" with automatic "is rw"
I like that arguments will be readonly by default. But when I look at my current code, I see that I would be typing " is rw" quite a lot, which in my opinion is too long for a thing that occurs very often. Every such situation in my code is a foreach loop. A thing that in Perl 6 will mostly be used with the pointy sub declaration syntax. If I'm not mistaken, <-> is still available. It communicates "bidirectional" and that is more or less the same as read/write access. I'm proposing for zip(@foos, @bars, @xyzzies) <-> $foo, $bar, $xyzz...

Issue while assigning tr.innerHTML = "<td>a</td><td>b</td>";
tr = document.createElement('tr'); tr.innerHTML = "<td>a</td><td>b</td>"; print(tr.innerHTML); result:- "ab" expected:- "<td>a</td><td>b</td>" https://bugzilla.mozilla.org/show_bug.cgi?id=467872 ...

Regular Expression to remove "/", "\", "<", ">" and "="
Can anyone please show me the regular expression to reject a string ("<blue", "right>" etc.) which has the following expression in it: "/", "\", "<", ">" and "="  hi, It may Help u.. it is in Class file u may use this expressin in validation controls also. Regex objReg = new Regex(@"^[^,.?/\~|`;:'<>]*$", RegexOptions.Singleline); Regex objReg = new Regex(@"^[^,][^.][^?][^/][^\][^~|][^`][^;][^:][^'][[^<][^>]$", RegexOptions.IgnoreCase);Thanks &...

"Florian Ragwitz" <rafl@debian.org>, "Zefram" <zefram@fysh.org>, "Father Chrysostomos" <sprout@cpan.org>,
--0015175884b6a300aa04a8916f03 Content-Type: text/plain; charset=UTF-8 Howdy all. Bit of a slow week, as I didn't have net access for a couple of days. It was awful, and doesn't leave me with that much to report; But on the other hand, it was an awesome week - Midterm passed, the pad stuff got merged, and all the bugs in that started popping out. Fun : ) I'll follow up on that in another mail, so back to last week. With the pad merge, getting our and the error messages with scalar filehandles working done was only a few lines, which makes several TODO tests to pass;...

help with simple javascript: <asp:LinkButton OnclientClick="$find('<%=mpeup1.ClientID %>').hide();" ID="btnCancel" runat="server" CausesValidation="false">Cancel Edit</asp:LinkButton>
I have this app that has a Modapopup Extender control called "mpeup1" it is in a user control inside a formview control on a content page. So I use the clientID property and I simply want to close the ModalPopup on the client side with a simple button click. This is what I have but it doesn work because it always says error: "null is null and is nothing" or some l;ike that. <asp:LinkButton OnclientClick="$find('<%=mpeup1.ClientID %>').hide();" ID="btnCancel" runat="server" CausesValidation="false">Cancel Edit<...

Difference between <%# Bind("") %> and <%# Eval("") %>
Occassionally, I will find myself using Bind and Eval interchangeable.  I am unclea or what is the exact difference.  Can someone shed some light?Thanks,X Friend, it is something like this Data-binding expressions are contained within <%# and %> delimiters and use the Eval and Bind functions. The Eval function is used to define one-way (read-only) binding. The Bind function is used for two-way (updatable) binding. In addition to calling Eval and Bind methods to perform data binding in a data-binding expression, you can call any publicly scoped code within the <%# and %...

[PATCH] Add "b <filename>:<line> <cond>" to perl -d
Hi all! This link - http://xrl.us/bjrpd2 is a github branch that contains a set of some commits to add this to perl -d : <POD> =item b [file]:[line] [condition] X<breakpoint> X<debugger command, b> Set a breakpoint before the given line in a (possibly different) file. If a condition is specified, it's evaluated each time the statement is reached: a breakpoint is taken only if the condition is true. Breakpoints may only be set on lines that begin an executable statement. Conditions don't use C<if>: b lib/MyModule.pm:237 $x > 30 ...

Web resources about - "a <> b;" can be compiled in Delphi 2007 - embarcadero.delphi.ide

Resources last updated: 12/17/2015 12:15:51 AM