调用此查询时,我在运行时期间不断收到语法错误.
adoquery1.Active := false;
adoquery1.SQL.Clear;
SQLQuery := 'INSERT INTO Comics ';
SQLQuery := SQLQuery + '(Name,Issue,Series,Volume,Poster,';
SQLQuery := SQLQuery + 'Desc,Writer,Artist,Read,Link,Extra) ';
SQLQuery := SQLQuery + 'VALUE('+ quotedstr(SeriesName+' '+IssueNumber);
SQLQuery := SQLQuery + ','+ quotedstr(IssueNumber);
SQLQuery := SQLQuery + ','+ quotedstr(SeriesName);
SQLQuery := SQLQuery + ','+ quotedstr(VolumeNumber);
SQLQuery := SQLQuery + ','+ quotedstr(Poster);
SQLQuery := SQLQuery + ','+ quotedstr(Desc);
SQLQuery := SQLQuery + ','+ quotedstr(Writer);
SQLQuery := SQLQuery + ','+ quotedstr(Artist);
SQLQuery := SQLQuery + ','+ quotedstr(haveRead);
SQLQuery := SQLQuery …Run Code Online (Sandbox Code Playgroud) 我想用Delphi学习OpenGL但是从未在Delphi中添加过库,甚至不确定这是否是你需要做的?任何人都给我一些步骤,我将如何将OpenGL添加到delphi,所以我可以在使用部分调用它?
只是用delphi学习一些OpenGL并尝试简单但没有得到结果的东西,我相信我应该得到一个深绿色的形式.但是当我跑这个我什么也得不到.也没有错误.也许错过了什么?
unit First1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls,OpenGL, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm2 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormPaint(Sender: TObject);
private
{ Private declarations }
GLContext : HGLRC;
ErrorCode: GLenum;
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
var
pfd: TPixelFormatDescriptor;
FormatIndex: integer;
begin
fillchar(pfd,SizeOf(pfd),0);
with pfd do
begin
nSize := SizeOf(pfd);
nVersion := 1; {The current version of the desccriptor is 1}
dwFlags := …Run Code Online (Sandbox Code Playgroud) 我需要在每次关闭或重新启动计算机时进行计数。因此,我相信我可以通过将批处理文件添加到开始菜单来完成此操作。因此,每次您打开 PC 时,它都会运行。当它运行时应该
open c:\count.txt
read in the value on that text file
add 1 to it
write the value to the text file
exit.
Run Code Online (Sandbox Code Playgroud)
但我没有太多使用批处理文件,并且不知道如何从文本文件中读取数字。
我有一个TCard(TGraphicControl组件),它有一个属性背景(TPicture)
我希望能够使背景变暗或变暗.因此,如果我可以在游戏中玩牌那么正常.如果我不能在游戏中玩牌,那么它会变暗.我试过Tcard.enabled :=false像你按一下按钮,但它不会使它变暗或使图像/背景变暗.
我也找不到TPicture的alphablend属性,因为我认为这可能会有所帮助.
我需要什么属性或组件来获得这种效果?
我从db获取一个值,当值为NULL时,我收到一个错误
无法将类型(null)的变体转换为类型(整数)
如果我用0填充数据库而不是空(NULL),则错误消失
所以说我有这个
OneSpell.PerCent := FQuery.Recordset.Fields[ DB_FLD_PER_CENT ].Value;
OneSpell.Plus := TCardPlus ( FQuery.Recordset.Fields[ DB_FLD_PLUS ].Value );
OneSpell.Quantity := FQuery.Recordset.Fields[ DB_FLD_QUANTITY ].Value;
Run Code Online (Sandbox Code Playgroud)
有没有办法说,如果值为NULL然后使其为0?或者这必须通过数据库来完成.
FQuery是adoquery和db是访问
我知道我能做到
if .... = null then
onespell.plus := 0
else
.........
Run Code Online (Sandbox Code Playgroud)
但我希望在onepell的每个值的一行中做到这一点
当用户在地图上滚动图像时,我想显示一个Map(myclass)提示.如果我做一些简单的事情,比如说提示说"怪物在这里"就可以了,但我想要的是在提示中显示所有怪物的细节.当我这样做时,提示永远不会出现并且程序锁定.也许它太多了?
程序正在进行中
procedure TBaseGameForm.HexMap1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
position:TPoint;
i : integer;
totalplayers : integer;
name : String;
Life,movement,magical1,magical2,Attack1,Attack2,Crit,Def : String;
begin
position := hexmap1.convertcoords(point(x,y),ptXY);
if FGamePlay.Locations.IndexOfName(inttostr(Position.x)+inttostr(Position.Y)) <> -1 then begin
if FGamePlay.ShowHints = true then
exit;
FGamePlay.ShowHints := true;
i:=1;
while i <= FGamePlay.NumberOfHostPlayers do
begin
if (FMyPlayers.player[i].Values['posx'] = inttostr(Position.X)) AND (FMYPlayers.player[i].Values['posy'] = inttostr(Position.Y)) then
begin
With FMyPlayers.player[i] Do begin
name := values['name'];
life := values['life'];
movement := values['move'];
magical1 := values['magical1'];
Attack1 := 'Magical: '+Magical1+' …Run Code Online (Sandbox Code Playgroud) 我将一些图像加载到对象列表中,然后尝试回忆它们.但它没有显示图像?
procedure TForm1.LoadImages(const Dir: string);
var
i: Integer;
CurFileName: string;
JpgIn: TJPEGImage;
BmpOut: TBitmap;
begin
//sets index for object list
CurIdx := -1;
i := 0;
while True do
begin
//gets current folder
CurFileName := Format('%s%d.jpg',
[IncludeTrailingPathDelimiter(Dir), i]);
if not FileExists(CurFileName) then
Break;
//creates jpgin
JpgIn := TJPEGImage.Create;
try
//loads jpgin
JpgIn.LoadFromFile(CurFileName);
//creates TBitmap and sets width to same as jpgs
BmpOut := TBitmap.Create;
bmpout.Width := jpgin.Width;
bmpout.Height := jpgin.Height;
try
BmpOut.Assign(JpgIn);
//if i assign it here it works, showing …Run Code Online (Sandbox Code Playgroud) 我的表格上有一个TShape.并想旋转它.这可以用TShape完成吗?如果是这样如何?我认为它只是根据一些坐标绘制形状.也许有Coords可以改变?谢谢.
我正在尝试将一些C ++代码转换为delphi,但不确定此操作符是什么还是如何在delphi中创建它
/=
Run Code Online (Sandbox Code Playgroud)
它在c ++中说它是一个由商运算符赋值,但是不知道那是什么意思?
谢谢格伦