Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: "MicroWorlds Forum" <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: MIA, Ask an Expert: write to a file
From: "Daniel Ajoy" <da.ajoy@xxxxxxxxx>
Date: Sun, 07 Nov 2010 11:29:25 -0500

On Sun, 07 Nov 2010 07:40:37 -0500, <askanexpert@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

hello
i want to write lots of commands to a text file,
but i want that every command will create a new file with a new name.
how  can i do that?


The command I would use is "savetext". From the help:

savetext path
Saves the text found in the current text box in a text file format.

The input can be a file name with or without an extension (and the file will be saved in the current directory) or a full or relative path.


savetext "story.txt


So, to create different filename words, you just have to know the command to create words. That command is called "word"

show word "happy "hour

happyhour

make "counter 1
show word "file :counter

file1

make "counter :counter + 1
show word "file :counter

file2


Daniel
OpenWorld Learning



  • Previous by thread: MIA, Ask an Expert: write to a file
  • Next by thread: Re: MIA, Ask an Expert: write to a file

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008