2009-12-09 3 views
2

Delphi에서 paramstr()과 비슷한 결과를 줄 수있는 간단한 문이 있습니까?Delphi Prism에서 paramstr에 해당하는 항목은 무엇입니까?

class method TMyClass.ParamStr(Index: Integer): String; 
var 
    MyAssembly: System.Reflection.Assembly; 
    Params : array of string; 
begin 
    if Index = 0 then 
    begin 
    MyAssembly:= System.Reflection.Assembly.GetEntryAssembly; 
    if Assigned(MyAssembly) then 
     Result := MyAssembly.Location 
    else 
     Result := System.Diagnostics.Process.GetCurrentProcess.MainModule.FileName; 
    end 
    else 
    begin 
    Params := System.Environment.GetCommandLineArgs; 
    if Index > Length(Params) - 1 then 
     Result := '' 
    else 
     Result := Params[Index]; 
    end; 
end; 

이 또한 구현을 포함 ShineOn 프로젝트를 볼 수

답변