你有没有开发Delphi Prism 2010或2011?如果是这样,你的主要投诉是什么?我似乎无法对相对较新的版本发现太多批评.你用它来做什么?Windows上的.NET应用程序?在不同的操作系统上?你最喜欢它的什么?
谢谢!
我得到太多实际参数的错误
Procedure TSub.ReadUsers;
var
iPos , i : integer;
begin
ReadLine;
iPos := 0;
for i := 1 to Counter do
iPos := pos('#',sLine);
arrUsers[i] := copy(sLine, 1, ipos-1);
delete(sLine,1,iPos);//error in this line
iPos := pos('#',sLine);
end;
Run Code Online (Sandbox Code Playgroud) 我遇到的问题是我想在delphi中创建一个连接到MS访问数据库的类,但我不允许使用任何类型的数据集,查询或表组件.我找到了一种连接数据库的方法(代码如下):
procedure TForm1.FormCreate(Sender: TObject);
begin
conn := TADOConnection.Create(nil);
conn.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files (x86)\Delphi7SE\Projects\Bpl\Database11.mdb;Persist Security Info=False';
conn.LoginPrompt := False;
qr := TADOQuery.Create(nil);
try
conn.Connected := True;
except on e: EADOError do
begin
MessageDlg('Error while connecting', mtError, [mbOK], 0);
Exit;
end;
end;
try
conn.Open;
qr.Connection := conn;
ListBox1.Items.Clear;
qr.SQL.Text := 'Select * FROM Customer';
qr.Open;
while NOT qr.Eof do
begin
//ListBox1.Items.Add(IntToStr(qr.SQL.Add('SELECT FirstName FROM Customer;')));
ListBox1.Items.Add(qr.FieldByName('FirstName').Value);
qr.Next;
end;
conn.Close;
finally
conn.Free;
qr.Free;
end;
end;
Run Code Online (Sandbox Code Playgroud)
我想把它放到一个班级,但我不知道如何,因为我只在10到12年级完成了delphi.
有这个网站http://www.ingress.com/intel
要访问该网站,我们必须使用用户名和密码登录.
访问后,该站点使用JSON作为其数据.
我是JSON的新手.
任何人都可以举例说明如何使用Delphi从网站获取JSON数据?
我顺便使用Delphi 7.
谢谢.
如何在 Delphi XE2中将RegisterPowerSettingNotification与GUID_MONITOR_POWER_ON结合使用?
我有一些使用Delphi 2010和XE4构建的应用程序,它们在一个线程中使用Synchronize.我认为在Delphi 2010中将Synchronize引入了Delphi.我的线程运行得很好,所以这不是问题.
我的问题是:有没有办法在Delphi 2010之前与Delphi版本"同步"或者以不同的方式询问它,如何在没有Synchronize的情况下更新这些早期版本的Delphi中的GUI控件?
下面显示的代码是实际代码的子集,以减少此帖子的长度.
type
{ A TThread descendent for loading Images from a folder }
TFolderLoadingThread = class(TThread)
private
{ Private declarations }
AspectRatio: double;
protected
{ Protected declarations }
procedure Execute; override;
public
{ Public declarations }
constructor Create(CreateSuspended: Boolean);
end;
procedure TFolderLoadingThread.Execute;
{ Load images ImageEnView in the thread. }
begin
inherited;
{ Free the thread onTerminate }
FreeOnTerminate := True;
if not Terminated then
begin
{ Set the Progressbar.Max Value }
**Synchronize**(
procedure
begin …Run Code Online (Sandbox Code Playgroud) 我正在做一个自定义组件,Delphi XE2中TComponent的后代,我想右键单击它并有2个选项:Next和Previous(例如)
怎么办?请提供代码段或示例.
该选项应该在设计时出现,右键单击表单上的组件,现在是TComponent的后代.但如果有更好的选择来获得功能,则不需要这样做.
下一个和上一个将用于根据集合中的主题切换组件的颜色(通过所有者组件列表).
所以我试图登录一个程序,只需通过文本文件检查ID(用户名)和密码,但我得到了这个代码的I/O错误103,我无法弄清楚原因.我处于一个非常基本的delphi级别,对于糟糕的代码等抱歉
procedure TfrmLogin.btnLoginClick(Sender: TObject);
var
ID, Password: String;
PATLogins: TextFile;
checkpass, checkID: String;
correctpass, correctID: Boolean;
begin
ID:= edtID.Text;
Password:= edtPassword.Text;
correctID:= False;
correctpass:= False;
AssignFile(PATLogins, 'PATLogins.txt');
CloseFile(PATLogins);
Reset(PATLogins);
while ((NOT EOF(PATLogins)) OR (checkID = ID)) do
begin
ReadLn(PATLogins, checkID);
end;
if (checkID = ID) then
begin
correctID:= True;
end;
if EOF then
begin
ShowMessage('Incorrect ID');
edtID.Clear;
end;
CloseFile(PATLogins);
reset(PATLogins);
while ((NOT EOF(PATLogins)) OR (checkpass = Password)) do
begin
ReadLn(PATLogins, checkpass);
end;
if (checkpass = Password) then
begin
correctpass:= True; …Run Code Online (Sandbox Code Playgroud) 我有一个树视图和一个列表视图,以及一个应该将所选项目从树视图移动到列表视图的按钮.选择和传输完全正常,但删除树视图中的项目不是.它仅在我在树视图下选择单个项目时才有效.当我有TreeView1.MultiSelect := True,然后有一个问题.
这是我正在使用的代码:
For i := 0 to TreeView1.Items.Count-1 do Begin
If TreeView1.Items[i].Selected then
Begin
Itm := ListView1.Items.add;
.....
TreeView1.Items[i].Delete
Run Code Online (Sandbox Code Playgroud)
上述代码在某些选择后给出无效索引.不完美有时只添加两个中的一个.
尝试:
For i := TreeView1.Items.Count to 1 do Begin当我选择父节点中的所有元素被复制的最后一个元素时,这是不起作用的代码
for Itr := TreeView1.Items.Count-1 downto 0 do Begin
if TreeView1.Items[Itr].Selected then
begin
Str := TreeView1.Items[Itr].Parent.Text + ' ,' + TreeView1.Items[Itr].Text;
TrimLeft(Str);
for k := 0 to SaveList.Count -1 do Begin
If ansipos(Str, SaveList[k]) > 0 Then Begin
Value := StringReplace(SaveList[k], Str, '',[rfReplaceAll, rfIgnoreCase]);
End; …Run Code Online (Sandbox Code Playgroud) delphi ×9
delphi-2010 ×2
delphi-7 ×2
delphi-xe2 ×2
vcl ×2
components ×1
delphi-prism ×1
delphi-xe4 ×1
file ×1
http ×1
json ×1
listview ×1
ms-access ×1
oxygene ×1
split ×1
treeview ×1
winapi ×1