file name

Ken Ray kray at sonsothunder.com
Mon Jan 30 21:27:43 EST 2006


On 1/30/06 8:12 PM, "Jeff Hudson" <hudsonj at stillwater.k12.mn.us> wrote:

> How can I change the name when I am saving an ascii text  file.
> 
> I want a separate text file saved as each student finishes their work.
> 
> PUT studentanswers into URL "file:/Users/hudson/Documents/MCA.SCORES/testing1"
> 
> This saves the file I want.   I can't find a way to change testing1 to adjust
> for the variable       first & last

Well if your variables "first" holds the first name, and "last" holds the
last name, then do this (watch the line wrap):

  put studentAnswers into URL
But if your variables are named this way, I'd strongly suggest renaming them
to something that might not cause problems with the Revolution interpreter
as "reserved words" (like "go", and "put") - I'd recommend tFirst and tLast.
You also might want to include a extension (like ".txt") so there won't be
any guesswork as to what app should open the file.

Example:

  put "Ken" into tFirst
  put "Ray" into tLast
  put "file:/Users/hudson/Documents/MCA.SCORES/" & tFirst & tLast & ".txt"
into tPath
  put studentAnswers into URL tPath

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list