Colin B Maharaj
2008-07-08 12:13:58 UTC
Create a form, place a button on it and copy this code
in the button event handler. You are supposed to see
a Path in a message box but you don't.
(Tested in BCB6 and BCB3 - This is the compilers I have)
Oh and leave in the comments exactly as you see it..
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
AnsiString A = ParamStr(0); // example of A=C:\MyPath\MyProg.exe
AnsiString P = ExtractFilePath(A); // example of P=C:\MyPath\
ShowMessage(P);
}
//---------------------------------------------------------------------------
Question? Is this a bug or an oil-and-water situation
in that don't try to mix them - it won't work.
BTW: This code was based on some concepts that I was trying to
explain to someone, only to my surprise, I looked more like an
idiot than an expert. FOR HALF AN HOUR NO DOUBT!!
Colin B Maharaj
Trinidad, WI
in the button event handler. You are supposed to see
a Path in a message box but you don't.
(Tested in BCB6 and BCB3 - This is the compilers I have)
Oh and leave in the comments exactly as you see it..
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
AnsiString A = ParamStr(0); // example of A=C:\MyPath\MyProg.exe
AnsiString P = ExtractFilePath(A); // example of P=C:\MyPath\
ShowMessage(P);
}
//---------------------------------------------------------------------------
Question? Is this a bug or an oil-and-water situation
in that don't try to mix them - it won't work.
BTW: This code was based on some concepts that I was trying to
explain to someone, only to my surprise, I looked more like an
idiot than an expert. FOR HALF AN HOUR NO DOUBT!!
Colin B Maharaj
Trinidad, WI