Upgrade from Delphi 5 and Delphi XE: Variant and SysUtils unit problems.

Hi.

I am a newbie to Delhi XE.

I have just taken on the task of converting my stuff from Delphi 5 [sic] to Delphi XE.  The first errors I got was
"Variants unit out of data or corrupted" and 
"symbol deprecated" in SysUtils

I hope I can fix the problem by simply pointing to the "up-to-date" units.  I am also wondering wether I will not have to switch to Unicode, since the errors seem to be string related (not that I know what changing to Unicode entails).

Any help? 

Marcus
0
Marcus
12/27/2013 8:46:03 AM
embarcadero.delphi.general 4258 articles. 0 followers. Follow

6 Replies
2723 Views

Similar Articles

[PageSpeed] 29

> {quote:title=Marcus de Bruin wrote:}{quote}
> Hi.
> 
> I am a newbie to Delhi XE.
> 
> I have just taken on the task of converting my stuff from Delphi 5 [sic] to Delphi XE.  The first errors I got was
> "Variants unit out of data or corrupted" and 
> "symbol deprecated" in SysUtils
> 
> I hope I can fix the problem by simply pointing to the "up-to-date" units.  I am also wondering wether I will not have to switch to Unicode, since the errors seem to be string related (not that I know what changing to Unicode entails).
> 
For the problem with the variant and sysutils units, you probably have the old units in the search path.

For the unicode part, there are some things to learn, I suggest reading Marco Cantu's excellent paper, "Delphi and Unicode".

Get it here: http://edn.embarcadero.com/article/38980

/Leif

Edited by: Leif Uneus on Dec 27, 2013 3:10 AM
0
Leif
12/27/2013 11:10:57 AM
Marcus de Bruin wrote:

> Hi.
> 
> I am a newbie to Delhi XE.
> 
> I have just taken on the task of converting my stuff from Delphi 5
> [sic] to Delphi XE.  The first errors I got was "Variants unit out of
> data or corrupted" and "symbol deprecated" in SysUtils

The first thing you need to do is to make sure there are no references
to Delphi 5 RTL or VCL units in your project. Examine the DPR file Uses
clause. If you have not done so already, delete the project's DSK and
CFG files, they may also contain references to D5 folders and files.

For D5 to XE is quite a jump. There was some movement of stuff from RTL
and VCL units to other or new units in D6 (for Kylix compatibility),
for instance. You will need to add the Variants unit to practically
every Uses clause in form and datamodule units, for instance (to the
one in the interface section), since the Variant support was moved
there. How to deal with deprecated symbols depends on the symbol the
compiler moans about. This thread here may give you some hints on how
to deal with such things:
https://forums.embarcadero.com/message.jspa?messageID=548911

You will of course also have to deal with Unicode issues. How much work
this will be depends on how your code uses strings. As long as theys
are actually used to store characters you will have only problems in
places where you have made an implicit assumption that Sizeof(Char)
would be 1 (e.g. when writing a string to a stream), or where you have
to interface with 3rd-party DLLs that take PChar parameters. If the DLL
itself is not upgraded to Unicode as well you will have to change every
occurrence of PChar to PAnsichar in the DLL interface code.

The main problems in the move to Unicode are caused by using strings as
storage for non-character data. Such uses should all be rewritten to
use TBytes as storage instead of strings. If that is too much work you
have to use variables of type Ansistring instead and take maximum care
to never ever to anything with them that would cause the compiler to
convert the content to Unicode. Look closely at the warnings the
compiler produces, especially those related to implicit conversions
between string types.

If your project uses a lot of 3rd-party components you may have more
problems caused by those. Even if you have the full source code moving
a component that needs to be installed in the IDE over such a large
version jump will be problematic, since the design-time interface of
the IDE tends to change a lot more than the RTL and VCL itself, where
backwards compatibility has always been an important criterion for how
changes are made. Even if you can find XE versions of the components
they may have changed considerably since D5.

Oh, and be prepared for hassle if your project depends on the BDE...

-- 
Peter Below (TeamB)
0
Peter
12/27/2013 11:28:36 AM
Marcus,

| I am also wondering wether I will not have to switch to Unicode,
| since the errors seem to be string related (not that I know what
| changing to Unicode entails).

Peter's post is on-the-mark!  Study it carefully. 

Now, that said, ...  

I had old RAD Studio 2007 code, which originally started out as TP and
Delphi1 code, growing with Delphi over the years, that I had to make
work in XE and up.

I had two issues after D2007: 
Database and Unicode.  Luckily for me the apps I had to convert did NOT
use Unicode.  And, more specifically HAD to use ANSI code due to large
files that could NOT be updated to Unicode.  (Don't ask. <g>)

What I wound up doing was "ANSI-fing" my source.  I used Replace to
look for and replace, WHERE APPROPRIATE, String, Char and PChar to
AnsiString, AnsiChar and PAnsiChar.  It didn't take that long at all
and my "big-app" came up working the FIRST time I built-compiled it!
Which was actually quite a pleasant surprise. <g>

Way-back-when I had ditched the BDE and had started using FlashFiler
for the app's database functionalities.  Some guys down-under took over
FlashFiler and produced NexusDB and I went right along with them.  They
handled the 2007 to XE and later Ansi to Unicode updates as smooth as
silk, without breaking any of the ANSI functionality!!!  So I had NO
issues to contend with on the BDE/database functionality of my apps!  I
was "lucky" on that score!!!

Many people will tell you that it's not smart to "ANSI-fy" your code
due to potential future issues.  I am NOT one of them!  I think that it
"saved-my-bacon" in my particular circumstance with really deep "old"
code roots.

I'm only posting this reply since you may be in a similar circumstance
since your code-base is D5 and you might be in a similar situation to
what I found myself in a few years back.

Good luck! 


-- 

   Q 

12/27/2013 11:19:26

1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Quentin
12/27/2013 7:42:29 PM
Marcus wrote:

> "symbol deprecated" in SysUtils

It would help to know which deprecated symbol you are using so someone can 
tell you what to switch to as a replacement.
 
--
Remy Lebeau (TeamB)
0
Remy
12/29/2013 2:49:25 AM
Quentin Correll wrote:

> What I wound up doing was "ANSI-fing" my source.  I used Replace to
> look for and replace, WHERE APPROPRIATE, String, Char and PChar to
> AnsiString, AnsiChar and PAnsiChar.  It didn't take that long at all
> and my "big-app" came up working the FIRST time I built-compiled it!
> Which was actually quite a pleasant surprise. <g>

To ease that pain, especially if you have many unit files, I recommend
a utility called 'Search and Replace' (by Funduc).

With it, you can specify more than once searc-replace pairs and it can
apply them to whole directory trees.
0
Adem
12/31/2013 5:12:33 AM
Adem,

| To ease that pain, especially if you have many unit files, I recommend
| a utility called 'Search and Replace' (by Funduc).
| 
| With it, you can specify more than once searc-replace pairs and it can
| apply them to whole directory trees.

Thanks for the recommendation. 


-- 

   Q 

12/31/2013 11:30:24

1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Quentin
12/31/2013 7:30:51 PM
Reply:

Similar Artilces:

Problem upgrading web service client from Delphi 7 to Delphi XE
In trying to upgrade our web service client to Delphi XE we have now get a web service error of Invalid Format. When we examine the SOAP request we see the following differences from Delphi 7 vs Delphi XE In Delphi 7 we get <SomeStuff xmlns="" xsi:nil="true" /> In Delphi XE we get <SomeStuff xsi:nil="true" /> We have narrowed the failure down to these differences in the client request. Is there anyway to get Delphi XE to generate a SOAP request with the xmlns attribute set to blank as it used to be? Hello, > In trying to u...

Upgrading to Delphi 2009 from Delphi 5
I've decided it's time to upgrade to Delphi 2009 Professional from my current Delphi 5 Professional which (according to the FAQ) makes me eligible for the upgrade pricing. However, I'd just like to clarify how this process works. My concern is that my Delphi 5 is not registered on the CodeGear site and this doesn't seem to be possible as far as I can tell. When installing the trial I noticed that Delphi 2009 registers itself with your CodeGear account so does this mean that the previous version must be registered there to verify you own a Professional edition? I plan to o...

Problem with Delphi 6 to Delphi 7 upgrade
I have just purchased Delphi XE because I have an immediate need of D7 which came for free with XE. I downloaded and installed D7 and I think I applied the Update 1 that I had also downloaded. After much messing around with old components, I have finally attempted to compile my D6 project with D7. I get the following error:- [Fatal Error] apm.dpr(225): Unit ExtDlgs was compiled with a different version of ExtCtrls.TPanel I have checked the library paths all point to D7 versions of everything and now am at a loss to know what to do next. Also checked the sequence to make sure that al...

Delphi 5 (string[80]) vs Delphi XE
Hi guys i'm trying to convert a old application made with Delphi 5 to Delphi XE 5 The probleme i have right now is about String[80] and the Read / Write procedure i have a type like that Type TEnrMess = record Mess : String[80]; MessSuiv : Word; Hint : Word; end; And i read/write this type to a File of TEnrMess My probleme is that the string have changed from Delphi 5 to Delphi XE i join the link of a simple of the probleme that can be compiled on delphi 5 and any Delphi XE https://mega.co.nz/#!wV1VyZzY!1ha5oOxTg7L1WJAOXutUygkj...

Delphi 7 to Delphi XE
Have been using Delphi 7 for many moons ( have got later versions but never upgraded to ) My first problem is: Component Palette. in XE it is a small toolbar docked in top right in Delphi 7 it gives a large view of all the components. I am struggling to be able to cope/access my components.in Delphi XE. Can I make the component pallette tool bar the same size as Delphi 7, or is there a fast way to view/choose all available components in XE, that I have not spotted yet? Kind Regards, Robert. Hi, What I know is that in Delphi 2010 and XE you can choose between t...

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

Delphi 5 to Delphi XE4
Thinking about making the conversion. Of course we have numerous components such as: TurboPower AsyncPro, TurboPower Orpheus ICS2 Synactis All-In-The-Box. You guys have any advice as to the effort and time it may possibly take. It is a large application, several hundred thousand lines. And that's what happens when using third party components, a lot of extra work. I have been burned a few times. I now minimize the use to a few well known suppliers, like TMS. I have "banned" a lot of other components. Regards, Ole > > Thinking about making the conver...

Delphi 5 to Delphi 6 and up
Dear List, Trying to add 7Zip compression support to my delphi application. I am using the ported 7Zip sdk (see their website, they have a link). I am stumped on how to rewrite a single function: function ReverseDecode(var Models: array of SmallInt; ....): ..... where the input is mostly a fixed size array of SmallInt. This code perfectly compiles and functions in Delphi 6 and up, but in Delphi 5 I get the error: There is no overloaded version of 'ReverseDecode' that can be called with these arguments And obviously, the input (fixed) isn't the same as the param de...

Delphi 5 To Delphi 2009
I upgraded to Delphi 2009 from D5. The install says I can install Delphi and/or C++. Delphi installed OK but I see nothing of C++. What am I missing or does my upgrade not include C++? Thanks It depends on what you bought. If you bought Delphi 2009 only, that's what you get. If you bought Delphi 2009 and C++ Builder 2009 you get both. My guess is you got Delphi 2009 only. The simplest way to verify is look your invoice - it should say I would think. You could also go to members.embarcadero.com, login, then click on my registered products. There will be a textual description of...

SEPA components for Delphi with Source Code (Delphi 5
Hi all, in the european union change next year the Bankingformat to the SEPA Format. All peoples and companies must change the bankingssoftware and the costumer data form acountnummers in the new IBAN and BIC numbers. See: http://www.arma-it.de/shop/artikelueber.php?wgruppeid=211&wgruppe_offen=211 Functions: - generate SEPA XML'S - Calc IBAN - BIC Database (DE,AT and CH) Questions: vertrieb@arma-it.de PS: Bankinssoftware for Develpoers (Germany only) http://www.arma-it.de/shop/artikelueber.php?wgruppeid=212&wgruppe_offen=212 El 26/10/13 21:38, A...

problem delphi 2010 apps with a delphi 5 pro Pchar
Hallo I build on till now alle tools and programas with delphi 5 pro now i have delphi 2010 want don't want rewite alle my DLL Tools Like The tool i made for making PDF In case of This DLL i can't becose the vcl i use in delphi 5 will not work in delphi 2010 *This call in apps* {code} Function GenratePDF(Settings:Pchar):Boolean; stdcall external 'GUPPDF2.dll'; {code} *In delphi 5 DLL* {code} Function GenratePDF(Settings:Pchar):Boolean; stdcall; {code} if call the function i get a "Access violation" i think that the settings parameter empty is...

Delphi 2006 to Delphi XE Crystal BPL problem [Edit]
I am in the process of migrating our application from Delphi 2006 to Delphi XE and, for ease of use, I have both 2006 and XE installed on my development computer. I access Crystal Reports XI RDC in our application and so I rebuilt the BPL in XE in order to add the new package to XE. However, when I try to add the package to XE I get the error message: “Registration procedure, Craxddrt_tbl.Register in the package c:\Documents and Settings\All Uers\Documents\RADS Studio\8.0\BPL\Crystal.bpl raised exception class EFilerError: Component TDatabase can’t be registered by package crystal.bpl be...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

Migration from Delphi 5 to Delphi 2005
Hi, Currently we are using Delphi 5 in that we have lot of source file now we planned to migrate from Delphi 5 to Delphi 2005. My question is - 1. Is it possible to migrate directly from Delphi 5 to Delphi 2005, my old code was developed using Delphi 5 IDE. Can we able to compile and build without any issue in Delphi 2005? 2. If we can able to do then what are the ways to migrate to Delphi 2005 IDE and also provide some link regarding this migrate? Thanks, Rizwan Rizwan Ahmed schrieb: > Hi, Currently we are using Delphi 5 in that we have lot of source > f...

Web resources about - Upgrade from Delphi 5 and Delphi XE: Variant and SysUtils unit problems. - embarcadero.delphi.general

[Delphi] unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Class - Pastebin.com
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) ...

Universally unique identifier - Wikipedia, the free encyclopedia
This article has an unclear citation style . The references used may be made clearer with a different or consistent style of citation , footnoting ...

Bitwise Magazine :: Chrome - marc hoffman interview
Bitwise Magazine :: the free online magazine for programmers and technical users

Smart pointers in Delphi
... UseIt;var x: TSmartPointer ;begin x := TLifetimeWatcher.Create(procedure begin Writeln('I died.'); end);end; {$APPTYPE CONSOLE}uses SysUtils;type ...

Handling iOS application events
One thing that I’ve wanted to try for quite a while is doing something when an app gets put in the background (user hits the home button for ...

Global Variables - RAD Studio XE3
Twenty global variables that previously resided in System.SysUtils , and which have been deprecated for several years, have now been removed ...

Get The Accessibility Support Pack For Delphi XE8 Firemonkey On Windows And Mac OSX
... pack for Delphi XE8 Firemonkey on Windows and Mac OSX. The accessibility pack brings screen reader support to Fi uses System.SysUtils, System.Types, ...

Contact Max Mobi Secure Team
Home About FAQ Contact Us facebook twitter google + Contact us You can submit your queries by filling the form mentioned below and click on the ...

FreeBSD Basics
Fun with Xorg Xorg includes several useful utilities and features that almost no one knows about. You can accelerate your display, nest one ...

IDE Fix Pack 2007 4.4 - Andy's Blog and Tools
Andy's Blog and Tools Delphi, C++Builder and other thoughts Skip to content Home IDE Tools DDevExtensions 2.6 IDE Fix Pack 5.1 IDE Fix Pack 2007 ...

Resources last updated: 2/8/2016 2:10:54 PM