delphi-xe2

Saving a value even after program is closed and reopened

大憨熊 提交于 2020-08-20 11:24:46
问题 I would like to know how to save the contents of a "variable" after program is closed and reopened. for eg: iCount:=0; inc(iCount)=1; when i close the program and reopen i want iCount to contain 1. Thank you. 回答1: There are many ways to do this. You need to save the value somewhere: in a file, in the Windows registry, in the cloud, ... File Perhaps the easiest approach is to use an INI file. Try this: Create a new VCL application. Add a field FMyNumber: Integer to the main form. To the main

Difference between
and

▼魔方 西西 提交于 2020-06-17 08:10:43
问题 I need to parse some text/xml files I get from different sources. Now I have found some problems with line breaks. In some files i get as line break, in some others i get only . Now our Delphi XE 2 has some problems with , it is not imported correctly. For example: 1. City State Result of import: City State City State Result of import: City&&State Why does this occur and how to solve it? 回答1: There is no difference between these two XML texts. specifies the same character as .

Difference between
and

陌路散爱 提交于 2020-06-17 08:10:22
问题 I need to parse some text/xml files I get from different sources. Now I have found some problems with line breaks. In some files i get as line break, in some others i get only . Now our Delphi XE 2 has some problems with , it is not imported correctly. For example: 1. City State Result of import: City State City State Result of import: City&&State Why does this occur and how to solve it? 回答1: There is no difference between these two XML texts. specifies the same character as .

How I can get the peak memory on Mac OS?

断了今生、忘了曾经 提交于 2020-05-25 19:56:19
问题 In Windows I can get the Peak Memory usage by calling GetProcessMemoryInfo function TProcess.Peek: Cardinal; var PMC: PPROCESS_MEMORY_COUNTERS; PMCSize: Cardinal; begin PMCSize := SizeOf(PROCESS_MEMORY_COUNTERS); GetMem(PMC, PMCSize); try PMC^.cb := PMCSize; if GetProcessMemoryInfo(FHandle, PMC, PMCSize) then Exit(PMC^.PeakWorkingSetSize) else Exit(0); finally FreeMem(PMC); end; end; What is the Mac OS equivalent to do this? 回答1: You can use /usr/bin/time -l <cmd> like this: /usr/bin/time -l

FastString Alternatives to Delphi XE2

我的未来我决定 提交于 2020-04-07 03:54:33
问题 When I asked this question a while ago, the FastString unit came to solve my problem. Now I am starting to migrate my software from D7 to XE2. My question is, what alternatives do I have now since it appears that FastString will no longer solve the problem? ...or, more optimistically, does Delphi itself solves this performance issues? 回答1: A Lot of the FastCode routines have been included in recent Delphi, so you might not need 3rd party libraries anymore. Try with the stock RTL/VCL, then see

How detect when a vcl style is changed?

限于喜欢 提交于 2020-03-16 05:57:14
问题 I use several WinAPi functions which needs the Handle of the form in order to work, due which the handle of the form is recreated when the vcl styles is changed many of the calls to these functions stop working. So I need a way to detect when the current vcl style is modified (changed) in order to update the calls to these functions.The question is How detect when a vcl style is changed? 回答1: When a vcl style is changed via the TStyleManager.SetStyle method a CM_CUSTOMSTYLECHANGED message is

How detect when a vcl style is changed?

China☆狼群 提交于 2020-03-16 05:57:11
问题 I use several WinAPi functions which needs the Handle of the form in order to work, due which the handle of the form is recreated when the vcl styles is changed many of the calls to these functions stop working. So I need a way to detect when the current vcl style is modified (changed) in order to update the calls to these functions.The question is How detect when a vcl style is changed? 回答1: When a vcl style is changed via the TStyleManager.SetStyle method a CM_CUSTOMSTYLECHANGED message is