JS valueOf() in RB ? 
Author Message
 JS valueOf() in RB ?

Hi all,

What would be the equivalent of JS valueOf() in RB?

Here's some exemples :
("obj" is a value passed to my function)

Like :
if (typeof(val = obj.valueOf()) == "string")
OR
if (typeof(val = obj.valueOf()) == "boolean")

What would be the equivalent of valueOf in RB?

Please, also reply to this email!

Thank,

Greg



Thu, 10 Oct 2002 03:00:00 GMT  
 JS valueOf() in RB ?
If I understtand what you mean there, you'll only need to use the
varType() function, no need for valueOf, azs RB does this automatically,
though varType only returns an integer, eg

if vartype(obj) = 8 then // 8 = string
or
if vartype(obj) = 11 then // 11 = boolean

Quote:

> Hi all,

> What would be the equivalent of JS valueOf() in RB?

> Here's some exemples :
> ("obj" is a value passed to my function)

> Like :
> if (typeof(val = obj.valueOf()) == "string")
> OR
> if (typeof(val = obj.valueOf()) == "boolean")

> What would be the equivalent of valueOf in RB?

> Please, also reply to this email!

> Thank,

> Greg

--
------------------------------------------------------
Phillip Hutchings
------------------------------------------------------
The EV/O Links Directory
 http://www.damnsw.net/~triplet/links/
What If? an EV Plugin
 http://www.damnsw.net/~triplet/what_if/index.php3
The REALbasic Forums
 http://www.damnsw.net/~triplet/cgi-bin/UltraBoard/UltraBoard.cgi


Fri, 11 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. JS-EAI with *JS*-callback

2. js.exception 3279.js

3. RB QuickStart Guider from RB

4. launching an RB app from another RB app - appleevents

5. RB Entwickler gesucht / RB Developers wanted

6. RB: row order by RB database

7. protocol.rb http.rb 1.1.24

8. replace setup.rb/install.rb with builtin module

9. install.rb/setup.rb question

10. Bugs corrected in DBD/ODBC/ODBC.rb and DBD/Proxy/Proxy.rb

11. NB. gray.js: a J verb that generates a grayscale postscript image from a 2d array

12. lapackTest.js

 

 
Powered by phpBB® Forum Software