Data type of preprend array size in Flatten To String block

Hi 
The data type of the preprend array size in Flatten To String block is given as I32. Is it somehow possible to reduce the data type to I8, since the width and height of my array won't exceed 255 ?. I also need to do the same in Unflatten To String as well. 
Best regards
Oesen

Oesen wrote:
Hi 
The data type of the preprend array size in Flatten To String block is given as I32. Is it somehow possible to reduce the data type to I8, since the width and height of my array won't exceed 255 ?. I also need to do the same in Unflatten To String as well. 
The short answer is no.  This is because the index is an I32.  NI likes to keep integers as an I32 whenever possible for reasons like this.
Since you are dealing with a 2D array (width and height), it will actually use 2 I32s before the actual data.
As Ravens stated, you could put in your own array sizes before the array in the string.  But it is worth saving 6 bytes?  Not likely.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • XML operation resulted an XML data type exceeding 2GB in size. Operation aborted.

    I have table with one million rows, when i am using xml path ('Root'), it giving me an error 
    "XML operation resulted an XML data type exceeding 2GB in size. Operation aborted."
    This is a limitation of sqlserver. I have to xml path because i have to create nodes and attributes. In more complex case i will be joining multiple tables to get id and other attributes so combining multiple xmls in not an option here.
    any workaround....thanks in advance

    Here an example of your query that retrieve record in batch of 2 records. In real code, you should save the last id retrieved and call the query in a loop.
    DECLARE @BATCHSIZE AS integer
    SET @BATCHSIZE = 2
    DECLARE @LASTID As Integer
    SET @LASTID = 0
    select top(@BATCHSIZE) id as "@id"
    ,name as "@name"
    select id as "@id"
    ,name as "@name"
    select *
    from @products p
    where p.customer_id = cs.id
    group by id,customer_id,name
    for xml path ('product'),Root('products'),type
    from @customer cs
    where cs.client_id = c.id
    group by id,client_id,name
    for xml path ('customer'),Root('customers'),type
    from @client c
    where c.id > @LASTID
    order by c.id
    for xml path ('clients'),Root ('Main')

  • How to use the JE database with other data types than byte arrays?

    Hi! I searched the javadoc of Berkley DB JE, for a way to introduce entry (but I need also retrieve) data with other type than byte arrays, e.g. String, or anything else, as int may be, etc.
    Still, I didn't find any such way, because the main (only?!) method to entry data into an open database - according what I found in javadoc - is:
    "public OperationStatus put(Transaction txn, DatabaseEntry key, DatabaseEntry data) throws DatabaseException"
    and both this and the corresponding method for retrieves, are based on the same DatabaseEntry type, which allow only entry data on byte[] support.
    What if I need to use Strings or int, or even char? I must do a special conversion from these types, to byte[], to use the database?
    Thank you!

    On the doc page (this is also in the download package),
    http://download.oracle.com/docs/cd/E17277_02/html/index.html
    see:
    Getting Started Guide
    Java Collections Tutorial
    Direct Persistence Layer (DPL)
    All of these describe how to use data types other than byte arrays.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Data type table in a table component in a function block

    Hello,
    I have a function block with a table. This table has a component with data type = table.
    How can I raise this table under the main-table?
    Hope, I could explain it well.
    Thanks.

    Rahul_India wrote:
    I have a column as
    col1 which takes the combination of numbers and objects
    for eg. col1=1234abcDo you mean Alphabet?
    what should be the data type of the column VARCHAR2
    and how to insert data in itinsert into <table>(col1) values('1234abc')?
    If this is not what you expect, help us in helping you by reading {message:id=9360002}
    and providing relevant details.

  • Best data type to represent a file size

    Hi All!
    I have to create a table which holds details abou the files which process on a system and maintain the file name process, size of the file in byts, full path location the file is stores etc.
    My question is what would be the best data type for a file size, currently the system proceess 4 GB files but I do not know whether this will expand so I need a data type which will be compatible for any size ther will be no decimal points involved in this.
    I hope my question is clear.
    Thank you in advance.
    Regards, Shaamil.

    user8706423 wrote:
    Hi All!
    I have to create a table which holds details abou the files which process on a system and maintain the file name process, size of the file in byts, full path location the file is stores etc.
    My question is what would be the best data type for a file size, currently the system proceess 4 GB files but I do not know whether this will expand so I need a data type which will be compatible for any size ther will be no decimal points involved in this.
    I hope my question is clear.
    Thank you in advance.
    Regards, Shaamil.Simple as Oracle did in v$datafile's BYTES field:
    SQL> desc v$datafile
    Name                                      Null?    Type
    FILE#                                              NUMBER
    CREATION_CHANGE#                                   NUMBER
    CREATION_TIME                                      DATE
    TS#                                                NUMBER
    RFILE#                                             NUMBER
    STATUS                                             VARCHAR2(7)
    ENABLED                                            VARCHAR2(10)
    CHECKPOINT_CHANGE#                                 NUMBER
    CHECKPOINT_TIME                                    DATE
    UNRECOVERABLE_CHANGE#                              NUMBER
    UNRECOVERABLE_TIME                                 DATE
    LAST_CHANGE#                                       NUMBER
    LAST_TIME                                          DATE
    OFFLINE_CHANGE#                                    NUMBER
    ONLINE_CHANGE#                                     NUMBER
    ONLINE_TIME                                        DATE
    BYTES                                              NUMBER
    BLOCKS                                             NUMBER
    CREATE_BYTES                                       NUMBER
    BLOCK_SIZE                                         NUMBER
    NAME                                               VARCHAR2(513)
    PLUGGED_IN                                         NUMBER
    BLOCK1_OFFSET                                      NUMBER
    AUX_NAME                                           VARCHAR2(513)
    FIRST_NONLOGGED_SCN                                NUMBER
    FIRST_NONLOGGED_TIME                               DATE
    FOREIGN_DBID                                       NUMBER
    FOREIGN_CREATION_CHANGE#                           NUMBER
    FOREIGN_CREATION_TIME                              DATE
    PLUGGED_READONLY                                   VARCHAR2(3)
    PLUGIN_CHANGE#                                     NUMBER
    PLUGIN_RESETLOGS_CHANGE#                           NUMBER
    PLUGIN_RESETLOGS_TIME                              DATE

  • Which Data-Types can be used as Widget Parameters?

    Hi,
    I have been playing about with widgets (specifically widget parameters) for a while now.
    I've got to wondering, exactly which data-types can Captivate turn into widget parameters?
    So far I know that you can use:
    Numbers,
    Strings,
    Arrays,
    Objects
    and Booleans,
    as parameters.
    Which ones am I missing?
    I know some don't work, because I tried storing a MovieClip as a parameter and that didn't work.

    Hi Eccles,
    You can set all basic data types supported in flash viz.,
    1)Numbers
    2)Strings
    3)Arrays
    4)Objects
    Since in Action script , an Object can be anything (array , array of objects , array of objects which by themselves are array of objects and so on ) , you can virtualy send anything as widget params
    But there are two caveats to this
    1)Object References
    -Object References do not have any meaning once the swf is closed.But the widget params have to be stored across sessions.So If you send a reference as part of widget params it is not going to work.
    This is why sending a Movie Clip (which is actually a reference to an Object ) does not work
    If you want to send such things you will have to 'serialize' the object.
    2)Size of the Object that you send
    The size of the object that you send can have an impact on performance.And since any object that you send has to be converted into XML , objects like bitmaps can turn out to be huge and difficult to handle.
    This brings us down to this - you can send any object across as widget param as long as it is small and serialized.

  • New Effective CAL essay: How do I create an abstract data type in CAL?

      <p><strong>How do I create an abstract data type in CAL?</strong></p>  <p> </p>  <p>An <em>abstract data type</em> is one whose internal representation can be changed without needing to modify the source code of client modules that make use of that type. For software maintainability, it is a good idea to make a type that is subject to change or enhancement into an abstract data type. Another reason to create an abstract data type is to enforce invariants for values of the type that can only be ensured by using <em>constructor functions</em> (i.e. functions that return values of that type).</p>  <p> </p>  <p>In principle it is simple to create an abstract data type in CAL. For an algebraic data type, make the type constructor public and all data constructors private. For a foreign data type, make the type constructor public and the implementation scope private. If a scope qualifier is omitted, the scope is taken to be private.</p>  <p> </p>  <p>For example, the Map algebraic data type has the public type constructor Map and the data constructors Tip and Bin are each private, so it is an abstract data type.</p>  <p> </p>  <p>/** A map from keys (of type {@code k@}) to values</p>  <p>   (of type {@code a@}). */</p>  <p><strong>data</strong> <strong>public</strong> Map k a <strong>=</strong></p>  <p>    <strong>private</strong> Tip <strong>|</strong></p>  <p>    <strong>private</strong> Bin</p>  <p>        size      <strong>::</strong> <strong>!</strong>Int</p>  <p>        key       <strong>::</strong> <strong>!</strong>k</p>  <p>        value     <strong>::</strong> a</p>  <p>        leftMap   <strong>::</strong> <strong>!(</strong>Map k a<strong>)</strong></p>  <p>        rightMap  <strong>::</strong> <strong>!(</strong>Map k a<strong>);</strong></p>  <p><strong> </strong></p>  <p><strong> </strong></p>  <p>There are a number of invariants of this type: the size field represents the number of elements in the map represented by its Bin value. The keys in leftMap are all less than key, which in turn is less than all the keys in rightMap.  In particular, non-empty Map values can only be created if the key parameter type is a member of the Ord type class.</p>  <p> </p>  <p>Values of the Map type can be created outside the Cal.Collections.Map module only by using constructor functions such as insert:</p>  <p> </p>  <p>insert <strong>::</strong> Ord k <strong>=></strong> k <strong>-></strong> a <strong>-></strong> Map k a <strong>-></strong> Map k a<strong>;</strong></p>  <p><strong>public</strong> insert <strong>!</strong>key value <strong>!</strong>map <strong>= ...</strong></p>  <p> </p>  <p>The owner of the Cal.Collections.Map module must ensure that all invariants of the Map type are satisfied, but if this is done, then it will automatically hold for clients using this function.</p>  <p> </p>  <p>Some examples of foreign abstract data types are Color, StringNoCase  and RelativeDate:</p>  <p> </p>  <p><strong>data</strong> <strong>foreign</strong> <strong>unsafe</strong> <strong>import</strong> <strong>jvm</strong> <strong>private</strong> "java.awt.Color"</p>  <p>    <strong>public</strong> Color<strong>;</strong></p>  <p><strong> </strong></p>  <p><strong>data</strong> <strong>foreign</strong> <strong>unsafe</strong> <strong>import</strong> <strong>jvm</strong> <strong>private</strong> "java.lang.String"</p>  <p>    <strong>public</strong> StringNoCase<strong>;</strong></p>  <p><strong> </strong></p>  <p><strong>data</strong> <strong>foreign</strong> <strong>unsafe</strong> <strong>import</strong> <strong>jvm</strong> <strong>private</strong> "int"</p>  <p>    <strong>public</strong> RelativeDate<strong>;</strong></p>  <p> </p>  <p>The private implementation scope for Color means that a foreign function whose type involves Color can only be declared in the Cal.Graphics.Color module where the Color type is defined. A foreign function declaration involving the Color type relies on the compiler knowing that the Color type corresponds to java.awt.Color to resolve the corresponding Java entity i.e. it must know about the implementation of the Color type. Having a private implementation scope means that the Color type can be changed to correspond to a different Java class, or indeed to be an algebraic type, without the risk of breaking client code.</p>  <p> </p>  <p>In all these three cases there are useful, and different, design reasons to adopt a private implementation scope:</p>  <p> </p>  <p>For RelativeDate, the Java implementation type int represents a coded Gregorian date value in the date scheme used by Crystal Reports. Not all int values correspond to valid dates, and the algorithm to map an int to a year/month/day equivalent is fairly complicated, taking into account things like Gregorian calendar reform. Thus, it is desirable to hide the implementation of this type.</p>  <p> </p>  <p>For StringNoCase, the implementation is more straightforward as a java.lang.String. The reason to adopt a private implementation scope is to ensure that all functions involving StringNoCase preserve the semantics of StringNoCase as representing a case-insensitive string value. Otherwise it is very easy for clients to declare a function such as:</p>  <p> </p>  <p><strong>foreign</strong> <strong>unsafe</strong> <strong>import</strong> <strong>jvm</strong> "method replace"</p>  <p>    replaceChar <strong>::</strong> StringNoCase <strong>-></strong> Char <strong>-></strong> Char <strong>-></strong> StringNoCase<strong>;</strong></p>  <p> </p>  <p>which does not handle case-insensitivity correctly, but is a perfectly valid declaration. This declaration results in a compilation error when it is placed outside the module in which StringNoCase is defined because of the private implementation scope of StringNoCase.</p>  <p> </p>  <p>For Color, the issue is somewhat more subtle. The java.awt.Color implementation type is semantically the same as the CAL Color type. The problem is that java.awt.Color is mutable (since it can be sub-classed to create a mutable type). It is preferable for a first-class CAL type to not be mutable, so we simply make the implementation scope private to ensure that this will be the case. </p>  <p> </p>  <p>A somewhat less encapsulated kind of abstract data type can be created using <em>friend modules </em>and <em>protected</em> scope. For example, if an algebraic type is public, and all its data constructors are protected, then the data constructors can be accessed in the friend modules of the module in which the type is defined. Effectively this means that the implementation of the semantics of the type stretches over the module in which the type is defined, and all of its friend modules. These must all be checked if the implementation of the type is modified. </p>  <p> </p>  <p>Given the merits of abstract data types discussed above, it is perhaps surprising that most of the core types defined in the Prelude module are not abstract data types. For example: Boolean, Char, Int, Double, String, List, Maybe, Either, Ordering, JObject, JList, and all record and tuple types are non-abstract types. </p>  <p> </p>  <p>There are different reasons for this, depending on the particular type involved. </p>  <p> </p>  <p>For example, Boolean, List, Maybe, Either and Ordering are all rather canonical algebraic data types with a long history in functional languages, with many standard functions using them. They are thus guaranteed never to change. In addition, their values have no particular design invariants that need to be enforced via constructor functions. Exposing the data constructors gives clients some additional syntactic flexibility in using values of the type. For example, they can pattern match on the values using case expressions or let patterns.</p>  <p> </p>  <p>Essentially the same explanation holds for record and tuple types. Although non-tuple record types are less canonical, they do correspond to the fundamental notion of an anonymous named-field product type. The "anonymous" here simply means that the programmer can create an entirely new record type simply by creating a value; the type does not have to be declared anywhere prior to use.</p>  <p> </p>  <p>Char, Int, Double, String, JObject and JList are foreign types where in fact part of the semantics of the type is that we want clients to know that the type is a foreign type. For example, we want clients to know that Prelude.Int is essentially the Java primitive unboxed int type, and has all the semantics you would expect of the Java int type i.e. this is quite different from RelativeDate which is using int as its implementation type in a very tactical way that we may choose to change. One can think of a public foreign type declaration with public implementation scope as simply introducing the Java type into the CAL namespace.</p>  <p> </p>  <p>One interesting point here is with CAL&#39;s naming convention for public foreign types. We prefix a type name by "J" (for "Java") for foreign types with public implementation type such that the underlying Java type is mutable. This is intended as mnemonic that the type is not a pure functional type and thus some caution needs to be taken when using it. For example, Prelude.JObject has public Java implementation type java.lang.Object.</p>  <p> </p>  <p>In the case where the underlying Java type is not mutable, we do not use the prefix, since even though the type is foreign; it is basically a first class functional type and can be freely used without concern. For example, Prelude.String has public Java implementation type java.lang.String.</p>  <p> </p>  <p>In the case where the implementation type is private, then the fact that the type is a foreign type, whether mutable or not, is an implementation detail and we do not hint at that detail via the name. Thus Color.Color has as its private Java implementation type the mutable Java type java.awt.Color. </p>  <p> </p>  <p>When creating abstract data types it is important to not inadvertently supply public API functions that conflict with the desired public semantics of the type. For example, if the type is publicly a pure-functional (i.e. immutable) type such as Color, it is important not to expose functions that mutate the internal Java representation.</p>  <p> </p>  <p>A more subtle case of inadvertently exposing the implementation of a type can occur with derived instances. For example, deriving the Prelude.Outputable and Prelude.Inputable type classes on a foreign type, whose implementation type is a mutable Java reference type, allows the client to gain access to the underlying Java value and mutate it
    (by calling Prelude.output, mutating, and then calling Prelude.input). The solution in this case is to not derive Inputable and Outputable instances, but rather to define a custom Inputable and Outputable instance that copies the underlying values.</p>

    Hi Pandra801,
    When you create a the external content type, please try to add a filter based on your select statement.
    http://arsalkhatri.wordpress.com/2012/01/07/external-list-with-bcs-search-filters-finders/
    Or, try to create a stored procedure based on your select statement, then create ECT using the SQL stored procedure.
    A step by step guide in designing BCS entities by using a SQL stored procedure
    http://blogs.msdn.com/b/sharepointdev/archive/2011/02/10/173-a-step-by-step-guide-in-designing-bcs-entities-by-using-a-sql-stored-procedure.aspx
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Java Data Types?

    Hi,
    shall we say
    The data types in Java 1.5 can be divided into 4 categories. They are:
    i.     Primitive Data Types
    ii.     Abstract Data Types
    iii.     Arrays
    iv.     Enumerated Data Types
    ...............?

    Raijinsetsu wrote:
    I have to agree with jverd...
    Abstract is not a data type. Abstract declares a specific type of class which cannot be instantiated. Enumerations are just specialized objects. Arrays are also specialized objects.One could choose to consider arrays, enums, and abstract classes as separate categories.
    >
    If you wanted, the full list would be:
    Object (reference is another term you could apply to objects)
    int
    long
    short
    byte
    charEven if you include the primitives you forgot, this list is just as arbitrary as the original one, and does not correspond to the JLS.
    In particular, Object is not a type. There are primitives, references, and the null type.
    Edited by: jverd on May 6, 2009 7:56 AM

  • Arithmetic overflow error converting expression to data type int

    Hi
        iam creating on sp for  the  database total size , used mb and  free size .  percentage free . 
     in  this purpose i was creating on sps, with in the sp iam was writing  one select statement . it  statement is    
    SELECT [Drivename] ,[DataSizedUsedMB],[DriveFreeSizeMB],DriveTotalSizeMB,
      CAST( (DriveFreeSizeMB/DriveTotalSizeMB)*  100 AS NUMERIC(5,2))
       As
      [PercentFree] ,[DateRecorded] FROM 
    SELECT SUBSTRING([physical_name],1,1) AS Drivename,
      CAST(((SUM(COALESCE(size,0)))*8)/1024 AS NUMERIC(20,2)) AS DriveTotalSizeMB,
      CAST(((SUM( COALESCE( FILEPROPERTY( [name],'SpaceUsed'),0)))*8)/1024 AS NUMERIC(20,2)) AS DataSizedUsedMB,
      CAST(((SUM(COALESCE(size,0))-SUM(COALESCE(fileproperty([name],'spaceused'),0)))*8/1024)AS NUMERIC(20,2)) AS DriveFreeSizeMB
      ,SYSDATETIME()  AS [DateRecorded]
    FROM sys.master_files 
    GROUP BY SUBSTRING([physical_name],1,1))  AS Data
      it was executive one  server with out error  but the same select  statement is writing antoher server iam geeting  belo error.
    "@ErrorDesc: Line 24 - Line 13- Arithmetic overflow error converting expression to data type int." 
      how to slove this issue..
    please help me...

    Change 8 to 8E0, to make it a float literal. The data type of
    SUM(COALESCE(size,0)))*8)
    is int, since all components are int, and it can easily overflow the size for an int. If you use 8E0, you get a float, and the entire expression will be float.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • MessageType and Data Type

    Hi Experts,
    In IR we are creating DataTypes and MessageTypes what excatly the main difference between why we need to create 2 things.

    Hi,
    Data types are abstract in nature,
    Data type defines the structure of your xml message.Message type is the wrapper of data type.You will be using your message type while mapping and not the data type.Its the abstraction concept used in oops
    A data type in a programming language is a set of data with values having predefined characteristics.
      Examples of data types are: integer, floating point unit number, character, string, and pointer.
    The characteristic of columns and variables that defines what types of data values they can store.
    Examples include character, floating point and integer
    Check out the details:
    http://en.wikipedia.org/wiki/Data_type
    A message type comprises a data type that describes the structure of a message. At the following points in SAP Exchange Infrastructure you can refer to the message to be exchanged at runtime by using the message type.
    details: http://help.sap.com/saphelp_nw04/helpdata/en/2d/c0633c3a892251e10000000a114084/content.htm

  • Decimal data type multiplied by quantity data type

    Hi all,
    i have a requirement where i have to multiply 3 fields, and get that result into fourth field.
    example:
    data: f1 type dec,    [Data type - Decimal; length 7]
            f2 type dec,    [Data type - Decimal; length 7]
            f3 type quan.  [Data type - Quantity; length 17]
    data: f4 type ??
    f4 = f1 * f2 * f3.
    what will the data type of field f4?
    Will field f4 be of decimal type. If yes, then what is the declaration syntax of f4.
    can i declare it as:
    data: f4 type dec.
    When i do this, i get an error saying type DEC is unknown.
    NOTE: For your information.I AM IMPLEMENTING THIS IN A  method inside a BADI.
    Points will be rewarded.
    Thanks in advance.

    Hi
    U need to use a reference to a dictionary field (like MSEG-MENGE) because there isn't an abap type to be used, the data type are only these:
    C     Character     
    N     Numeric string 
    D     Date        (YYYYMMDD)
    T     Time:            HHMMSS) 
    X     Byte (hexadecimal)         
    I      Integer                    
    P     Packed number       
    F     Floating point number
    STRING  String         Variable empty string
    If there isn't a dictionary field good for you, u can only use the type P.
    So or:
    DATA F4 TYPE MSEG-MENGE. (this field has 3 decimals)
    or
    DATA F4(16) TYPE P DECIMALS 2.
    Max

  • Difference Between Data type and message type

    Hi,
        i have doubt on data type and message type.why we are mapping the message type why not data type?wht is the difference between data type and message type?

    Hi Narayanana,
    Data type defines the structure of your xml message.Message type is the wrapper of data type.You will be using your message type while mapping and not the data type.Its the abstraction concept used in oops
    kanan thiyam  
    Posts: 28
    Questions: 7
    Registered: 1/8/07
    Forum points: 24 
       Re: What is deffernce b/w Data type and message type  
    Posted: Jun 13, 2007 8:05 AM    in response to: suresh k         Reply      E-mail this post 
    Hi Suresh,
    Data Type defines the structure of the message and it will be wrapped under Message Type.
    Hope the details below will clearify your doubts.
    A data type in a programming language is a set of data with values having predefined characteristics. Examples of data types are: integer, floating point unit number, character, string, and pointer.
    The characteristic of columns and variables that defines what types of data values they can store.
    Check out the details:
    http://en.wikipedia.org/wiki/Data_type
    A message type comprises a data type that describes the structure of a message. At the following points in SAP Exchange Infrastructure you can refer to the message to be exchanged at runtime by using the message type:
    Details:
    http://help.sap.com/saphelp_nw04/helpdata/en/2d/c0633c3a892251e10000000a114084/content.htm
    kanan

  • How I pass a cluster with array of various data type (double, I32, string)

    I have to pass from a VI to a Microsoft Visual C++ DLL, a cluster with some arrays of various data type. The problem is with Double array, that during Visual C debug is incorrect:the dimension is correct passed, but not array data. In the DLL I have inserted the C code genereted by LabVIEW. I tried to pass a cluster of only one array of double, and the results is the same. Then, I tried to pass a cluster with scalar number and the result is correct in only one case. If the double data is the first in the cluster, the result is correct; if the first is another data type, such as integer or boolean, the double data is incorrect during the debug of the DLL.
    This is the code of my DLL:
    // LabViewP
    aram.cpp : Defines the entry point for the DLL application.
    #include "stdafx.h"
    #include "LabViewParam.h"
    #include "extcode.h"
    BOOL APIENTRY DllMain( HANDLE hModule,
    DWORD ul_reason_for_call,
    LPVOID lpReserved
    switch (ul_reason_for_call)
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
    break;
    return TRUE;
    typedef struct {
    long dimSize;
    double elt[1];
    } TD2;
    typedef TD2 **TD2Hdl;
    typedef struct {
    TD2Hdl elt1;
    } TD1;
    // This is an example of an exported variable
    LABVIEWPARAM_API int nLabViewParamPass=0;
    // This is an example of an exported function.
    LABVIEWPARAM_API int LabViewParamPass(TD1 *pparam)
    double parametro;
    int i;
    for (i=0;i<(**(*pparam).elt1).dimSize;i++)
    parametro=(**(*pparam).elt1).elt[i];
    return 42;
    // This is the constructor of a class that has been exp
    orted.
    // see LabViewParam.h for the class definition
    CLabViewParam::CLabViewParam()
    return;
    I use LabVIEW 7.0 and Windows XP.
    Sorry for my english.
    Thanks to every one for your suggestions.
    Filippo

    > I have to pass from a VI to a Microsoft Visual C++ DLL, a cluster with
    > some arrays of various data type. The problem is with Double array,
    > that during Visual C debug is incorrect:the dimension is correct
    > passed, but not array data. In the DLL I have inserted the C code
    > genereted by LabVIEW. I tried to pass a cluster of only one array of
    > double, and the results is the same. Then, I tried to pass a cluster
    > with scalar number and the result is correct in only one case. If the
    > double data is the first in the cluster, the result is correct; if the
    > first is another data type, such as integer or boolean, the double
    > data is incorrect during the debug of the DLL.
    It is hard tell for sure, but you might have alignment problems. The
    key symptom
    is that you can pass a cluster of big and small fine, but
    small big doesn't pass correctly. You might also test this by seeing
    what the size of your struct is. For Boolean and Double, sizeof()
    should return nine bytes no matter what order the array is in. If you
    are getting different sizes, you have two options. You can either order
    them such that the sizes work, or you can build the EXE or a wrapper DLL
    so that the alignment matches LV's native alignment.
    Greg McKaskle

  • Arrays of Different Data Types

    Hi, I am studing Java Development as 2 of my units (Programming Theory and Programming Practice), and I have a problem with a program which involves an array that contains two data types; int and long. The program is designed to store Student ID's and Exam Marks (1 Exam Mark per ID). The program is designed to use sorting, and the array is to be populated at the start of program execution. It compiles fine, but I get an error when the program is running as soon as you input the first value. The program is not very complex, but I need to understand how to get this fixed and why is isn't already. Any help is appreciated as this is a genuine problem. This program follows a consistent style template given to me by my tutor. The source is given below, and I appreciate any positive response.
    Thanks in advance...
    Aaron
         Name: Aaron Allport ([email protected])
         Assignment Number: 7
         Program Title/Topic: Student Marks/ID's with use of Array's
         Program Description: Using arrays and search/sort methods,
                                  write a program that keeps a record of
                                  students on a module, and allows the
                                  data to be manipulated.
         Course Title/Unit: BTEC National in Computing
    import javax.swing.JOptionPane;
    class StudentRecord
         int mark;
         long sID;
    public class Assignment7
         public static void main(String args[])
              final int numOfStudents = 11;
              String highestMark;
              String lowestMark;
              String examMark;
              long studentID = 00000000;
              String menuChoice;
              StudentRecord module[] = new StudentRecord[numOfStudents];
              inputRecords(module, numOfStudents);
              do
              menuChoice = JOptionPane.showInputDialog(null,
                   "STUDENT MODULE MARKS\n\n" +
                   "1. Find student with highest mark\n" +
                   "2. Find student with lowest mark\n" +
                   "3. Find grade for a given student\n" +
                   "4. Sort records by Student ID\n" +
                   "5. Sort records by Student Mark\n" +
                   "6. Display all records");
                        if (menuChoice.equals("1"))
                             highestMark = findHighest(module, numOfStudents);
                        else if (menuChoice.equals("2"))
                             lowestMark = findLowest(module, numOfStudents);
                        else if (menuChoice.equals("3"))
                             examMark = findGrade(module, numOfStudents, studentID);
                        else if (menuChoice.equals("4"))
                             studentIDSort(module, numOfStudents);
                             displayData(module, numOfStudents);
                        else if (menuChoice.equals("5"))
                             markSort(module, numOfStudents);
                             displayData(module, numOfStudents);
                        else if (menuChoice.equals("6"))
                             displayData(module, numOfStudents);
                   } while (menuChoice.equalsIgnoreCase("Q") == false);     
                   System.exit(0);
         public static void inputRecords(StudentRecord module[], int numOfStudents)
              int i;
              String inputMark;
              String inputStudentID;
              for (i = 1; i < numOfStudents; i++)
                   module[ i] = new StudentRecord();
                   inputStudentID = JOptionPane.showInputDialog(null,
                                       "Please enter Student ID for position " + i + ":");
                   module[ i].sID = Long.parseLong(inputStudentID);
                   inputMark = JOptionPane.showInputDialog(null,
                                       "Please enter Student Mark for position " + i + ":");
                   module[ i].mark = Integer.parseInt(inputMark);
         public static String findHighest(StudentRecord module[], int numOfStudents)
              int highStudentID;
              int j;
              StudentRecord temp = new StudentRecord();
              boolean intChange = true;
              int pass = 1;
              String outputMark;
              String outputSID;
              while((pass <= numOfStudents - 1) && (intChange))
                   intChange = false;
                   for (j = 1; j <= numOfStudents - pass; j++)
                        module[j] = new StudentRecord();
                        if(module[j].mark > module[j + 1].mark)
                             intChange = true;
                             temp.mark = module[j].mark;
                             temp.sID = module[j].sID;
                             module[j] = module[j + 1];
                             module[j + 1].mark = temp.mark;
                             module[j + 1].sID = temp.sID;
                   pass++;
              outputSID = String.valueOf(module[module.length].sID);
              outputMark = String.valueOf(module[module.length].mark);
              return (outputSID + " " + outputMark);
         public static String findLowest(StudentRecord module[], int numOfStudents)
              String outputMark;
              String outputSID;
              int j;
              StudentRecord temp = new StudentRecord();
              boolean intChange = true;
              int pass = 1;
              while((pass <= numOfStudents - 1) && (intChange))
                   intChange = false;
                   for (j = 1; j <= numOfStudents - pass; j++)
                        module[j] = new StudentRecord();
                        if(module[j].mark > module[j + 1].mark)
                             intChange = true;
                             temp.mark = module[j].mark;
                             temp.sID = module[j].sID;
                             module[j] = module[j + 1];
                             module[j + 1].mark = temp.mark;
                             module[j + 1].sID = temp.sID;
                   pass++;
              outputSID = String.valueOf(module[1].sID);
              outputMark = String.valueOf(module[1].mark);
              return (outputSID + " " + outputMark);
         public static String findGrade(StudentRecord module[], int numOfStudents, long studentID)
              String foundGrade = "";
              int i;
              String outputSID;
              String outputMark;
              for (i = 1; i <= module.length; i++)
                   module[ i] = new StudentRecord();
                   if (studentID == module[ i].sID)
                        outputSID = String.valueOf(module[ i].sID);
                        outputMark = String.valueOf(module[ i].mark);
                        foundGrade = (outputSID + " " + outputMark);
              if (foundGrade == "")
                   JOptionPane.showMessageDialog(null,
                        "No grade found for Student: " + studentID);
              return foundGrade;
         public static void studentIDSort(StudentRecord module[], int numOfStudents)
              int i;
              int j;
              StudentRecord temp = new StudentRecord();
              for (i = (module.length - 1); i >= 0; i--)
                   for (j = 1; j <= i; j++)
                        module[j] = new StudentRecord();
                        if (module[j - 1].sID > module[j].sID)
                             temp = module[j - 1];
                             module[j - 1] = module[j];
                             module[j] = temp;
         public static void markSort(StudentRecord module[], int numOfStudents)
              int i;
              int j;
              StudentRecord temp = new StudentRecord();
              for (i = (module.length - 1); i >= 0; i--)
                   for (j = 1; j <= i; j++)
                        module[j] = new StudentRecord();
                        if (module[j - 1].mark > module[j].mark)
                             temp = module[j - 1];
                             module[j - 1] = module[j];
                             module[j] = temp;
         public static void displayData(StudentRecord module[], int numOfStudents)
              String outputMessage = "";
              int i;
              for (i = 1; i <= module.length; i++)
                   module[ i] = new StudentRecord();
                   outputMessage += (module[ i].sID + " " + module[ i].mark + "\n");
              JOptionPane.showMessageDialog(null,
                   "Data Display\n" +
                   "**** *******\n\n" +
                   outputMessage,
                   "Data Display", JOptionPane.INFORMATION_MESSAGE);
    }

    Try this piece of code...... I adapted it to your program, so it starts from 1. You should pass numOfStudents - 1 as numOfStudents to don't get the notorious error =D
    if (menuChoice.equals("1"))
    findHighest(module, numOfStudents - 1);
    I added the println statement because in your prog isn't present an output routine (well, at last I didn't see it..... maybe because I'm sleepy =) )
    public static void findHighest(StudentRecord module[], int numOfStudents)
    String outputMark;
    String outputSID;
    StudentRecord retValue = new StudentRecord();
    retValue.sID = module[1].sID;
    retValue.mark = module[1].mark;
    for (int i = 2; i <= numOfStudents; i++) {
         if (module.mark > retValue.mark) {
         retValue.sID = module[i].sID;
         retValue.mark = module[i].mark;
    outputSID = String.valueOf(retValue.sID);
    outputMark = String.valueOf(retValue.mark);
    System.out.println(outputSID + " " + outputMark);
    Hope it can help you

  • Error while assigning dates to associative array of date type

    Hi All,
    I am facing the issue while assigning dates to associative array of date type:
    Oracle Version:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Stored procedure i am trying to write is as following
    create or replace procedure jp1 (
    p_start_date date default trunc(sysdate,'MM')
    , p_end_date date default trunc(sysdate)
    is
    l_no_of_days number;
    type t_date_id is table of date
    index by pls_integer;
    l_date_id_arr t_date_id;
    begin
    l_no_of_days := p_end_date - p_start_date;
    for i in 0
    .. l_no_of_days - 1
    loop
        l_date_id_arr := p_start_date + i;
        dbms_output.put_line(p_start_date + i);
    end loop;
    end;
    I am getting error at line 14 while compiling this. and the error message is as following:
    Errors for PROCEDURE JP1:
    LINE/COL ERROR
    14/5     PL/SQL: Statement ignored
    14/22    PLS-00382: expression is of wrong type
    So while investigating this i tried to output the value of (p_start_date + i) using dbms_output.put_line and the output is date itself.
    create or replace procedure jp1 (
    p_start_date date default trunc(sysdate,'MM')
    , p_end_date date default trunc(sysdate)
    is
    l_no_of_days number;
    type t_date_id is table of date
    index by pls_integer;
    l_date_id_arr t_date_id;
    begin
    l_no_of_days := p_end_date - p_start_date;
    for i in 0 .. l_no_of_days-1
    loop
        --l_date_id_arr := p_start_date + i;
        dbms_output.put_line(p_start_date + i);
    end loop;
    end;
    output of the
    exec jp1
    is as following:
    01-DEC-13
    02-DEC-13
    03-DEC-13
    04-DEC-13
    05-DEC-13
    06-DEC-13
    07-DEC-13
    08-DEC-13
    09-DEC-13
    10-DEC-13
    11-DEC-13
    12-DEC-13
    13-DEC-13
    14-DEC-13
    15-DEC-13
    16-DEC-13
    17-DEC-13
    18-DEC-13
    I see the output as date itself. so why it is throwing error while assigning the same to associative array of date type.
    I tried to google also for the same but to no avail.
    Any help in this regard is appreciated or any pointer some other thread on internet or in this forum.
    Thanks in advance
    Jagdeep Sangwan

    Read about associative arrays :
    create or replace procedure jp1 (
    p_start_date date default trunc(sysdate,'MM')
    , p_end_date date default trunc(sysdate)
    ) is
    l_no_of_days number;
    type t_date_id is table of date
    index by pls_integer;
    l_date_id_arr t_date_id;
    begin
    l_no_of_days := p_end_date - p_start_date;
    for i in 0..l_no_of_days - 1
    loop
        l_date_id_arr(i) := p_start_date + i;
        dbms_output.put_line(p_start_date + i);
    end loop;
    end;
    Ramin Hashimzade

Maybe you are looking for

  • Could not open the file in application server

    Hi All, I have a Zreport which will write files on application server. When I tried to download it is showing me "Could not open the file". And when checked again with /nal11 the files does not exist. When I ran the Zreport again the file exist in ap

  • Midi out from Audigy2

    Hello! I have a Audigy 2 ZS (not Platinum, no front panel) with connected game port. With keyboard via midi cables I can play midi in, but how can I make the computer play midi to the external synthesizer? I mean is it possible to take MIDI OUT from

  • HT5868 why does my iphone KEEP asking if I trust this computer? I thought it was a onetime thing per computer?

    Why does my iPhone KEEP asking if I trust this computer? I thought it was a onetime thing per computer? I plug my iPhone 4s into the computer and every time I tell it to trust this computer, but a hour later if I plug in again, I have to say trust ag

  • Executing a Variable in a Stored Procedure containing an Update Statement

    Hi, I have created a Stored Procedure, it has one input parameter. Inside the Stored Procedure there are 5 other variables are declared, based on the input parameter 4 of these variables are populated. Fifth variable is a a concatenation of text and

  • It's taking me a long time to install my creative cloud.

    I went through with someone from adobe who call me from  (800)555-5555 & she log into my desktop & downloaded the adobe creative cloud.dmg & we tried installing it. It was taking more than half hour. Please advise.