Using a range to input numbers to a table

Hi i have written this bit of code to allow numbers to be written to the table. I use "b" as the limit the numbers go to but when i want to use "a" as the start point it returns the error loss of precision. E.g. i enter a = 3 and b = 8 and in the table it returns 3, 4, 5, 6, 7, 8 in a single column. The error message reads "Loss of possible precision" and
found : double
required: int
for (int row = a; row <= b; row++)
1 error
BUILD FAILED (total time: 0 seconds)
double a = Double.parseDouble(txtRangeFrom.getText());
    double b = Double.parseDouble(txtRangeTo.getText());     
    int i = 1;
    for (int row = a; row <= b; row++)
        for (int col = 1; col <= 1; col++){
        tblOut.setValueAt(Double.toString(i),row,col);
        i++;
    }Thanks any help would be appreciated

Hi i have written this bit of code to allow numbers
to be written to the table. I use "b" as the limit
the numbers go to but when i want to use "a" as the
start point it returns the error loss of precision.
E.g. i enter a = 3 and b = 8 and in the table it
returns 3, 4, 5, 6, 7, 8 in a single column. The
error message reads "Loss of possible precision" and
found : double
required: int
for (int row = a; row <= b; row++)
ror
BUILD FAILED (total time: 0 seconds)
double a =
Double.parseDouble(txtRangeFrom.getText());
double b =
Double.parseDouble(txtRangeTo.getText());     
int i = 1;
for (int row = a; row <= b; row++)
for (int col = 1; col <= 1; col++){
tblOut.setValueAt(Double.toString(i),row,col);
i++;
ode]
Thanks any help would be appreciatedrow is an int and you're trying to compare it to b which is a Double.....

Similar Messages

  • Help Using a range of random numbers

    so what i understand from this im learning flash from lynda.com tutorials and no matter how many times i listen to each word the guy says, i dont understand this part
    in the vid, we are making a die to roll from 1-6 although the code below is not the finali hope someone can help me unserstand
    var randomNumber:Number = Math.round(Math.random() * (10 - 1) + 1);
    trace(randomNumber);
    so what i understand from this is:
    The variables name is randomNumber:randomNumber is going to be a Number = Using the Math class - we are going to round the Number(we make a random Number from 0 to 1 not including 1() * from here i need help understanding, please help me

    Hi,
    Math.random() will give you a number between 0 and 0.9999999 ( but not 1 );
    lets suggest that you want a random number from 1 to 10. Note that round give you a digit from "0", so you must substract 1  ( 10 - 1) ( 0-10 fave 11 digits )
    To get a random number of Some digit you will need to multiply Math.random() with this digit -1 - so if yo want to get a random digit from 10 you will need to get a random digit ( Math.random() ) and multiply it by 10-1. this will give you a randum number between 0 and 8.999(9).
    but this have a floating part. To remove the "." you must round the result so after rounding the result will be a randm digit from  0 to 9. but the first digit is '0" if you dont neededthe result must be increment + 1 after rounding  and will be from 1 to 10

  • How do i save a range of telephone numbers as under 1 contact name?

    Recently company A has been send me SMSs using different number from a specific range eg. 012 231 0582, 012 231 0589, 012 231 0592, etc
    So i want to save this range of numbers under 1 contact but not one number at a time, i just want to save it as a range e.g 012 231 0500-99 such that if i receive an SMS from any of the numbers it is just recongised as from company A and the sms is stored together with other previous SMSs from the same contact even tho from different numbers.
    Can this be done?

    yes you can, although im not sure if you can do it for as much as 99 numbers.
    just create 1 contact first (e.g. Company SMS, 1234567) under Contacts, click on the "+" on the top right hand of the screen.
    You will then see that you can input numbers under "Mobile". Once you do that, the next field appears, and if you key in a number there, the next field appears and so on.

  • Help with Numbers. I am trying to input numbers such as 001, 002 etc.

    I am trying to input numbers such as 001, 002 etc. but the 00's in front keep getting dropped. I understand putting them there does not make this true or real numbers but I need them in this table. How do I get this without the 00's being dropped?

    If have a preset length of the field where the whole column must have the same length and you want to just backfill the leading zeroes, you could use a formula
    If you enter this in cell C2 and paste it down in C column, it will add leading zeroes to your numbers listed in column B
    =LEFT("00000",5−LEN(B2−1))&B2
    If you want to expand this to a larger length, just add as many zeros as you want in the formula "0000000000" and change the 5 to however many zeroes you have between the "" in the formula.
    If you want to add a constant number of zeroes (2 in my case) in front of the number, you could modify the formula to something like this:
    =LEFT("00000",2))&B2
    If you make it a formula, this would automatically turn the field format to show the leading zeroes, BUT..... you could still perform calculations on that field, which is a bonus!!!

  • Is it advisable to use the charcter "&" in customer numbers and in business

    Is it advisable to use the charcter "&" in customer numbers and in business partner naming?
    Are there any restrictions in using wild characters for customer numbers. KNA1-KUNNR field.

    Dear Chandramouli,
    In the name you can use but in the no. not advisable I believe. When you are defining the no range, it is as following:
    Intervals can only contain either letters or numbers, as sorting can differ between platforms (Code page):
    Allowed:  000001 to 999999
      AAAAAA to ZZZZZZ
    Not allowed:  AAAAAA to 999999
    Please find the SAP help on this.
    Thanks,
    Atin

  • OpenCv ,Hls ,Video Processing :How to use hls::Range() to set ROI(Region of Interest)?Help!!!

    Hi,
        I have one problem,I want to use hls::Range() to set ROI(Region of Interest),and  I could not how to use  it corretly.Anyone can help me ? And give me one example. 
    1.  Functions are defined as follows:
    hls::Range
    Synopsis
    template<int ROWS, int COLS, int SRC_T, int DST_T, typename P_T>
    void hls::Range (
    hls::Mat<ROWS, COLS, SRC_T>& src,
    hls::Mat<ROWS, COLS, DST_T>& dst,
    P_T start,
    P_T end);
    Parameter                                                  Description
    src                                                              Input single-channel image
    dst                                                              Output single-channel image
    start                                                            Left boundary value of the range
    end                                                             Right boundary value of the range
    Description
    • Sets all value in image src by the following rule and return the result as image dst.
    • Image data must be stored in src.
    • The image data of dst must be empty before invoking.
    • Invoking this function consumes the data in src and fills the image data of dst.
    • src and dst must have the same size and be single-channel images.
    OpenCV Reference
    • cvRange
    2.I use it  as follow,but it can not work corretly.
    #define MAX_WIDTH 640
    #define MAX_HEIGHT 480
    typedef hls::stream<ap_axiu<32,1,1,1> > AXI_STREAM;
    typedef hls::Scalar<3, unsigned char> RGB_PIXEL;
    typedef hls::Mat<MAX_HEIGHT, MAX_WIDTH, HLS_8UC3> RGB_IMAGE;
    #if 1
    void image_filter(AXI_STREAM& INPUT_STREAM, AXI_STREAM& OUTPUT_STREAM, int rows, int cols) {
    //Create AXI streaming interfaces for the core
    #pragma HLS INTERFACE axis port=INPUT_STREAM
    #pragma HLS INTERFACE axis port=OUTPUT_STREAM
    #pragma HLS RESOURCE core=AXI_SLAVE variable=rows metadata="-bus_bundle CONTROL_BUS"
    #pragma HLS RESOURCE core=AXI_SLAVE variable=cols metadata="-bus_bundle CONTROL_BUS"
    #pragma HLS RESOURCE core=AXI_SLAVE variable=return metadata="-bus_bundle CONTROL_BUS"
    #pragma HLS INTERFACE ap_stable port=rows
    #pragma HLS INTERFACE ap_stable port=cols
    RGB_IMAGE img_0(rows, cols);   
    hls::Mat<MAX_HEIGHT,MAX_WIDTH,HLS_8UC1> gray(rows,cols);
    hls::Mat<MAX_HEIGHT,MAX_WIDTH,HLS_8UC1> range_1(rows,cols);
    #pragma HLS dataflow
     hls::AXIvideo2Mat(INPUT_STREAM, img_0);
     hls::CvtColor<HLS_RGB2GRAY>(img_0,gray);;
    hls::Range(gray,range_1,50,600);       //     I use hls::Range() like it , is it  right?Help!!!
    hls::CvtColor<HLS_GRAY2RGB>(range_1,img_1);
    hls::Mat2AXIvideo(img_1, OUTPUT_STREAM);
    #endif

    Anyone could help me?

  • "use default range" gray for gauge/knob

    Hi there - the "use default range" checkbox is gray in the gauge/knob properties in my VI. How do I change this? I am trying to implement a compass sort of thing that displays a heading that is coming in as a value from 0-360. (0 = N, 90 = E, 180 = S, 270=W). I want to change how many ticks there are, and where numbers are displayed. My understanding was that I would need to change the data range, but I can't seem to figure out how to.
    What am I doing wrong?
    Thanks!

    Is it possible to choose how large tick marks are? I don't think there is a good way to specify variable tick lenght. Maybe I am wrong.
    how do I add text labels to specific points (ie N, NW, etc.). While you can use text labels for scales, the scale becomes noncontinuous and you cannot point to intermediary values. This might not be useful. I would simply not display the marker values, but add free labels as needed.
    how do I get rid of the numbers being displayed? Choose a scale style without numbers.
    I don't actually want numbers to be displayed - I only want to have text direction labels and ticks. Attached is a quick modification, implementing some of the above.
    For even more control (pun!), you could use the control editor.
    Message Edited by altenbach on 05-13-2007 09:20 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Scale360a.vi ‏14 KB
    compass.png ‏21 KB

  • I used the disc and track numbers, but it won't show on my iPod as separate CDs?

    Hi,
    I used the disc and track numbers of get info in iTunes, and I would like to have my CDs separate like if they are 3 CDs on my iPod Classic rather then having a big long list of songs, but after using the disc and track numbers, I still don't see on my iPod which one is CD1, and etc. I took a screenshot of my iTunes. How could I have my CDs separate just like the originals?
    http://imageshack.us/photo/my-images/341/89226837.jpg/
    That's the screenshot.

    See Corrupt iPod classic for tips if the iPod isn't working as expected and contains media that isn't in your active library.
    See Grouping tracks into albums for organizational tips.
    tt2

  • PO creation using LSMW through batch input method

    Hi, I am new to working with LSMW and i have completed a project for creating purchase orders using the direct data input method. I need to do the same using batch input method, however in the maintain structure relationship step, it is only allowing me to assign one structure to the recording that i have done, however in po creation we need separate (nested) structure for header and line item, could anybody help me past this please?

    Hi Rudra!
    OK, now you just know, why you have only one line, not multiple PO item lines. To get a dynamic number of items, you need a complex program - just like standard direct input.
    If you need a field, which is not part of this program, don't try to write your own program for batch input - it's just to much work before you have a good result.
    You can use Bapi method instead with BAPI_PO_CREATE1. This can handle a lot of fields and there is some documentation available how to fill the Bapi.
    If this looks to complicated in the first moment, think about creation of POs via direct input and a small batch recording to change your additional field(s) afterwards. (You can select EKPO table to generate list of 'wrong' migrated orders for input in LSMW.) Use field 'Item' in the bottom of ME22 to position your desired line in first screen line, just change one PO-line after one other (every time a 'save' -> no problem with different number of lines / PO).
    Regards,
    Christian

  • Can we use cl_gui_alv_grid to give input on the screen?

    Hi experts ,
        Can we use <b>cl_gui_alv_grid</b> to give input on the screen  and save the input in some internal table which is passed as a parameter with the calling method of
    cl_gui_alv_grid??
    Thanks in advance
    regards,
    Ashwin

    OR you want to can set any particular field by
          ls_fcat-edit = 'X'.
    in the field catalog for that field .
    Assign the points if it helps you ...
    Gaurang

  • Dynamic URL Configuration using variable range - WAD

    Hi,
    I am trying to configure a URL dynamically using variable range values. There are two variables which I pass to the URL, Sales Document Number and Posting Date. Sales Document Number has a single value and Posting Date is a range variable. The single value for sales document is passed to the URL but the date range is not passed and hence the web template gets the blank value for the date and shows the variable screen as this is mandatory. The URL is as follows.
    CONCATENATE
    l_web_protocol
    l_portal_server
    Initial URL
    '/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?TEMPLATE='
    l_web_template
    '&BI_COMMAND_1-BI_COMMAND_TYPE=SET_VARIABLES_STATE'
    '&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING'
    '&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING='
    l_var_value  "variable value
    '&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE='
    l_var_name   "Variable for info object
    '&BI_COMMAND_2-BI_COMMAND_TYPE=SET_SELECTION_STATE_SIMPLE'
    '&BI_COMMAND_2-RANGE_SELECTION_OPERATOR=INTERVAL_SELECTION'
    '&BI_COMMAND_2-RANGE_SELECTION_OPERATOR-INTERVAL_SELECTION-INTERVAL_SELECTION_LOW_MEMBER-ATTRIBUTE_MEMBER_SELECTION-
    INFO_OBJECT=0PSTNG_DATE'
    '&BI_COMMAND_2-RANGE_SELECTION_OPERATOR-INTERVAL_SELECTION-INTERVAL_SELECTION_LOW_MEMBER=MEMBERS_EXIT'
    '&BI_COMMAND_2-RANGE_SELECTION_OPERATOR-INTERVAL_SELECTION-INTERVAL_SELECTION_LOW_MEMBER-MEMBERS_EXIT='
    l_range_var_name  "Customer Exit Variable
    '&BI_COMMAND_2-RANGE_SELECTION_OPERATOR-INTERVAL_SELECTION-INTERVAL_SELECTION_LOW_MEMBER-MEMBER_NAME='
    l_range-low     "Variable Value - Low
    '&BI_COMMAND_2-RANGE_SELECTION_OPERATOR-INTERVAL_SELECTION-INTERVAL_SELECTION_HIGH_MEMBER-ATTRIBUTE_MEMBER_SELECTION- INFO_OBJECT=0PSTNG_DATE'
    '&BI_COMMAND_2-RANGE_SELECTION_OPERATOR-INTERVAL_SELECTION-INTERVAL_SELECTION_HIGH_MEMBER=MEMBERS_EXIT'
    '&BI_COMMAND_2-RANGE_SELECTION_OPERATOR-INTERVAL_SELECTION-INTERVAL_SELECTION_HIGH_MEMBER-MEMBERS_EXIT='
    l_range_var_name     "Customer Exit Variable
    '&BI_COMMAND_2-RANGE_SELECTION_OPERATOR-INTERVAL_SELECTION-INTERVAL_SELECTION_HIGH_MEMBER-MEMBER_NAME='
    l_range-high      "Variable Value - High
    '&BI_COMMAND_2-RANGE_SELECTION_SIGN=INCLUDING'
    '&BI_COMMAND_2-TARGET_DATA_PROVIDER_REF_LIST=DP_TAB'      "Tab in the Web Template
    into  l_url.
    Can someone tell me asto what's going wrong with this URL? I passed single value for Posting Date and it worked fine.
    Thanks and Regards,
    Arya

    Thanks for the reply. However I did not understand couple of things. Should I try the URL like below?
    BI_COMMAND=&
    BI_COMMAND-TARGET_DIALOG_REF=l_var_name&
    BI_COMMAND-BI_ADVANCED=DLG_VARIABLE_vsc_DropdownVariants& "Which value to be passed?
    BI_COMMAND-BI_COMMAND_TYPE=PASSIVE_VALUE_TRANSFER&  "Which value to be passed?
    BI_COMMAND-PASSIVE_ID=DLG_VARIABLE_vsc_DropdownVariants_combobox& "Which value to be passed?
    BI_COMMAND-PASSIVE_VALUE=l_var_value&
    BI_COMMAND_1=&
    BI_COMMAND_1-TARGET_DIALOG_REF=l_range_var_name&
    BI_COMMAND_1-BI_ADVANCED=DLG_VARIABLE_vsc_CommonVariablesList_VAR_1_VARINPUT& "Which value to be passed?
    BI_COMMAND_1-BI_COMMAND_TYPE=PASSIVE_VALUE_TRANSFER&
    BI_COMMAND_1-PASSIVE_ID=DLG_VARIABLE_vsc_CommonVariablesList_VAR_1_VARINPUT_inp& "Which value to be passed?
    BI_COMMAND_1-PASSIVE_VALUE=l_range_low-l_range_high&
    BI_COMMAND_2=&
    BI_COMMAND_2-TARGET_DIALOG_REF=l_range_var_name&
    BI_COMMAND_2-BI_COMMAND_TYPE=OK
    Thanks and Regars,
    Arya

  • I have just upgraded to the new OS X V. 10.10.3 but cannot access my iCloud Drive documents using the resident Pages and Numbers software on my MacBook Pro. Help needed.

    I have just upgraded to the new OS X V. 10.10.3 but cannot access my iCloud Drive documents using the resident Pages and Numbers software on my MacBook Pro. Help is needed to access those documents using the resident software on my MacBook Pro rather than the Beta software on iCloud.com.

    I have iCloud Drive set on the Finder sidebar and use that to open the Numbers Spreadsheet on iCloud.
    OSX 10.10.3
    Best.

  • Using more than one input device at the same time

    Is it possible to use more than one input device at the saem time in logic express. For example I have a fire wire input device and a usb input device can I get Express to recognize both of these at once and so have a total of 4 ins which would be great since Im transfering tracks off my ADAT and it would be less track to have to line up.
    Thanks

    Hi,
    yes, it should be possible by creating an aggregate device. Google for it or search this forum. There are many tutorials how to set it up.
    Have fun!
    Fox

  • How to use RFBIBL00 as direct input in LSMW

    Can any one Please help how to use RFBIBL00 as direct input in LSMW ? How should be structure Same level or subordinate level as I will be having single text file ?
    I have around 15 fields with me
    BKPF
    STYPE     C     1
    BLDAT     C     10
    BLART     C     2
    BUKRS     C     4
    BUDAT     C     10
    XBLNR     C     10
    WAERS     C     3
    XPRFG     C     1
    XMWST     C     1
    BSEG
    STYPE     C     1
    NEWBS     C     2
    DMBTR     C     10
    KOSTL     C     10
    SGTXT     C     10
    PRCTR     C     10
    NEWKO     C     10
    MWSKZ     C     2
    Thanks and Regards
    Guru

    Hi,
    look testabap RFBIBLT0, which creates testfile
    A.

  • System.read.in(); -problems when inputting numbers

    Very wet behind the ears when it comes to java and having problems in inputting numbers. My course requires me to write a program that converts degrees c to degrees f. An addition is to have the user input the value of degrees c. When I input a value, say 0, then instead of c being that value it is 49 instead (maybe ASCII?). I sense that the problem is the System.in.read(); bit. I've preceded it with (int) and also tried (char) but to no avail. The other problem is how to get the program to accept a double figure or treble figure input (i.e 20 degrees c). My program is below. Any advice would be greatly appreciated.
    //This program is designed to convert degrees Celsius into degrees Fahrenheit
    class Ctof
         public static void main(String[]args)
         throws java.io.IOException
              //identify variables
              int c;
              double f; //double is needed as calculation involves fractions
              System.out.println("Please input a value of degrees Celsius then press [Enter]");
              c=(int)System.in.read();
              f=(c/(5.0/9.0))+32;
              System.out.println(c + " degrees Celsius"); //prints value of c
              System.out.println("This is " + f + " degrees Fahrenheit"); //prints value of f
    }

    I think this should work...
    import java.io.*;
    class Ctof
    static BufferedReader b;
    public static void main(String[]args)
    throws java.io.IOException
    //identify variables
    int c;
    double f; //double is needed as calculation involves fractions
    b = new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Please input a value of degrees Celsius then press [Enter]");
    c = Integer.parseInt(b.readLine());
    f=(c/(5.0/9.0))+32;
    System.out.println(c + " degrees Celsius"); //prints value of c
    System.out.println("This is " + f + " degrees Fahrenheit"); //prints value of f
    } I've added a BufferedReader to read data from the input stream (System.in). This then gets converted to an int. System.in.read() is only really for reading bytes.
    Andrew

Maybe you are looking for