Link to home
Start Free TrialLog in
Avatar of eduardo12fox
eduardo12foxFlag for Brazil

asked on

How get data after string

Hello guys,

I have a procedure and I need get part of string.

procedure TEMPRESA.btn1Click(Sender: TObject);
var
  ArquivoOrigem: TFileStream;
  ConteudoBase64: TStringStream;
  Arquivo64EmString: String;
  MyFilesExtension:string;
  CaminhoPasta:string;
  Dia:string;
  Mes:string;
  Ano:string;
  Hora:string;
  Minuto:string;
  segundo:string;
  NomeLiteralImagem:string;

begin

     Dia        := FormatDateTime('dd', Date );
     Mes        := FormatDateTime('mm', Date );
     Ano        := FormatDateTime('yyyy', Date );

     Hora       := FormatDateTime('hh',now);
     Minuto     := FormatDateTime('nn',now);
     segundo    := FormatDateTime('ss',now);



  if Length(EdtOrigem.Text) > 0 then
  begin


    CaminhoPasta := 'C:\FlexByouERP\Anexos\'+Dia+Mes+Ano+Hora+Minuto+segundo;

Open in new window



In variable CaminhoPasta  I need get all after  'C:\FlexByouERP\Anexos\'

how do that?
Avatar of Rgonzo1971
Rgonzo1971

Hi

why don't you use
     myDateTime        := FormatDateTime('ddmmyyyyhhnnss', Now );

Open in new window

I would recommend
 
     myDateTime        := FormatDateTime('yyyymmddhhnnss', Now );

Open in new window

Regards
Thats going from london to paris via new york.
You'll get there, but it will take 2 days.

For sorting it's better to use year,month,day like rgonzo1971 suggests
Avatar of eduardo12fox

ASKER

Sorry, I did not know how to explain. I not get nothing about date. I need get data after the phrase   'C:\FlexByouERP\Anexos\'

in PHP for example exists a function  substr

$variable = substr(CaminhoPasta,0,infinity);

retult = 100920171232

this option show me exactly that I need but this is in PHP I need in delphi.
Maybe

Result := LeftStr(CaminhoPasta , length(CaminhoPasta)-16);

Open in new window

almost that Rgonzo1971

Now I get "C:\FlexByouERP\Anexos\"
I want get other part.
This "C:\FlexByouERP\Anexos\" I not get this I want after that sentence
ASKER CERTIFIED SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes!! Congratularion... Thaks!!!