What you could do then is take your entire string and scan backwards for the '.' character.
FOR I = STRLEN(filename) downto 1 do BEGIN
IF filename = '.' THEN BEGIN
newfilename := COPYSTR(filename,1,I-1);
I := 1;
END;
END;
I don't know exactly if that is the exactly what you need, but it might put you on the right track.
Regards,
KYDutchie
Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
What you could do then is take your entire string and scan backwards for the '.' character.
FOR I = STRLEN(filename) downto 1 do BEGIN
IF filename = '.' THEN BEGIN
newfilename := COPYSTR(filename,1,I-1);
I := 1;
END;
END;
I don't know exactly if that is the exactly what you need, but it might put you on the right track.
Regards,
KYDutchie
Thanks KYDutchie!
I know that I could do the extraction by my own but I was looking for an existent solution (build in navision or a microsoft library).
But it looks like that there is no such thing out there. So if nobody knows something I would follow your hint.
Comments
If you know the extension, then it is easy.
newfilename := COPYSTR(Filename,1,STRPOS(Filename,Extension) - 1)
That should do it.
Let me know if you need more help.
Regards,
KYDutchie
No I don't know the extension. I'm searching for a navision function or a ocx object that can extract the name and the extension from any filename.
thanks in advance
daniel
What you could do then is take your entire string and scan backwards for the '.' character.
FOR I = STRLEN(filename) downto 1 do BEGIN
IF filename = '.' THEN BEGIN
newfilename := COPYSTR(filename,1,I-1);
I := 1;
END;
END;
I don't know exactly if that is the exactly what you need, but it might put you on the right track.
Regards,
KYDutchie
Thanks KYDutchie!
I know that I could do the extraction by my own but I was looking for an existent solution (build in navision or a microsoft library).
But it looks like that there is no such thing out there. So if nobody knows something I would follow your hint.
thank you
Daniel