🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.upgrade
Article #267

Difference in syntax from C++ Builder 5 to Rad 5

#267
From: Martin
Date: Thu, 13 Sep 2007 23:25
49 lines
2417 bytes
I downloaded the trial version of C++ Builder/Delphi 2007 and trying to 
see how much of the existing code I have will work in the new version. 
This code was originally written for compatibility with C++ Builder 5 
and the corresponding Delphi version.

I have some components written mostly in Delphi with some assembly that 
the new compiler doesn't like.  I've included the relevant sections below:

type
   QPCCast = record
     LowPart: DWORD;
     HighPart: DWORD;
   end;

   { Centralized timer method -- will use QueryPerformaceCounter }
   { if avail, return is the number of ms since the system started }
   function AdTimeGetTime : DWord;
   {$IFDEF Win32}
   var
     Count : TLargeInteger;
   {$ENDIF}
   begin
     {$IFDEF Win32}
     if QPFreq <> 0 then begin
       QueryPerformanceCounter(Count);
       asm
         xor edx, edx
         mov eax, QPCCast(Count).HighPart
         div QPFreq
         mov eax, QPCCast(Count).LowPart
         div QPFreq
         mov Result, eax
       end;
     end else
     {$ENDIF}
       Result := timeGetTime;
   end;


The error I'm getting from RAD is E2003 Undeclared identifier, on 
HighPart and LowPart.  I don't know Delphi or assembly really, but my 
understanding is that the code is trying to cast the variable Count as 
type QPCCast and reference the upper and lower 32-bits of the 64-bit 
integer.  Has there been a syntactic change that makes this unusable? 
How should this been done in the new version?  These are not the only 
places that this particular type of casting is happening.

Thanks,
Marty
Technical Details
Message-ID: <46e9c6e7@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10529a,214b417d552f1e82,start
X-Google-Attributes: gid10529a,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 13 Sep 2007 16:25:03 -0700
From: Martin <dev@no.comppromed.spam.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.upgrade
Subject: Difference in syntax from C++ Builder 5 to Rad 5
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208.201.233.20
Message-ID: <46e9c6e7@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1189725927 208.201.233.20 (13 Sep 2007 16:25:27 -0700)
Lines: 49
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail