Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #34059

Re: VB6/VBA array to JavaScript array

X-Received by 10.107.97.26 with SMTP id v26mr4199787iob.22.1506690046079; Fri, 29 Sep 2017 06:00:46 -0700 (PDT)
X-Received by 10.157.33.247 with SMTP id s110mr60517otb.16.1506690046021; Fri, 29 Sep 2017 06:00:46 -0700 (PDT)
Path csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!v62no448421itd.0!news-out.google.com!194ni903itf.0!nntp.google.com!v62no447100itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.javascript
Date Fri, 29 Sep 2017 06:00:45 -0700 (PDT)
In-Reply-To <bbf96640-92f9-4086-a02a-f3285c29c249@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=2.33.22.180; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host 2.33.22.180
References <639d22ec-869c-482d-bd1c-4272dfb27b8c@googlegroups.com> <753cd5a0-573d-4e27-b312-60e63c209495@googlegroups.com> <a6c840c4-60c3-44d8-bb67-2af3df1066b2@googlegroups.com> <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>
User-Agent G2/1.0
MIME-Version 1.0
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>
Injection-Date Fri, 29 Sep 2017 13:00:46 +0000
Content-Type text/plain; charset="UTF-8"
Lines 49
Xref csiph.com comp.lang.javascript:34059

Show key headers only | View raw


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


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