Re: can't make { . . . } into an item [error message] michelle's solution
Re: can't make { . . . } into an item [error message] michelle's solution
- Subject: Re: can't make { . . . } into an item [error message] michelle's solution
- From: monk <email@hidden>
- Date: Sun, 15 Jul 2001 23:57:38 -0400
-- 7/14/01 07:50 pm: email@hidden said:
ok michelle (whenever your back online!)
i ran this and got a "parameter error" on the 3rd line here:
. . . read sourcefile using delimiter return
i kept getting that in some of my experiments too, i was never able to get
around it?!
again using os 9.0.4 and as 1.4.3.
howie 'monk'
>
set sourcefile to choose file
>
open for access sourcefile with write permission
>
set sourcelist to read sourcefile using delimiter return
>
>
try
>
set listlength to count (sourcelist)
>
set randomnumber to random number from 1 to listlength
>
if randomnumber is 1 then
>
set outputlist to the rest of sourcelist
>
else if randomnumber is listlength then
>
set outputlist to items 1 through -2 of sourcelist
>
else
>
set outputlist to items 1 through (randomnumber - 1) of sourcelist ,
>
& items (randomnumber + 1) through -1 of sourcelist
>
end if
>
set {tid, text item delimiters} to {text item delimiters, return}
>
set outputtext to outputlist as text
>
set text item delimiters to ""
>
set eof of sourcefile to 0
>
write outputtext to sourcefile
>
on error
>
set text item delimiters to ""
>
close access sourcefile
>
end try
>
>
try
>
close access sourcefile
>
end try