/ 应用程序当前路径 /
ExtractFilePath(paramstr(0))
ExtractFilePath(application.ExeName)
/ COM中当前路径 /
.... ....
TCustomMG = class(TTypedComObject, ICustomMG)
function TCustomMG.getXmlPath: string;
var
xmlPath:string;
S:array[0..255] of char;
begin
Result:='';
GetModuleFileName(hinstance,s,length(s));
xmlPath := extractfilepath(s);
result := xmlPath;
end;
Var 类型 Null
VarToStr(MyQuery.FieldValues['newsort'])=''
INI操作
uses
inifiles ,
var inifile : Tinifile;
inifile := Tinifile . Create(ExtractFilePath(paramstr( 0 )) + ' config.ini ' );
MyConnection1 . Server := inifile . readstring( ' MySql ' , ' Server ' , ' 192.168.0.1 ' );
inifile . Writestring( ' Lang ' , ' Default ' , ComboBox2 . Items[ComboBox2 . ItemIndex]);
ComboBox Width
ComboBox 1.Perform(CB_SETDROPPEDWIDTH,400,0);
string替换
将abc中的b换成0
ShowMessage(StringReplace('abc', 'b','0',[rfReplaceAll])); //[rfIgnoreCase]