这个测试通过了Free Pascal 3.0.4。(源文件编码为UTF8,操作系统为Windows10 64位) {$MODE DELPHI}
...
var
Raw: RawByteString;
Actual: string;
begin
Raw := UTF8Encode('关于汉语');
Actual := string (UTF8Decode(Raw));
CheckEquals('关于汉语', Actual);
end 在Free Pascal 3.2.0中,它失败了: expected: <关于汉语> bu
我在pascal中使用xcode时遇到以下错误:
warning: It seems your project only contains units and no main program
导致此警告的原因是什么?我如何设置主程序?
我正在使用:Xcode 4.5.2、Free Pascal Compiler version 2.6.0和Mac OSX 10.8。
Delphi允许3个版本的Copy函数:
function CopyTest(const S: string): string;
begin
Result:= Copy(S, 1, 5);
Result:= Copy(S, 1);
// Result:= Copy(S); // not allowed for strings, allowed for dyn arrays
end;
FreePascal似乎只编译了第一个(3-arg)版本;对于其他版本,我有编译时错误
Error: Wrong number of parameters specified for call to
我希望在保存到数据库之前减少图像大小约200KB。假设我有一个大约39MB的位图文件,我需要将位图转换为Jpeg,然后将Jpeg文件压缩为200KB (所有类型的图形文件都可以转换(例如bmp,jpg,png),但最终的图形类型将是小于200kb的Jpeg )。我正在编写以下代码尝试转换(在本例中,我将jpg质量设置为10,因为我希望文件大小为200KB):
function BMPtoJPG(var BMPpic, JPGpic: string):boolean;
var Bitmap: TBitmap;
JpegImg: TJpegImage;
be