This is the code i write to manipulate the *.exe file path extractor:

Code:
program TextureLoad;


uses crt,SDL2,SDL2_image,SysUtils;


type R=array[1..100] of pSDL_Renderer;
	 T=array[1..100] of pSDL_Texture;


var window:pSDL_Window; Render:R; Texture:T; i:byte;


procedure Graphic_Initialisation;
begin
	clrscr;
	if SDL_INIT(SDL_INIT_VIDEO)<0 then
		begin
			writeln('The graphic mode could not be initializated');
			writeln('The application will now exit');
			exit;
		end
	else
		window:=SDL_CreateWindow('Texture Window',50,50,600,480,SDL_WINDOW_SHOWN);
end;


Procedure Load_Texture(ExePath:AnsiString);
begin
	T[1]:=IMG_LOADTEXTURE(R[1],ExePath+'data\space_armada1.bmp');
	T[2]:=IMG_LOADTEXTURE(R[2],ExePath+'data\space_armada2.bmp');
	T[3]:=IMG_LOADTEXTURE(R[3],ExePath+'data\space_armada3.bmp');
end;




Procedure ComposerFrame;
var Path:AnsiString;
begin
	Path:=ExtractPathFile('Texture.exe');
	Load_Texture(Path);	
end;
			
	
	
procedure Graphic_Destruction;
begin
	SDL_DestroyWindow(window);
	SDL_QUIT;
end;


Begin
	Graphic_Initialisation;
	SDL_Delay(2000);
	ComposerFrame;
	Graphic_Destruction;
end.
And the error is this: Arg no 2: AnsiString found but expected PChar.
How do i solve it? Is there some kind of function that convert a AnsiString to a PChar? Or something like this?