"Type" statement and arrays

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

dtshedd_at_yahoo.com
Date: 02/11/05


Date: 11 Feb 2005 06:14:16 -0800

I am having difficulty getting a user defined data type to function
with arrays. What I would like to do is create a data type that is
comprised of four 1-D arrays. Then I would like to load the individual
arrays in another module so I can trasnfer all four arrays as a single
argument (the new data type) in a function. Here's what I have done so
far

In one module;

Option Base 1

Public Type PlotScalars

    Xscalar(1 To 4) As Integer
    Yscalar(1 To 4) As Integer
    Zscalar(1 To 4) As Integer

End Type

In another module

Dim MyPlotScalars As PlotScalars

MyPlotScalars.Xscalar = Array(1, 0, 1, 1)
MyPlotScalars.Yscalar = Array(1, 1, 0, 1)
MyPlotScalars.Zscalar = Array(1, 1, 1, 0)

I get an error "Compile error: can't assign to array." I would prefer
not to have to load each element of the data type arrays one element at
a time. Is there an easy way around this?

My main motivation for doing this is to cut down on the number of
arguments passed to a user defined function (which are limited to 30).

TIA

dan



Relevant Pages

  • Re: Fortran Forum - Oh Boy
    ... At times is seems to be trying to be a bit string. ... > suggest it's an unsigned integer feature. ... > that aren't consistent with it being a data type. ... > function COUNT applied to arrays of bits. ...
    (comp.lang.fortran)
  • Re: The linf project (2)
    ... exactly two types - statically sized (known at compile time) and ... for local arrays in a procedure. ... to strings, except I am a little confused what a string ought to be. ... each data type comes in exactly one kind and anything else has to be ...
    (comp.lang.fortran)
  • Re: Sending Variable Length Messages with GNAT.Sockets
    ... > which data is defined in records (or arrays of records) which are sent ... > "variable" messages is to first read our message header which contains ... about the unchecked conversion if your data type isn't the size ...
    (comp.lang.ada)
  • Re: Oft-shared (perhaps?) Impressions of a Lisp Newbie
    ... (CONS leftPart rightPart) ... that data type to see a whole lot more functions you can play with. ... For example, in the chapter on arrays, first you do, ...
    (comp.lang.lisp)
  • Re: docmd.openform where statement not working
    ... Did you try the Load event? ... Are you getting a compile error? ... with quotes appropriate to the data type. ...
    (microsoft.public.access.formscoding)