saving data as .text

Joe's icon

Hey guys

Just wondering if someone could assist me with an issue I am having with saving data to a text file on closing the max patch.

I am trying to compile a list of data (numbers which will be gathered over a period of say 10 minutes), so the data needs to be compiled in a system of pairs. So when opened on the text file it might look something like this:

4 1
4 1
4 1

I thought I managed to sort this by using pack 0 0 (not sure if that works)

I have tested the patch, and save it as a .text file but when I open it, it is blank. So I am unsure if the problem is with the method of packing the data into pairs or with saving/opening the .text file.

Cheers

Max Patch
Copy patch and select New From Clipboard in Max.

Joe's icon

Okay, I have a slightly updated version which is now saving data correctly. The only problem now is it is not saving ALL the data. It only saves the first two numbers of the list. How can I make it to make a list in the same 4, 1 format? So in theory it could look like this;

4, 1. 4, 1. 4, 1. 4, 1.

cheers

Max Patch
Copy patch and select New From Clipboard in Max.

Luke Hall's icon
Max Patch
Copy patch and select New From Clipboard in Max.

The [coll] object needs a unique index number so if you send it a list beginning with 4 each time it will overwrite the previous data stored at index 4. You can either set a unique index using something like [counter] to increment the index with each new piece of data you send or switch to using [text] as shown in this example:

The "cr" stands for carriage return and tells the [text] object to start the next input on a new line.

Joe's icon

thanks mate, that system works fine. I have now adopted it to save a number to a time

see what you think

Max Patch
Copy patch and select New From Clipboard in Max.

Joe's icon

Is it possible to pre-determine the name of the file that is being saved?

so all the user has to do is press save and choose a location