Recording archieves with a different name in SD card

Hi, I'm trying to make this program create a new .txt file in my SD card everytime the Arduino runs. So I declared a string "Text01" and created a function that changes the last number in the string every time the code runs. The program compiles, but it doesn't create a file on my SD card.

It seems that I can't put a variable as a parameter in this part of the code:

if(Arq = SD.open ( nameArq , FILE_WRITE)){}

Can anyone help me with this??

If this "if(Arq = SD.open ( nameArq , FILE_WRITE)){}" is supposed to be a comparison, you need to change to a comparison:

if(Arq == SD.open ( nameArq , FILE_WRITE)){}

See the difference?

Paul

I don't think it is suppose to be a comparison. It is assigning the result of the SD.open() call and then testing for non-zero result (success) to then possibly write to the file.

I would really help to see the entire sketch <hint, hint>