Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4985 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am playing around with the File class, and I am trying to create files immediately in a container, without being created on the hard disk (just as an experiment, don't have a real goal yet:) )

I wrote the following lines of code:


def myFile = new File ( "test.txt" );

myFile << "First Line Of text";

return myFile;





When I run this 2 times the result is a text file in my container containing two times the line "First Line Of Text". When a run it three times it contains it three etc etc. (I guess you all get the picture)



I know that the command "<<" will append the text if the file already exists, so this means to me that somewhere in the memory the variable "myFile" is still alive...



So I created the following lines of code:





def myFile = new File ( "test.txt" );

myFile << "First Line Of text";

def myResult = myFile;

myFile = null;

return myResult;

But I have the same result. I restarted FileMaker, used the SMReset function, but it is always the same behavior.

What is going on in this piece of code?

This topic is 4985 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.