Re: as is what?
Re: as is what?
- Subject: Re: as is what?
- From: micro-people <email@hidden>
- Date: Tue, 26 Aug 2003 20:22:06 +0900
Hi,
well then
i wrote this:
set fh to open for access file "sarigama:@:as:aho" with write permission
try
write (("[[volm 0.7]]" as text) & return) starting at eof to fh
repeat 3 times
write "[[pmod " to fh
write (random number from 0 to 127 as text) to fh
write "]]" to fh
write "[[rate " to fh
write (random number from 100 to 5000 as text) to fh
write "]]" to fh
write "[[pbas " to fh
write (random number from 40 to 64 as text) to fh
write "]]" to fh
write "muuuuhah" & return to fh
end repeat
on error errMsg
close access fh
error errMsg
end try
close access fh
... but what came out was a weird one again
... so rewrote it to this:
set fh to open for access file "sarigama:@:as:aho" with write permission
try
write (("[[volm 0.7]]" as text) & return) starting at eof to fh
repeat 3 times
write "[[pmod " to fh
set a to random number from 0 to 127
write (a as text) to fh
write "]]" to fh
write "[[rate " to fh
set b to random number from 100 to 5000
write (b as text) to fh
write "]]" to fh
write "[[pbas " to fh
set c to random number from 40 to 64
write (c as text) to fh
write "]]" to fh
write "muuuuhah" & return to fh
end repeat
write "arf arf arf." & return to fh
on error errMsg
close access fh
error errMsg
end try
close access fh
... then happily got this:
[[volm 0.7]]
[[pmod 3]][[rate 3583]][[pbas 46]]muuuuhah
[[pmod 77]][[rate 2888]][[pbas 59]]muuuuhah
[[pmod 90]][[rate 4898]][[pbas 57]]muuuuhah
arf arf arf.
mmm
the third line of the latter is useful
(even though wondering why "eof" doesn't have to be "(get eof fh) + 1"
cause wanna prepare a bunch of variations of scripts
and "add" the result of this and that to the same file
but mmm
random numbers cannot be directly used "as" text
i still am lost at
"can do" and "can't do" aspects of "write" thing @ AS
thanx
BUYO-BUYO-IGOR------------------
http://buyobuyo.isgenius.com
"SaRiGaMa's Oil Vending Orchestra"
http://oil.isonfire.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.