At 15:43 2016-12-07, Sytze de Boer sytze.kiss@gmail.com wrote:
I'm still totally lost trying to capture a photo via AVICAP32, so now trying alternatives.
Using the Windows software Camera to take a photo. All is good. It places the photo into a folder C:\Users\Sytze\Pictures\Camera Roll
cdirs=FILETOSTR('picloc.txt')
What is the format of the file?
1) Does the file have an EOL? That would be copied to cdirs.
2) Does the file end with a backslash? If not, you could get something like C:\PICLOC1\PICLOC2*.jpg assigned to ldirs instead of C:\PICLOC1\PICLOC2*.jpg (Note the backslash, the THIRD backslash.)
ldirs=cdirs+"*.jpg" lPics=ADIR(picfiles,ldirs)
trcask350 =cdirs+picfiles(1,1) &&Yes, it now knows the picture trcask351 =Sys(5)+Curdir()+"PICS"+Alltrim(Str(matties.code))+"_PHOTO.JPG" **all is good at this stage
3) Does the pics subdirectory exist?
COPY FILE (trcask350) TO (trcask351)
Here's the problem The file in the 2nd location is a zero byte file
Can anyone suggest why this is so?
It previously got written that way and subsequent runs have done nothing to it? Try deleting it, and see what happens. I got errors from your code, not a zero byte file until I corrected the three issues.
Sincerely,
Gene Wirchenko