Delphi的语法问题 - Delphi / 语言基础/算法/系统设计
例子程序见附件,用Delphi 7进行编译
问题代码为
Delphi(Pascal) code:
if Node.ChildNodes <> nil then
begin
for i := 0 to Node.ChildNodes.Count - 1 do
begin
cNode := Node.ChildNodes.Get(i);
shapetype := cNode.NodeName;
if (shapeType = 'line') then
begin
shape := TLine.Create;
shape.ShapeType := shapetype;
shape.Name := cNode.AttributeNodes.Nodes['name'].NodeValue;
TLine(shape).X1 := cNode.AttributeNodes.Nodes['x1'].NodeValue;
TLine(shape).Y1 := cNode.AttributeNodes.Nodes['y1'].NodeValue;
TLine(shape).X2 := cNode.AttributeNodes.Nodes['x2'].NodeValue;
TLine(shape).Y2 := cNode.AttributeNodes.Nodes['y2'].NodeValue;
try
TLine(shape).Color := StringToColor(cNode.AttributeNodes.Nodes['color'].NodeValue);
except
TLine(shape).Color := ClBlue;
end;
end
else if (shapeType = 'rectangle') then
begin
shape := TRectangle.Create;
shape.ShapeType := shapetype;
shape.Name := cNode.AttributeNodes.Nodes['name'].NodeValue;
TRectangle(shape).X1 := cNode.AttributeNodes.Nodes['x1'].NodeValue;
TRectangle(shape).Y1 := cNode.AttributeNodes.Nodes['y1'].NodeValue;
TRectangle(shape).X2 := cNode.AttributeNodes.Nodes['x2'].NodeValue;
相关问答:
已知Python 中:
s = unicode("测试", "gb2312")
s = u'\u6d4b\u8bd5'
print s
测试
在Delphi里面如何将\u6d4b\u8bd5这样的还原成Gb2312的汉字呢?
找到个方法
......
返回的内容是如下代码,怎么能渠道2b?
<p class="text1">1a </p>
<p class="text1">2b </p>
<p class="text1">3c </p>
<p cl ......
问大家个问题:
现在有一个现成的程序,是visual foxpro做的,数据库是dbf文件,我没有用过foxpro,开始都没找到数据库,终于看明白原来dbf就是数据库,(但这个程序好多个dbf啊!还没安装foxpro,没打开这些数据库 ......
//DLL 放在EXE中没问题
function SkinForm(var skfrm:TForm):Integer;stdcall;
var
skf:TbsBusinessSkinForm;
nskfrm:TForm;
begin
frmUUMain:=skfrm;
skf:=TbsBus ......