Re: [fpc-pascal] mciSendString with long file names

2022-09-20 Thread James Richters via fpc-pascal
I ran into a problem just removing spaces for the alias name, I guess the slashes and colon from the path are not valid for the alias, so now I have a new function that removes everything that is not a letter, and that seems to have solved the problem: mciSendString(PChar(Ansistring('Close

Re: [fpc-pascal] mciSendString with long file names

2022-09-20 Thread James Richters via fpc-pascal
That Alias method does seem to work.. thank you for the suggestion, although it makes it more complicated for asynchronous operation, which is of course what I wanted. So here is what I came up with.. for synchronous operation, this works fine: mciSendString(Pchar(Ansistring('Open ' +

Re: [fpc-pascal] mciSendString with long file names

2022-09-20 Thread Jean SUZINEAU via fpc-pascal
May be by escaping the spaces with ^ ? Something like:  MyFileName:= StringReplace(MyFileName, ' ', '^ ', [rfReplaceAll]); ^ is the escape char for cmd.exe but may be it is active in this context too ? Le 20/09/2022 à 18:31, James Richters via fpc-pascal a écrit : I just tried it that

Re: [fpc-pascal] mciSendString with long file names

2022-09-20 Thread Alexander Hofmann via fpc-pascal
Hi, I'm not so sure if that's an FPC-only issue. MCI commands like that have been around for a while, so spaces might not have been "considered" in the first place. A workaround was presented years ago, I can only find the archived version:

Re: [fpc-pascal] mciSendString with long file names

2022-09-20 Thread James Richters via fpc-pascal
I just figured out that short filenames won't work, my files are on a linux server... not NTFS drives.. so I'm back to getting it to work with spaces the normal file names James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] mciSendString with long file names

2022-09-20 Thread James Richters via fpc-pascal
I just tried it that way: Var pcmd: String; MyFileName: String; pcmd:='play "'+MyFileName+'"'+#0; mciSendString(@pcmd[1],Nil,0,0); I get the same results, files with no spaces in the name even long file names play fine, if there's spaces, they won't play. I had the idea to just get the

Re: [fpc-pascal] mciSendString with long file names

2022-09-20 Thread Alexander Grotewohl via fpc-pascal
I've only ever done this like: pcmd: string; pcmd:='open "'+filename+'" ... '+#0; mciSendString(@pcmd[1], ...); mciSendString does return errors.. duno if that'll be helpful. I originally used it in Virtual Pascal and had to make a partial header myself so the FreePascal one might take

[fpc-pascal] mciSendString with long file names

2022-09-20 Thread James Richters via fpc-pascal
I'm trying to get mciSendString() to work with long file names with spaces in them and I'm not having any success. I know with winnows you need quotes around long file names, so I'm trying things like this: Var MySoundFile:String; mciSendString(PChar('play