write to file

Post your questions and help other users.

Moderator: Martin

Post Reply
Julio Botelho
Posts: 8
Joined: 22 Jul 2013 19:17

write to file

Post by Julio Botelho » 26 Aug 2013 12:52

I understand that Write to File uses text file, not binary.
But if i want to insert any especial character? For exemple, a Carriage Return and Line Feed?

On script, there are some string function like substring?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: write to file

Post by Martin » 26 Aug 2013 16:13

Hi,

You can write some special characters (like \r\n\t\f) using an inline expression. For example:
this is a text{"\r\n"}

The part between curly braces is interpreted as a script and is replaced by the value of the last expression within the curly braces.

Regards,
Martin

Julio Botelho
Posts: 8
Joined: 22 Jul 2013 19:17

Re: write to file

Post by Julio Botelho » 26 Aug 2013 17:43

Perfect.
I tried \r\n but wwithout braces

Thanls a lot.

And about substring?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: write to file

Post by Martin » 28 Aug 2013 15:50

Hi,

You can also write the contents of a variable to the file.
Assume you have a variable xyz that contains the string "test":
this is a {xyz} writes this is a test
this is a {substring(xyz, 2)} writes this is a st

The supported functions and some examples are available on the help page of action script or online: Action Script

Regards,
Martin

Post Reply