根据Unicode技术标准#10(UCA)进行整理,这是与Unicode兼容的一个单独的东西,如果你想知道这一点,不仅意味着排序/排序,还要比较,"字符串1等于字符串2的问题".有时,两个字符串中不相同值的代码点在整理和比较方面被认为是相同的,至少这是从Perl标准库的角度讨论的博客文章所暗示的.
我想知道的是,(a)Delphi XE2是否已经完全实现了整个Unicode排序规范,(b)如果没有,第三方库是否会这样做?
示例代码:
Str1 := Chr($212B);
Str2 := Chr($C5);
n := CompareStr(Str1,Str2); // in delphi this is not zero, under UCA rules, should be 0.
Run Code Online (Sandbox Code Playgroud)
根据Unicode归类规范,Unicode归类应该在比较时考虑所有上述等效的代码点.从二进制的角度来看,这没有任何意义,所以我很高兴Delphi中的CompareStr和perl中的cmp(来自链接的文章)都被Unicode故障污染了,但是如果你想做一个符合unicode的条件怎么办? Delphi中的整理,就像perl Unicode :: Collation库一样?怎么样?
更新 AnsiCompareStr将调用Win32 CompareString,并将处理一些特定于语言环境的情况,如上所述,并通过在互联网上阅读,经典的Windows unicode整理行为和UCA正在缓慢但不完全融合,UCA似乎是变得更改的一个它更像是Windows排序规则.
在Delphi 2009中,到目前为止我没有使用Generics的主要问题(使用Generics.Collections列表,没有特殊的泛型功能).
现在我发现这段代码会导致访问行中的AV MyList.Contains.
如果我声明TMyList = class(TList<TMyEntry>),则错误消失;
我应该避免TObjectList<T>或是我的代码中的其他内容导致此错误?
type
TMyEntry = class(TStringlist);
TMyList = class(TObjectList<TMyEntry>);
procedure TListTests.TestAV;
var
Entry: TMyEntry;
MyList: TMyList;
begin
MyList := TMyList.Create;
try
Entry := TMyEntry.Create;
MyList.Add(Entry);
Assert(MyList.Contains(Entry)); // <--- AV
finally
MyList.Free;
end;
end;
Run Code Online (Sandbox Code Playgroud) 我正在编写一个类,它将大型遗留应用程序的TMainMenu层次结构映射到TActionMainMenuBar项目.
从Steve Trevethen的EDN CodeCentralC文章中大量借鉴的最重要的方法看起来像这样.我为长度道歉,但这可能是我在这种情况下可以有意义地显示的最短代码长度:
procedure TMainMenuSkin.DoLoadMenu(
ActionList: TCustomActionList;
Clients: TActionClients;
AMenu: TMenuItem;
SetActionList: Boolean = True;
bRecurseFlag:Boolean = False);
var
I: Integer;
J: Integer;
AC: TActionClientItem;
ca : TCustomAction;
newAction : TSkinnedMenuAction;
aci:TActionClientItem;
submenuitem : TMEnuItem;
procedure PopulateNodeFromMenuItem(menuitem:TMenuItem);
begin
newAction := TSkinnedMenuAction.Create(Application.MainForm);
menuitem.FreeNotification(newAction);
newAction.FMenuItem := menuitem;
newAction.Name := 'action_'+newAction.FMenuItem.Name;
FNewMenuActions.Add(newAction);
newAction.ActionList := ActionManager;
newAction.Tag := menuitem.Tag;
ca := newAction;
ca.ImageIndex := menuitem.ImageIndex;
ca.HelpContext := menuitem.HelpContext;
ca.Visible := menuitem.Visible;
ca.Checked := menuitem.Checked;
ca.Caption := menuitem.Caption;
ca.ShortCut := …Run Code Online (Sandbox Code Playgroud) 我是c#的新手,并且已经在Delphi中编程了很多年.我坚持以下问题,我希望有人可以帮助我.
在Delphi中,您可以声明一个类型:
type
TBtn = (btYes, btNo, btOK);
Run Code Online (Sandbox Code Playgroud)
然后创建一个程序
procedure TfrmMain.Button(ABtn: TBtn);
begin
//Do something;
end;
Run Code Online (Sandbox Code Playgroud)
并调用这样的程序
Button(btYes);
Run Code Online (Sandbox Code Playgroud)
要么
Button(btNo);
Run Code Online (Sandbox Code Playgroud)
我想在C#中做同样的事情
public Button (ABtn TBtn, string AString){
//Do Someting;
}
Run Code Online (Sandbox Code Playgroud)
并称之为
Button(btYes,"Hallo World");
Run Code Online (Sandbox Code Playgroud)
我怎么能做到这一点?
我想像任何其他Web浏览器或Internet Explorer一样构建Internet浏览器,除了每个窗口应该使用唯一的缓存名称.有任何想法吗?或任何第三方组件?
我有一个Mac应用程序需要迁移到Windows.该应用程序是使用objc和Lua创建的.
我使用Delphi开发适用于Windows的应用程序.
是否有可能将Lua集成到Delphi并为windows phone7开发?
欢迎任何评论
谢谢
问题一
我有
var example : array[0..15] of char;
Run Code Online (Sandbox Code Playgroud)
我想将输入值分配给该变量
example := inputbox('Enter Name', 'Name', '');
Run Code Online (Sandbox Code Playgroud)
在高分单元中,我有记录和数组
type
points = record
var
_MemoryName : array[0..15] of char;
_MemoryScore : integer;
end;
var
rank : array[1..3] of points;
Run Code Online (Sandbox Code Playgroud)
var s: string;
a: packed array[0..15] of char;
highscoresdata.position[1]._MemoryName := StrPLCopy(a, s, Length(a)) ;
Run Code Online (Sandbox Code Playgroud)
返回 - >(186): E2010 Incompatible types: 'array[0..15] of Char' and 'PWideChar'
var s: string;
a: packed array[0..15] of char;
s := InputBox('caption', 'Caption', 'Caption');
FillChar(a[0], length(a) * sizeof(char), #0);
Move(s[1], …Run Code Online (Sandbox Code Playgroud) Win7x64,DelphiXe.编写了程序,该程序注册了控制面板小程序(如下所示:http://msdn.microsoft.com/en-us/library/bb757044.aspx).一切都完美无缺,小程序通常会被注册,显示和启动.
但是在删除登记的登记册的钥匙时:
HKEY_LOCAL_MACHINE\SOFTWARE \微软\的Windows\CurrentVersion\Explorer中\ ControlPanel控制面板\命名空间\ {0052D9FC-6764-4D29-A66F-2F3BD9E2BB40}
没有发生:
创建:
...
var reg1:tregistry;key:string;
begin
key:='SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\ {0052D9FC-6764-4D29-A66F-2F3BD9E2BB40}';
reg1:=tregistry.Create;
reg1.RootKey:=HKEY_LOCAL_MACHINE;
reg1.Access: = KEY_WOW64_64KEY + KEY_ALL_ACCESS;
if reg1.Openkey(key,true)=true then showmessage('ok');
reg1.Closekey;
reg1.free;
end;
Run Code Online (Sandbox Code Playgroud)
删除:
procedure TForm1.Button1Click (Sender: TObject);
var reg1:tregistry; key:string;
begin
reg1: = tregistry.Create;
reg1.RootKey: = HKEY_LOCAL_MACHINE;
reg1.Access: = KEY_WOW64_64KEY + KEY_ALL_ACCESS;
key: ='SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\{0052D9FC-6764-4D29-A66F-2F3BD9E2BB40}';
if reg1.KeyExists (Key)=true then Showmesage ('Key exists'); // work
if reg1.DeleteKey (Key)=true then Showmesage ('Ok'); // ! not work !
Showmesage (inttostr(getlasterror)); // show "0"
reg1.Free; …Run Code Online (Sandbox Code Playgroud) 我使用带有属性Flat集的TSpeedButton .当我按下它并产生异常时,它仍处于按下状态.下面图像的第一张图像是在按下按钮和第二张图像之前,当除外时,保留在该位置.

使用了两个事件,OnMouseDown和OnMouseUp.事件处理程序的代码是:
procedure TVector_Choice.Button_Down (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
FStart_X := X;
FStart_Y := Y;
FSelected := True;
end; // MouseDown //
procedure TVector_Choice.Button_Up (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Application.ProcessMessages;
if Assigned (FOnSelect) and FSelected then
begin
FOnSelect (Sender);
FSelected := False;
end; // if
end; // MouseUp //
Run Code Online (Sandbox Code Playgroud)
例程Button_Up中发生异常FOnSelect (Sender);.异常是通过try..finally处理,以便重置鼠标指针.我不知道如何重置"按下"状态,这不是我在上面试过的'Down'状态.我无法在小型测试程序中重现此行为.我使用Delphi XE.
如何将此按钮自动重置为未按下状态?
在DELPHI 2007应用程序中,我正在开发一些潜在客户刚刚发现有趣的是能够彼此共享数据和信息.
它们都有相同的应用程序.
都有独立的数据库
但是所有安装的应用程序都相同,并且他们可能希望在数据库之间共享(复制)一些数据类型.
如何让他们与同一应用程序的其他用户共享数据,但不能与整个互联网上的每个人共享数据.
我希望这是尽可能自动的,因为我已经考虑过涉及手动发送电子邮件的方法.
我知道Datasnap是一个选项,还有其他任何一个.
其目的是使具有相同应用程序的公司能够共享数据.
他们应该能够选择合作伙伴和发送什么.
我一直在调查datasnap,但想知道是否有另一种方法可以做到这一点
delphi ×10
action ×1
browser ×1
button ×1
c# ×1
collation ×1
delphi-2009 ×1
delphi-xe2 ×1
delphi-xe4 ×1
generics ×1
ipc ×1
lua ×1
ole ×1
registry ×1
twebbrowser ×1
uca ×1
unicode ×1