473,394 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

int64 method from COM into javascript

Hi

i have a property on a COM which returns int64:

var Milliseconds=Form1.Player.AbsolutePosition;
however for somereason the typeof(Milliseconds) isn't number but unknown....

I can't make any use of this.

Does any one knows how can I transfer it to number?

10x
Guy.
Jul 23 '05 #1
11 2204
Guy Jacubovs wrote:
i have a property on a COM which returns int64:
Which COM _object_? Which user agent?
var Milliseconds=Form1.Player.AbsolutePosition;
however for somereason the typeof(Milliseconds) isn't number but unknown....
There is no "unknown" type and, consequently, the typeof _operator_ (no
parantheses required) does not return an "unknown" string, only
"number", "string", "boolean", "object" and "function". Please specify.
I can't make any use of this.
With that little information I can't either and I doubt anyone else can.
Does any one knows how can I transfer it to number?


Provided that the property is a 64 bit integer value it should be
converted into a IEEE-754 double-precision floating-point number
as this is the only number format J(ava)Script supports.
PointedEars
Jul 23 '05 #2
Guy Jacubovs wrote:
i have a property on a COM which returns int64:
Which COM _object_? Which user agent?
var Milliseconds=Form1.Player.AbsolutePosition;
however for somereason the typeof(Milliseconds) isn't number but
unknown....
There is no "unknown" type and, consequently, the typeof _operator_
(no parantheses required) does not return an "unknown" string, only
"number", "string", "boolean", "object", "function" and "undefined".
Please specify.
I can't make any use of this.
With that little information I can't either and I doubt anyone else can.
Does any one knows how can I transfer it to number?


Provided that the property is a 64 bit integer value it should be
converted into a IEEE-754 double-precision floating-point number
as this is the only number format J(ava)Script supports.
PointedEars
Jul 23 '05 #3
Thomas 'PointedEars' Lahn wrote:
Guy Jacubovs wrote:
i have a property on a COM which returns int64:


Which COM _object_? Which user agent?
var Milliseconds=Form1.Player.AbsolutePosition;
however for somereason the typeof(Milliseconds) isn't number but
unknown....


There is no "unknown" type and, consequently, the typeof _operator_
(no parantheses required) does not return an "unknown" string, only
"number", "string", "boolean", "object", "function" and "undefined".


<quote cite="ECMA 262 3rd edition">
11.4.3 The typeof Operator
The production UnaryExpression : typeof UnaryExpression is
evaluated as follows:

1. Evaluate UnaryExpression.
2. If Type(Result(1)) is not Reference, go to step 4.
3. If GetBase(Result(1)) is null, return "undefined".
4. Call GetValue(Result(1)).
5. Return a string determined by Type(Result(4)) according to
the following table:

Type | Result
-------------------------------------------------
Undefined | "undefined"
-------------------------------------------------
Null | "object"
-------------------------------------------------
Boolean | "boolean"
-------------------------------------------------
Number | "number"
-------------------------------------------------
String | "string"
-------------------------------------------------
Object (native and |
doesn't implement |
[[Call]]) | "object"
-------------------------------------------------
Object (native and |
implements [[Call]]) | "function"
-------------------------------------------------
Object (host) | Implementation-dependent
</quote>

That final "Implementation-dependent" means that an alien primitive
wrapped in a host object has every right to return "unknown" if it feels
like it (and on IE some of them do).

Richard.
Jul 23 '05 #4
Hello All

you are all missing the point,

i don't care what typeof returns.... ;)
Here is the definition of AbsolutePosition in the idl:

[propget, id(12), helpstring("property AbsolutePosition")] HRESULT
AbsolutePosition([out, retval] __int64 * pVal);

All I want to is use this value in jscript.
Every time I want to access this value as a number (of example
division) jscript gives me an error

10x for the replies

Guy.
Jul 23 '05 #5
Guy Jacubovs wrote:
Hi

i have a property on a COM which returns int64:

var Milliseconds=Form1.Player.AbsolutePosition;

however for somereason the typeof(Milliseconds) isn't number but unknown....

I can't make any use of this.

Does any one knows how can I transfer it to number?

10x
Guy.


typeof Milliseconds can't be "transferred" to a number, since there doesn't
appear to be any "AbsolutePosition" property for the "Player" object on "Form1".

You can _try_ something like:

var obj = Form1.Player;
for (var prop in obj) {
document.write(
prop + ' = ' + obj[prop] +
' (' + typeof obj[prop] + ')' +
'<br>'
);
}

to see if it lists an "absolutePosition" or "AbsolutePosition" property.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #6
Guy Jacubovs wrote:
you are all missing the point,
I think in fact *you* do. Since ECMAScript and implementations use
IEEE-754 doubles only, there is no exact representation of a 64 bit
integer value in these languages. Proof: The largest value a signed
64 bit integer can hold is (2^63)-1 (1 MSB + 63 bits) which is
9223372036854775807. However, JavaScript (v1.5 in Mozilla Firefox)
returns 9223372036854776000 for Math.pow(2, 63)-1 because of the 64
bits available for the floating-point number some bits are required
for the exponent (the stored value is 9.2233720368547760E18):

<http://www.minet.uni-jena.de/~sack/SS04/download/IEEE-754.html>
i don't care what typeof returns.... ;)
If you would have bothered to read about J(ava)Script numbers as I
recommended previously, you would have recognized that "typeof" is
not really your problem.
Here is the definition of AbsolutePosition in the idl:

[propget, id(12), helpstring("property AbsolutePosition")] HRESULT
AbsolutePosition([out, retval] __int64 * pVal);

All I want to is use this value in jscript.
You can use only a rounded representation of it.
Every time I want to access this value as a number (of example
division) jscript gives me an error


We are not truthsayers. Show the source and the other information
requested previously.
PointedEars
Jul 23 '05 #7
ja******@yahoo.com (Guy Jacubovs) writes:
i have a property on a COM which returns int64:

var Milliseconds=Form1.Player.AbsolutePosition; however for somereason the typeof(Milliseconds) isn't number but unknown....
I assume you are speaking about a COM object used in Internet
Explorer. Your best chance of getting advice about
IE/JScript-specific programming like this (or just to finde people who
knows what you are talking about) is the newsgroup
<URL: news:microsoft.public.scripting.jscript >
Does any one knows how can I transfer it to number?


My, completely unfounded, guess would be to do either
Milliseconds.toDouble()
or
Number(Milliseconds)

Good luck
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #8
JRS: In article <40**************@PointedEars.de>, seen in
news:comp.lang.javascript, Thomas 'PointedEars' Lahn
<Po*********@nurfuerspam.de> posted at Fri, 18 Jun 2004 19:27:23 :

We are not truthsayers.


You are entitled to describe yourself thusly; but not to so describe the
rest of us, forsooth.

Those who are not British are warned not to emulate Pointy-Head's misuse
of the English language. Others should not need the warning.

--
© John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Jul 23 '05 #9
Oh my, I just have set up another OS and did not copy my killfile.
And now this again.

Dr John Stockton wrote:
JRS: In article <40**************@PointedEars.de>, seen in
news:comp.lang.javascript, Thomas 'PointedEars' Lahn
<Po*********@nurfuerspam.de> posted at Fri, 18 Jun 2004 19:27:23 :
We are not truthsayers.
You are entitled to describe yourself thusly; but not to so describe
the rest of us, forsooth.

^^^^^^^^^^^^^^
And you are entitled to speak for everyone else (but me)?
I am afraid that your arrogance grows (is?) beyond imagination.
Those who are not British
There are other countries on this planet that have the English language
as official and/or native language. The above statement of yours is
only another proof of your arrogant attitude.
are warned not to emulate Pointy-Head's ^^^^^^^^^^^^^ misuse of the English language. Others should not need the warning.


I read the term "truthsayer" in some of the "Dune" novels by Frank
Herbert, a great American science-fiction writer and, as I have recently
found out, I was simply mislead by my linguistic intuition. Of course
I meant a different thing; a person with prescience -- a *soothsayer*.
It sometimes happens that a translation that is inspired by intuition
is not the correct one (in German, "soothsayer" is "Wahrsager" --
"truth-sayer"). But it happens more often to me that my linguistic
intuition leads to an appropriate translation. So far for *my* use of
the English language.

And what about *yours*? There are far better ways than this to tell
people that they have made a mistake (and people /make/ mistakes, that
is how they learn to better themselves). Especially for off-topic
notes, there is private e-mail. Do you really think your *continuing
completely off-topic personal attacks* here will do (you, this
newsgroup, me) anything good? I wonder how and why an university
graduate like you continues to display such a behavior in public.
If I were in your place, I would be very much ashamed of it.
PointedEars, Score adjusted (again)
Jul 23 '05 #10
JRS: In article <40**************@PointedEars.de>, seen in
news:comp.lang.javascript, Thomas 'PointedEars' Lahn
<Po*********@nurfuerspam.de> posted at Sun, 20 Jun 2004 00:32:16 :
Oh my, I just have set up another OS and did not copy my killfile.
And now this again.
If you are afraid of personal criticism, you should not post to Usenet.
Sticking your head in the sand by kill-filing your critics is cowardly,
and leaves you exposed as an arse. A better approach would be to
refrain from deserving such criticism - in particular, to terminate your
dictatorial attitude to those whose postings, while compatible with
Usenet custom, are in breach of some irrelevant German document.
Dr John Stockton wrote:
JRS: In article <40**************@PointedEars.de>, seen in
news:comp.lang.javascript, Thomas 'PointedEars' Lahn
<Po*********@nurfuerspam.de> posted at Fri, 18 Jun 2004 19:27:23 :
We are not truthsayers.
You are entitled to describe yourself thusly; but not to so describe
the rest of us, forsooth.

^^^^^^^^^^^^^^
And you are entitled to speak for everyone else (but me)?
I am afraid that your arrogance grows (is?) beyond imagination.


You are not entitled to describe us all as liars; there must be here at
least some posters who have never, intentionally or otherwise, written
anything but the perfect truth.

Those who are not British


There are other countries on this planet that have the English language
as official and/or native language.


It is true that many call one of their official languages English. In
many of the Commonwealth countries, many inhabitants use English as good
as that used by the English. But in many countries where it is an
official language, it is sadly mistreated by the less well-educated
natives. That is why I wrote what I did; it expressed my meaning.

The above statement of yours is
only another proof of your arrogant attitude.
are warned not to emulate Pointy-Head's ^^^^^^^^^^^^^
misuse of the English language. Others should not need the warning.


I read the term "truthsayer" in some of the "Dune" novels by Frank
Herbert, a great American science-fiction writer


Rather long-winded; typically Murrican. In my youth, I thought that he
was moderately entertaining. You, too, should grow out of that,
eventually. But it is never wise to presume that a term used by an SF
writer is a current term in the language.

and, as I have recently
found out, I was simply mislead by my linguistic intuition. Of course
I meant a different thing; a person with prescience -- a *soothsayer*.
That's right. You used a pretentious word in ignorance of its meaning.
It would not be good for others to mis-learn from you.

And what about *yours*? There are far better ways than this to tell
people that they have made a mistake (and people /make/ mistakes, that
is how they learn to better themselves). Especially for off-topic
notes, there is private e-mail.


Irrelevant; I have no interest in educating you, a person of noxious
disposition; only in preventing those (a large majority) who have more
pleasant personalities than yours from being misinformed.

P.S. Also, 'borken' is not an English word. Use, as is proper,
'broken'.

--
© John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Jul 23 '05 #11
rh
Dr John Stockton wrote:
<snip>
P.S. Also, 'borken' is not an English word. Use, as is proper,
'broken'.


Actually, even some of the "less well educated natives" (more often
referred to by the English as those "dumb colonials") know that
"borken" is 'net clique-speak. And, as it is apparently intended to
do, draws response from those suffering the rasp.

However, neither to my knowledge, is "Murrican" an English word. Nor
is (capitalized) "Merkin". Both seem to enjoy a certain amount of
boilerplate exposure in postings under your name. It seems then,
readers should be entitled to draw appropriate conclusions (beyond not
fully trusting this posting) based upon your signature, wouldn't you
say? ;)

../rh
Jul 23 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Simon Devlin | last post by:
Hi folks, I've been bashing my head against this all afternoon and am now totally baffled. Given this (a simple routine to turn a ip address string into an decimal) <snip> Dim Parts(3) as...
5
by: harishashim | last post by:
I have gone through necessary step and have been able to use a .Net libraries (created using C#) in VB6. It run good untill I try to use certain function in the library that is using Int64 type as...
10
by: Lau Lei Cheong | last post by:
Hello, I really need to use volatile System.Int64 for a .NET v1.1 program in C#. But the compiler complains "a volatile field can not be of type long". How to work around it? Or is there any...
14
by: cj | last post by:
VB2003. I need a large positive integer. Which is larger int64 or double? I see int64 also apparently is known as long and will hold -9,223,372,036,854,775,808 through...
12
by: Allen | last post by:
My C extension works wrong, and debug it, found that sizeof (INT64) = 4, not 8. I compile on Windows XP platform. Please tell me how to fix it to support INT64? Thanks.
3
by: Tim Sprout | last post by:
To convert hex to Int64 I can use: string hex = "413208A97245F5AE"; Int64 intFromHex = System.Convert.ToInt64(hex, 16); //intFromHex = 4697826885160531374 How do I reverse this, and convert...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.