On 5/22/00 3:24 PM, Jacqueline Landman Gay at [EMAIL PROTECTED]
wrote:

> Steven D'Aprano wrote:
> 
>> The value of a string being the same string pretty much defeats the
>> purpose of having a value function. Why do you need a function that does
>> nothing?
> 
> I use this capability in HyperCard to quickly extract data from within
> quoted strings in database exports. I usually don't want quoted literals
> to be evaluated. If the quoted string contains commas or other item
> delimiters, then it isn't always possible to use the "replace" function
> to strip off the commas without screwing up the number of items in the
> data. The "value" function, on the other hand, works very well for this
> (or it does in HyperCard anyway.)
> 
> Suppose one record of my exported data looks like this:
> 
> "Jacque","Gay","President, HyperActive Software"
> 
> In HyperCard, the value of the last item of the line above is equal to
> its string literal, i.e., "President, HyperActive Software". In MC, I
> get a fairly random string returned.
> 
>> Then what is value("1+1")? Should it be the string "1+1"? Or the
>> expected result of 2?
> 
> I'd say if it were in quotes, it should be treated as a string literal
> and the value should be "1+1". If it isn't in quotes, the value should
> be 2.

Yes, that is the de facto standard way of handling this in xTalk, including
HyperCard, SuperCard, OMO, and, if memory serves, ToolBook and Gain as well.

-- 
 Richard Gaskin 
 Fourth World
 Multimedia Design and Development for Mac, Windows, UNIX, and the Web
 _____________________________________________________________________
 [EMAIL PROTECTED]                 http://www.FourthWorld.com
 Tel: 323-225-3717           ICQ#60248349            Fax: 323-225-0716


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to