Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #34059
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2017-09-29 06:00 -0700 |
| References | (3 earlier) <e3f2f077-3643-4539-bb6a-1bf63a0a60c9@googlegroups.com> <61901091-8f1f-4e3b-abb9-4aa960c34ae4@googlegroups.com> <3a7b8a1c-46ab-4f69-a8a3-4b8b2de234a2@googlegroups.com> <d4e2ec64-8ec4-49c4-82e1-0236b0d5fcac@googlegroups.com> <bbf96640-92f9-4086-a02a-f3285c29c249@googlegroups.com> |
| Message-ID | <e646da78-c50e-4b72-94de-c2351fd416c9@googlegroups.com> (permalink) |
| Subject | Re: VB6/VBA array to JavaScript array |
| From | Julio Di Egidio <julio@diegidio.name> |
On Friday, September 29, 2017 at 2:55:59 PM UTC+2, Julio Di Egidio wrote: > On Friday, September 29, 2017 at 11:52:17 AM UTC+2, Bart Smissaert wrote: > > On Thursday, 28 September 2017 17:47:19 UTC+1, Julio Di Egidio wrote: > > > On Thursday, September 28, 2017 at 6:07:42 PM UTC+2, Bart Smissaert wrote: > > > > On Thursday, 28 September 2017 16:45:23 UTC+1, Michael Haufe (TNO) wrote: > > > > > Bart Smissaert wrote: > > > > > > Got some better information with better error handling: > > > > > > > > > > > > JS error description: > > > > > > Object doesn't support this property or method > > > > > > > > > > > > JS Error source: > > > > > > JS line number: 89 > > > > > > JS code line: > > > > > > var a = VBArray(UDF.Get2DByteArray(1, lBytes)); > > > > > > > > > > UDF is a free variable. Is it null? > > > > > > > > UDF is a VB6 class and it has been initialized, so it is active and not Null. > > > > Null is not the right word, in VB6 speak you would say it is not Nothing. > > > > > > You are writing JScript, not VBScript: and, given the error, something > > > is definitely not set as you are expecting it, the most common cause > > > indeed being undefined or null references. > > > > > > Also, probably unrelated, but shouldn't that be *new* VBArray()? > > > > So, do you think the JScript code is fine as it is and do you think it > > should work and make a JScript array from a VBA/VB6 array? > > The code is obviously not fine, you are getting a run-time error. > > > The UDF class works fine as I can run other JS code fine using procedures > > in that class. > > Have you tried running that call? What is it supposed to do when lBytes is > zero anyway? And, have you noticed that the array is lost in the function, > you return lBytes. But am I supposed to guess? You have not even told > which platform you are on, so it's not even possible to suggest specific > debugging constructs, anyway that's what you should do: either debug step > into it, or break it down to the single instruction and print to the console > or even just alert the values you get: e.g. of UDF (should be an object), > UDF.Get2DByteArray (should be a function), UDF.Get2DByteArray(1, lBytes) > (should be some array-like object, I guess), etc., you get the picture... P.S. Note also that you can only pass arguments by value in JS... What is the signature (i.e. arguments and return value) of UDF.Get2DByteArray? In fact, is there any public documentation for that UDF object? Julio
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-26 16:00 -0700
Re: VB6/VBA array to JavaScript array "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-09-28 05:45 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-28 06:21 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-28 06:37 -0700
Re: VB6/VBA array to JavaScript array "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-09-28 08:44 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-28 09:07 -0700
Re: VB6/VBA array to JavaScript array Julio Di Egidio <julio@diegidio.name> - 2017-09-28 09:47 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-28 10:15 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 02:52 -0700
Re: VB6/VBA array to JavaScript array Julio Di Egidio <julio@diegidio.name> - 2017-09-29 05:55 -0700
Re: VB6/VBA array to JavaScript array Julio Di Egidio <julio@diegidio.name> - 2017-09-29 06:00 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 06:29 -0700
Re: VB6/VBA array to JavaScript array Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-09-29 17:06 +0200
Re: VB6/VBA array to JavaScript array Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-09-29 16:10 +0200
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 07:13 -0700
Re: VB6/VBA array to JavaScript array Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-09-29 17:14 +0200
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 08:24 -0700
Re: VB6/VBA array to JavaScript array Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-09-29 19:08 +0200
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 10:41 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 08:27 -0700
Re: VB6/VBA array to JavaScript array Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-09-29 19:11 +0200
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 10:43 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 08:42 -0700
Re: VB6/VBA array to JavaScript array Julio Di Egidio <julio@diegidio.name> - 2017-09-29 11:28 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 12:23 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 13:18 -0700
Re: VB6/VBA array to JavaScript array Julio Di Egidio <julio@diegidio.name> - 2017-09-29 15:34 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-30 04:44 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-30 05:43 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-30 08:48 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-30 07:52 -0700
Re: VB6/VBA array to JavaScript array "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-09-30 08:52 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-30 09:12 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-30 10:10 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-30 10:16 -0700
Re: VB6/VBA array to JavaScript array Bart Smissaert <bart.smissaert@gmail.com> - 2017-09-29 14:20 -0700
csiph-web