write fails
Ken Ray
kray at sonsothunder.com
Thu Aug 25 14:18:41 EDT 2005
On 8/25/05 11:55 AM, "Jeanne A. E. DeVoto" <revolution at jaedworks.com> wrote:
> At 11:22 AM -0500 8/25/2005, Ken Ray wrote:
>> Yes, you can, but remember that URL is both a keyword and a function, and
>> although it can work without parentheses for some file operations (like
>> "into"), it doesn't work when using "after" or "before" without using
>> parentheses, and can be touchy at other times.
>>
>> So I think we've been "getting away" with saying:
>>
>> put data into url "file:c:/my documents/test.txt"
>>
>> when we really should be saying:
>>
>> put data into url("file:c:/my documents/text.txt")
>
> I'm afraid that's not right, Ken. URL isn't a function, and while
> your example will work, Rev might not always let you get away with
> leaving out the space after "URL".
>
> The reason you need to use parentheses in statements like
> get URL ("file:" & myURL)
> is that URL resolution comes before "&" when resolving expressions.
> (Ken can stop reading here, since he's an expert and knows what that
> implies, but for everyone else: ;-)
Thanks for the correction, Jeanne... I think what threw me is that
apparently the engine doesn't require there to be a space after keywords
where there is something to evaluate that follows. So what appeared to me as
a function:
put URL("file:" & myURL)
was really something that Rev was allowing me to construct. I tested this
with the "while" keyword, and it turns out that this is perfectly valid:
put 1 into x
repeat while(x+1) < 10
put x after msg
add 1 to x
end repeat
... as is this using the keyword "word":
on mouseUp
put 1 into x
put word(x+1) of "This is a test"
end mouseUp
Although this is consistent, it still *looks* wrong to me... it looks like
"while" and "word" are functions in the example above. Is it just me, or is
this a bug that has been in the engine for a long time?
Just curious,
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