Change Variable Type P to STRING but with thousand separators

Dear all,
I am no specialist (in abap/bsp).
I have a variable 'number' type p decimals 0.
I need that 'number' converted to a string but with the thousand separators.
Is there a function available?
Is is possible to give this function the desired character as a thousand separator?
E.g.
Character '.'  for German Number Format
Character ',' for US Number Format.
Thank you in advance for help.
Rewarding Points for helpful answers guaranteed.
Philipp

Hi Philipp,
I have written a report for you.
Just copy & paste the below code in your report.
Try changing the num variable in the report and see the result.
DATA: num TYPE p DECIMALS 0,
      de_str TYPE string,
      en_str TYPE string.
DATA: temp_str TYPE string,
      str_len TYPE i,
      count TYPE i,
      index TYPE i,
      sub_str TYPE string,
      sub_str_len TYPE string.
num = 1234567890.
temp_str = num.
str_len = STRLEN( temp_str ).
str_len = str_len - 1.
IF str_len >= 3.
  count = str_len DIV 3.
  index = 0.
  DO count TIMES.
    sub_str_len = ( count ) * 3.
    count = count - 1.
    index = str_len - sub_str_len.
    IF index < 3.
      sub_str_len = index.
      index = 0.
    ELSE.
      sub_str_len = 3.
      index = index - sub_str_len.
    ENDIF.
    IF index NE 0 OR sub_str_len NE 0.
      sub_str = temp_str+index(sub_str_len).
      CONCATENATE de_str sub_str '.' INTO de_str.
      CONCATENATE en_str sub_str ',' INTO en_str.
    ENDIF.
  ENDDO.
  index = str_len - 3.
  sub_str = temp_str+index(3).
  CONCATENATE de_str sub_str ',' '000' INTO de_str.
  CONCATENATE en_str sub_str '.' '000' INTO en_str.
ELSE.
  sub_str = temp_str+0(str_len).
  CONCATENATE de_str sub_str ',' '000' INTO de_str.
  CONCATENATE en_str sub_str '.' '000' INTO en_str.
ENDIF.
WRITE:  temp_str,
       / de_str,
       / en_str.
Hope it helps you.
Regards,
Maheswaran B
I have done a small change. Try it now!
        Maheswaran B
Message was edited by:
        Maheswaran B

Similar Messages

  • Change variable type during program flow

    Hi there. Please tell me is there a possibility in ABAP to change variable type during program flow? I'd be very thanful for suggestions. Greetings.

    hi,
       Make use of field symbols for that ...
    field-symbols : <fs> type any.

  • Hi , I changed my router 2 weeks ago but with same ISP Plusnetw the Mac defaults to BT Openzone everytime I aces the internet.I have to go to internet connections and choose plus net every time Closing the lock mechanism does not stop it happening next

    Hi I changed router 2 weeks ago still with PlusNet.My desktop Mac OS 10.8 defalts to BTWiFi hotspot login page every time I try to acess the internet.I have to go to the internet and manually choose PlusNet.I lock the page but the same thing happens the next time .There are 4 computers in the house and this is the only one doing this.What do I do
    thank you
    Geraldine HW

    Hi,
    interesting story. Did you find a way to configure phone for Internet calls (VOIP)? Using Setup/Connection/Admin Setup/SIP Setup (I am not sure about names as I am using Polish version) I may configure SIP profile and even register it ... but that is all. No way to make Internet calls even manual is saying about way of making them
    regards, 

  • I can't change the type size in a link with contribute

    When I edit a web page with Contribute and create a link, it changes the text size in the link. Nothing I can do will let me change it.  I have looked at page properties, changed the font, etc., nothing works. Please help!

    The links may be controlled by the sites CSS file. Have you looked at that?
    It would look similar to this:
    a:link {
    color: #006666; border-bottom:1px dotted #006666;text-decoration: none

  • How to change file type when exporting a report with a background job

    Hi,
    I've set up a background job in SM36 to execute a SAP Query I've created, set to send the results as a file to an external email address. When it arrives the file is a .htm (and it seems to cut out after a few pages of data), but I'd like it to export as a .xls, .txt or .csv.
    I've checked the job, the query and my user settings, but I can't find where the change the file extension used - can anyone please tell me how to do it?
    Thanks,
    Tim

    Hi Shiva,
    Can you please confirm where in SQ01/2 the file path information / settings are?
    Thanks,
    Tim

  • Problem with thousands separator

    Hi,
    I'am working on dunning letters print and i've a problem with the thousands separator.
    Data is stored in a table field typed CURR. The intern format is 119600,60
    When i print directly this value on my SmartForm, there are many blanks before the number, corresponding to the size of the variable (15 caracters). I don't know hax to remove this blanks.
    I tried to change the type of the variable by moving the value into a CHAR variable. The result is better : the blanks have been cleared out but unfortunatelly, the thousands seperators too.
    Does someone know how to put the value of a variable typed CURR in a string or a char variable with thousands separators ?
    To sum up my query :
    The CURR variable contains 119600,60
    I want a String or a char variable containing 119 600,00
    Thanks a lot
    regards
    Edited by: Larrière Dorian on Jun 19, 2008 11:53 AM

    Hi...
    write : wf_cu LEFT-JUSTIFIED.
    This state ment removes the blanks at the beginning....
    The wf_cu may be of curr type
    Edited by: Rudra Prasanna Mohapatra on Jun 19, 2008 12:08 PM

  • Opening my Ipad I have an exchange window asking me my password. I'm (almost)sure I type the good one but it doesn't accepIt it. Unable to go around that window so IPad useless. How can I check/change my password with my IPad (stuck) or my home computer ?

    Opening my iPad2 I have an "Exchange " window asking me my password. I'm (almost) sure I type the good one, but it doesn't accept it. Unable to go around it, so iPad useless... How can I recover/check my password on my home PC (or make that window disappear ?

    That's one of the weird things.. it recognizes it maybe 10% of the time. And usually, only after I do the two-button reset. Problem is.. since it won't charge above 2%, anytime I try to do a restore or anything like that using iTunes, my device shuts off and I lose whatever progress I'd made.
    So, an update... after reading through a bunch of similar complaints (there are literally 1000's of them so there's NO WAY this isn't somehow ios7 related, thanks a lot APPLE ) I decided to try a restore in recovery mode. After 3 hours and several disconnections... I ended up having to just set it up as a new iPad, as the restore did nothing. Weirdly though... as I was doing the restore in recovery mode.. I noticed I'd gotten up to a 10% charge.. higher than it's been since September, so after setting it up as a new device, I turned it off and plugged it in using the wall charger. 2 hours later and I was up to 38%. Still not great, as my iPad, before ios7 could've fully charged twice in the amount of time it took for me to now get 28% more of a charge. And that's with a fully cleaned out device.. so that really ***** and I'm now more confused than ever.
    But I'm gonna leave it overnight charging and see what I come up with tomorrow. Sadly, when I paid $600 for it in February, I never expected to have to play "wait and see" with it...

  • Replacing String month with type Int - What to do!?!

    import java.util.Scanner;
    public class Date
        private String month;
        private int day;
        private int year; //a four digit number.
        public Date( )
            month = "January";
            day = 1;
            year = 1000;
        public Date(int monthInt, int day, int year)
            setDate(monthInt, day, year);
        public Date(String monthString, int day, int year)
            setDate(monthString, day, year);
        public Date(int year)
            setDate(1, 1, year);
        public Date(Date aDate)
            if (aDate == null)//Not a real date.
                 System.out.println("Fatal Error.");
                 System.exit(0);
            month = aDate.month;
            day = aDate.day;
            year = aDate.year;
        public void setDate(int monthInt, int day, int year)
            if (dateOK(monthInt, day, year))
                this.month = monthString(monthInt);
                this.day = day;
                this.year = year;
            else
                System.out.println("Fatal Error");
                System.exit(0);
        public void setDate(String monthString, int day, int year)
            if (dateOK(monthString, day, year))
                this.month = monthString;
                this.day = day;
                this.year = year;
            else
                System.out.println("Fatal Error");
                System.exit(0);
        public void setDate(int year)
            setDate(1, 1, year);
        public void setYear(int year)
            if ( (year < 1000) || (year > 9999) )
                System.out.println("Fatal Error");
                System.exit(0);
            else
                this.year = year;
        public void setMonth(int monthNumber)
            if ((monthNumber <= 0) || (monthNumber > 12))
                System.out.println("Fatal Error");
                System.exit(0);
            else
                month = monthString(monthNumber);
        public void setDay(int day)
            if ((day <= 0) || (day > 31))
                System.out.println("Fatal Error");
                System.exit(0);
            else
                this.day = day;
        public int getMonth( )
            if (month.equals("January"))
                return 1;
            else if (month.equals("February"))
                return 2;
            else if (month.equalsIgnoreCase("March"))
                return 3;
            else if (month.equalsIgnoreCase("April"))
                return 4;
            else if (month.equalsIgnoreCase("May"))
                return 5;
            else if (month.equals("June"))
                return 6;
            else if (month.equalsIgnoreCase("July"))
                return 7;
            else if (month.equalsIgnoreCase("August"))
                return 8;
            else if (month.equalsIgnoreCase("September"))
                return 9;
            else if (month.equalsIgnoreCase("October"))
                return 10;
            else if (month.equals("November"))
                return 11;
            else if (month.equals("December"))
                return 12;
            else
                System.out.println("Fatal Error");
                System.exit(0);
                return 0; //Needed to keep the compiler happy
        public int getDay( )
            return day;
        public int getYear( )
            return year;
        public String toString( )
            return (month + " " + day + ", " + year);
        public boolean equals(Date otherDate)
            return ( (month.equals(otherDate.month))
                      && (day == otherDate.day) && (year == otherDate.year) );
        public boolean precedes(Date otherDate)
            return ( (year < otherDate.year) ||
               (year == otherDate.year && getMonth( ) < otherDate.getMonth( )) ||
               (year == otherDate.year && month.equals(otherDate.month)
                                             && day < otherDate.day) );
        public void readInput( )
            boolean tryAgain = true;
            Scanner keyboard = new Scanner(System.in);
            while (tryAgain)
                System.out.println("Enter month, day, and year.");
                  System.out.println("Do not use a comma.");
                String monthInput = keyboard.next( );
                int dayInput = keyboard.nextInt( );
                int yearInput = keyboard.nextInt( );
                if (dateOK(monthInput, dayInput, yearInput) )
                    setDate(monthInput, dayInput, yearInput);
                    tryAgain = false;
                else
                    System.out.println("Illegal date. Reenter input.");
        private boolean dateOK(int monthInt, int dayInt, int yearInt)
            return ( (monthInt >= 1) && (monthInt <= 12) &&
                     (dayInt >= 1) && (dayInt <= 31) &&
                     (yearInt >= 1000) && (yearInt <= 9999) );
        private boolean dateOK(String monthString, int dayInt, int yearInt)
            return ( monthOK(monthString) &&
                     (dayInt >= 1) && (dayInt <= 31) &&
                     (yearInt >= 1000) && (yearInt <= 9999) );
        private boolean monthOK(String month)
            return (month.equals("January") || month.equals("February") ||
                    month.equals("March") || month.equals("April") ||
                    month.equals("May") || month.equals("June") ||
                    month.equals("July") || month.equals("August") ||
                    month.equals("September") || month.equals("October") ||
                    month.equals("November") || month.equals("December") );
        private String monthString(int monthNumber)
            switch (monthNumber)
            case 1:
                return "January";
            case 2:
                return "February";
            case 3:
                return "March";
            case 4:
                return "April";
            case 5:
                return "May";
            case 6:
                return "June";
            case 7:
                return "July";
            case 8:
                return "August";
            case 9:
                return "September";
            case 10:
                return "October";
            case 11:
                return "November";
            case 12:
                return "December";
            default:
                System.out.println("Fatal Error");
                System.exit(0);
                return "Error"; //to keep the compiler happy
    }My question is that if I were to change the String month in the instance variables to type int, what changes do I make to the code to make this work WITHOUT changing the method headings and it also says that none of the type String paraenters should change to type int. I need to redefine the methods to make it work. I've been at this for hours and am just stuck so this is the reason for my early morning post.

    import java.util.Scanner;
    public class Date
        private int month;
        private int day;
        private int year; //a four digit number.
        public Date( )
            month = 1;
            day = 1;
            year = 1000;
        public Date(int monthInt, int day, int year)
            setDate(monthInt, day, year);
        public Date(String monthString, int day, int year)
            setDate(monthString, day, year);
        public Date(int year)
            setDate(1, 1, year);
        public Date(Date aDate)
            if (aDate == null)//Not a real date.
                 System.out.println("Fatal Error.");
                 System.exit(0);
            month = aDate.month;
            day = aDate.day;
            year = aDate.year;
        public void setDate(int monthInt, int day, int year)
            if (dateOK(monthInt, day, year))
                this.month = monthInt;
                this.day = day;
                this.year = year;
            else
                System.out.println("Fatal Error");
                System.exit(0);
        public void setDate(String monthString, int day, int year)
            if (dateOK(monthString, day, year))
                this.month = monthStringToInt(monthString);
                this.day = day;
                this.year = year;
            else
                System.out.println("Fatal Error");
                System.exit(0);
        public void setDate(int year)
            setDate(1, 1, year);
        public void setYear(int year)
            if ( (year < 1000) || (year > 9999) )
                System.out.println("Fatal Error");
                System.exit(0);
            else
                this.year = year;
        public void setMonth(int monthNumber)
            if ((monthNumber <= 0) || (monthNumber > 12))
                System.out.println("Fatal Error");
                System.exit(0);
            else
                month = monthNumber;
        public void setDay(int day)
            if ((day <= 0) || (day > 31))
                System.out.println("Fatal Error");
                System.exit(0);
            else
                this.day = day;
        public int getMonth( )
             return month;
        public int getDay( )
            return day;
        public int getYear( )
            return year;
        public String toString( )
            return (month + " " + day + ", " + year);
        public boolean equals(Date otherDate)
            return ( (month == otherDate.month)
                      && (day == otherDate.day) && (year == otherDate.year) );
        public boolean precedes(Date otherDate)
            return ( (year < otherDate.year) ||
               (year == otherDate.year && getMonth( ) < otherDate.getMonth( )) ||
               (year == otherDate.year && month == otherDate.month
                                             && day < otherDate.day) );
        public void readInput( )
            boolean tryAgain = true;
            Scanner keyboard = new Scanner(System.in);
            while (tryAgain)
                System.out.println("Enter month, day, and year.");
                  System.out.println("Do not use a comma.");
                String monthInput = keyboard.next( );
                int dayInput = keyboard.nextInt( );
                int yearInput = keyboard.nextInt( );
                if (dateOK(monthInput, dayInput, yearInput) )
                    setDate(monthInput, dayInput, yearInput);
                    tryAgain = false;
                else
                    System.out.println("Illegal date. Reenter input.");
        private boolean dateOK(int monthInt, int dayInt, int yearInt)
            return ( (monthInt >= 1) && (monthInt <= 12) &&
                     (dayInt >= 1) && (dayInt <= 31) &&
                     (yearInt >= 1000) && (yearInt <= 9999) );
        private boolean dateOK(String monthString, int dayInt, int yearInt)
            return ( monthOK(monthString) &&
                     (dayInt >= 1) && (dayInt <= 31) &&
                     (yearInt >= 1000) && (yearInt <= 9999) );
        private boolean monthOK(String month)
            return (month.equals("January") || month.equals("February") ||
                    month.equals("March") || month.equals("April") ||
                    month.equals("May") || month.equals("June") ||
                    month.equals("July") || month.equals("August") ||
                    month.equals("September") || month.equals("October") ||
                    month.equals("November") || month.equals("December") );
        private String monthString(int monthNumber)
            switch (monthNumber)
            case 1:
                return "January";
            case 2:
                return "February";
            case 3:
                return "March";
            case 4:
                return "April";
            case 5:
                return "May";
            case 6:
                return "June";
            case 7:
                return "July";
            case 8:
                return "August";
            case 9:
                return "September";
            case 10:
                return "October";
            case 11:
                return "November";
            case 12:
                return "December";
            default:
                System.out.println("Fatal Error");
                System.exit(0);
                return "Error"; //to keep the compiler happy
        private int monthStringToInt(String monthString) {
             if (monthString.equals("January")) return 1;
             else if (monthString.equals("February")) return 2;
             else if (monthString.equals("March")) return 3;
             else if (monthString.equals("April")) return 4;
             else if (monthString.equals("May")) return 5;
             else if (monthString.equals("June")) return 6;
             else if (monthString.equals("July")) return 7;
             else if (monthString.equals("August")) return 8;
             else if (monthString.equals("September")) return 9;
             else if (monthString.equals("October")) return 10;
             else if (monthString.equals("November")) return 11;
             else if (monthString.equals("December")) return 12;
             else return -1;
    }I've added one method: monthStringToInt to convert "January", "February" into an integer value. There are probably better ways to do this (Calendar), but this involes no other classes.

  • I have a Text control string box with some initial text. I would like to highlight old text with click of mouse and type in new data from keyboard

    I have a text control string box with some initial text (says: Please enter Name). I would like the operator to click on the text control box and have it automatically highlight so that when new data is typed in the old erases (all at once) and the new data is now in the text box.
    I tried using the "Text.Selection" property node and when I run it and put the mouse inside the text box the initial text is highlighted and if I press "delete" on the keyboard or if I start to type in new data the initial data does delete but once I start to type new characters they erase each other. For example if I want to type in “Willi
    am” I type the “W” and then the “I” but the “I” erases the “W” and now I am only left with an “I” in the text box and so on. I appreciate any help

    It seems you are continuously setting the property node over and over again. This should only happen once if you mouse over it.
    Create a property node for your text control with the following three items:
    (1) KeyFocus (wire a "true" constant to it)
    (2) Text.SelStart (Wire a "zero" constant to it)
    (3) Text.SelEnd (Wire a constant containing the string length of the text).
    Put this property node inside an event structure, triggered by "Mouse enter" on the string control.
    (see if the attached example works for you)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Enter_Name.vi ‏23 KB

  • HT2513 How do you change the name of a reminder in the reminder list.  I right click and then choose "get information"  I can change the colour of the reminder but when I type in the name that I want and then press enter the name stays as "untitled".

    How do you change the name of a reminder in the reminder list.  I right click and then choose "get information"  I can change the colour of the reminder but when I type in the name that I want and then press enter the name stays as "untitled"

    Jerry,
    Thanks for replying again. I've got a little bit further thanks to you. I tried the US keyboard layout as you seemed pretty definte that it should work. This time I applied the setting and also started the language toolbar and selected it from there.
    Hey presto, I've got the @ where it should be. Excellent.
    However the single quote ' works in a weird way. When I press it, it doesn't show up on the screen. But when I press another key, I get the single quote plus the next key I press. When I press the single quote twice, I get 2 of them. This is also the same with the SHIFT ' key. i.e. for the double quotes.
    Very strange. I'll look at other keyboards and see where that gets me.
    Thanks,  Maz

  • Incompatible types - found java.lang.String but expected int

    This is an extremely small simple program but i keep getting an "incompatible types - found java.lang.String but expected int" error and dont understand why. Im still pretty new to Java so it might just be something stupid im over looking...
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class Lab
    public static void main(String []args)
    int input = JOptionPane.showInputDialog("Input Decimal ");
    String bin = Integer.toBinaryString(input);
    String hex = Integer.toHexString(input);
    System.out.println("Decimal= " + input + '\n' + "Binary= " + bin + '\n' + "Hexadecimal " + hex);
    }

    You should always post the full, exact error message.
    Your error message probably says that the error occurred on something like line #10, the JOptionPane line. The error is telling you that the compiler found a String value, but an int value was expected.
    If you go to the API docs for JOptionPane, it will tell you what value type is returned for showInputDialog(). The value type is String. But you are trying to assign that value to an int. You can't do that.
    You will need to assign the showInputDialog() value to a String variable. Then use Integer.parseInt(the_string) to convert to an int value.

  • Problem with Call Library Function. Want to pass a string and return a string, but my compiler does not recognize "CStr" and Labview does not recognize my "char *function()" callout

    Hi, I'm trying to use a .DLL I wrote in Visual C++ .NET. The Call Library Function generates a function prototype of "CStr Parser(CStr arg_raw)"
    but my compiler won't accept this. So I change it to how C normally deals with strings "char *Parser(char *arg_raw). Now the Call Librafy Function does not find "Parser" in my .DLL though it is definitely there!
    Help!
    -Fong

    Hello
    You will need to include extcode.h in your C file. You can find this under ..\LabVIEW\cintools folder.
    The include has all the defines you will need.
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • BW3.5 - changing variables in a PREquery with VBA... Possible?

    Hello All,
    Here's my problem (note that this relates to BW 3.5).
    I am refreshing one workbook (containing 47 queries) a number of times using a different set of variables each time (there are 10 variables altogether). My sets of variables are saved on an Excel spreadsheet and I use a loop in VBA which reads them and then overwrites variables on the SAPBEXQueries sheet. VBA then forces queries refresh, runs additional macros, and saves the workbook. I repeat this operation about 40 times. All queries have "Save and reuse variables" ticked on, so I don't get a variables box popping up. This basically is meant to work as a sort of a broadcaster and run at night.
    However, some of my queries need running a prequery (there's a replacement path), and that's when problems begin. A pop up box of a prequery appears requesting a variable to be entered. BW doesn't seem to "remember" that the same variable has been used in other queries already, and doesn't automatically populate it, and is waiting for user's input. The question is: how can I populate it automatically using VBA, so I don't get the pop up box? Obviously, variables for prequeries are not saved on the SAPBEXQueries, so the pop up box would need to be populated on the fly.
    Has anyone have any suggestions please?
    A.

    Simon, thank you for you suggestions.
    This must sound like an awefully complicated solution we are using to automate our reporting. However, it proves to be very efficient, in fact, and works on a number of workbooks (works better than BW broadcaster).
    As for your suggestions. Firstly, I have not authorisations to perform any actions requiring CMOD changes. This would need to be done by another department and take, in fact, months and lots of paperwork... I can't afford that
    Secondly, all my variables are used by other users, so I cannot change them. I haven't worked with variants before, but if this would require me to change all my variables, then I can't do it (at least not this time). However, could you pls describe this solution in more detail, and I will do some research as well.
    Thanks,
    A.

  • In iTunes under my device, under the apps tab, Why are all the options shaded out?  I cannot make any changes, select any apps or do anything with the apps.  I was able to load a few apps and sync but cannot sync anymore to my phone.

    In iTunes under my device, under the apps tab, Why are all the options shaded out?  I cannot make any changes, select any apps or do anything with the apps.  I was able to load a few apps and sync but cannot sync anymore to my phone.

    Hi,
    ( I search for iChat questions when I have finished in the iChat Forum)
    So the menu bar reads iChat, File,  Edit,  View, Buddies, Video, Window and Help
    There is no Buddy List open.
    There is no other window for iChat open.
    In the iChat Menu you only have access to Status.
    Is an item ticked in the list ?
    Is this a green (Available item) or  Red ( an Away one) ?
    Can you access the Accounts option ?  (Sitll in the iChat Menu)
    Is anything in here ticked ?
    In the Window menu any Logged in account should appear in the list  (Between the Next Chat and File Transfer items)
    It would be useful to know which version of iChat this is.
    If no account is ticked (iChat Menu > Accounts) or not showing in the Window Menu, plus you cannot determine the Status and you cannot access the Preferences then you need to access your Home Folder/Library/Preferences
    As the Library in the Home Holder is Invisible in Lion you will need the Finder's Go Menu > Go to Folder option  (you can use it in earlier OS versions if you want)
    Type in:-
    ~/Library/Preferences
    Find the file called com.apple.ichat.plist
    Drag it to the Trash and Restart iChat.
    This will lose all the settings in iChat that you have changed from Defaults but there is no way around this.
    9:23 PM      Saturday; August 27, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • 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

Maybe you are looking for