How to test if input is in array + number?

Hi, I have an array, [0, 1, 2], and also a stored number: 5
If I ask the user to input a number, how do I make the user continue input until the number is either one of the numbers in the array or the stored number?
I can do this with a while loop, a for loop, and an if, else loop, but it's too complicated:
               boolean match = false;
               DONE: while (match != true) {
                    for (int i =0; i < number; i++) {
                         if (userInput == array[i] || userInput == -1) {
                              match = true;
                              break DONE;
                         } else {
                              match = false;
                    System.err.printf("\nERROR: Input not in array or stored number.\n\n");
                    System.out.printf("Input again:\n    ");
                    userInput = input.nextInt();
               }Is there an easier method? Could someone point me in the right direction? I'm wondering if it might be faster if I create a new array that includes the original array + the stored number, then test to see if the input is simply in this new array.
Thanks for any help.
Edited by: fishy on Feb 23, 2009 11:16 AM

Hello,
To check the number against the array, you would have to loop through the entire array checking each element for the input value. A for loop should do the trick:
private static int checkArray(int [] a, int inputNumber)
for (i = 0; i < a.length; i++) { 
if (a[i] == inputNumber)
      return 1;
return 0;
}Then you can use a do while for the input:
do {
   System.out.println("Enter a number: ");
   userInput = sc.nextInt;
} while ( (checkArray(userInput) == 0) & (number != userInput) ); This should ask the user for input as long as the number they enter is not in the array and it's not the stored number.
Hope this helps,
~Vin

Similar Messages

  • How to test if a character is a number

    Hi all.
    Anyone got an idea on what is the most efficient way to test if a character is a numeric character (0...9) in pl/sql.
    Thanks

    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select '0' as chr from dual union all
      2             select '3' from dual union all
      3             select 'A' from dual union all
      4             select 'x' from dual union all
      5             select '8' from dual union all
      6             select 'w' from dual)
      7  -- END OF TEST DATA
      8  select chr
      9        ,CASE WHEN regexp_like(chr,'^[0-9]$') THEN 'Number'
    10         ELSE 'Not Number'
    11         END as test
    12* from t
    SQL> /
    C TEST
    0 Number
    3 Number
    A Not Number
    x Not Number
    8 Number
    w Not Number
    6 rows selected.
    SQL>

  • Using the value "Image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of preconfigured file types (.jpe, .jpg, .jpeg, .?

    On a form, using the value "image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of pre-configured file types (.jpe, .jpg, .jpeg, .gif, .png, .bmp, .ico, .svg, .svgz, .tif, .tiff, .ai, .drw, .pct, .psp, .xcf, .psd, .raw)?
    Say I wanted to add .gif, .jfif or .ico. I find this array limited, how can I add types to image?
    <input type="file" name="file" accept="image/*" id="file" />
    mimeTypes.rdf does not seem to allow this.

    ''mimeTypes.rdf'' has nothing to do with web development. It's a file that stores your file handling preferences (e.g. if you want ZIP files automatically saved or opened).
    You can't change the file types of the pre-defined content specifiers (audio/*, video/*, image/*), but you can specify additional MIME types. To add PDF to your above example,
    <pre><nowiki><input type="file" name="file" accept="image/*,application/pdf" id="file" /></nowiki></pre>
    For details, see
    * [https://developer.mozilla.org/En/HTML/Element/Input developer.mozilla.org/En/HTML/Element/Input]

  • How to test a class with array which is being declared?

    Dear All
    I am doing a question which involved the day of the week.
    I had written a class which is name WeekDay and here is the code :
    public class WeekDay
    private int index;
    private static String[]dayStrings = {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
    public WeekDay(int idx)
    index = idx;
    public int getIndex()
    return index;
    public static String nextDay(int index)
    index+=1;
    return dayStrings[index];
    The above compile well with no issue.
    Here is the problem which i need to seek your help, I had created a program to test the above program.
    But I am not sure how to test it.
    Here is what I had written :
    public class TestWD
    public static void main(String[]args)
    System.out.println("Please key in a digit to get the day of the week\n");
    System.out.println("Sun, Mon, Tue.....Sat is represented by 0,1,2,3...6");
    int idx = Integer.parseInt(args[0]);
    WeekDay wd = new WeekDay(dayStrings[]); // I can't seem to declare this line.
    My question how can I test the above program ?? I can't seem to be able to declare a "wd" from WeekDay. The dayStrings wich i had declared in the WeekDay class is a String array. But how can I declare a suitable line in my test program in order for me to test my program?
    What I wanted to do is to get the above line running and than I will proceed on to code it to display the day after a day...for example, if today is Wednesday and when I run the wd.nextDay(index). It will return me Thursday!
    But I am not sure how to declare the above...please enlighten me.
    Thank you.

    Hi
    Thank you for helping but when I compile my program. It seem fine but when I execute it, it prompt me with an error message :
    code}public class TestWD
    public static void main(String[]args)
    System.out.println("Please key in a digit to get the day of the week\n");
    System.out.println("Sun, Mon, Tue.....Sat is represented by 0,1,2,3...6");
    * int idx = Integer.parseInt(args[0]);*
    WeekDay wd = new WeekDay(idx);
    System.out.println(wd.nextDay(idx));
    }{java.lang.ArrayIndexOutOfBoundsException: 0
         at TestWD.main(TestWD.java:8)
    Edited by: SummerCool on Nov 1, 2007 2:53 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to get user input to keep in array in the form of int[]?

    I really want to know how to get user input to keep in an array. Or if it's impossible, can i use the value in "int" and transfer it to an array?

    What I understand is that you want to set an input from the user in an array of int.
    Here is how it work:
    1. Create a stream and a buffer to get and store the informations entered by the user:
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    2. Set this input in a String:
    String input = stdin.readLine();
    3. Set this string in an int:
    int userInput = Integer.parseInt(input);
    4. Then you can put this int in the array.
    Warning this code throws IOExceptions and NumberFormatException ( when you try to set letters as int ). But you can catch them easily.

  • How to set the value of an array element (not the complete array) by using a reference?

    My situation is that I have an array of clusters on the front panel. Each element is used for a particular test setup, so if the array size is three, it means we have three identical test setups that can be used. The cluster contains two string controls and a button: 'device ID' string, 'start' button and 'status' string.
    In order to keep the diagrams simple, I would like to use a reference to the array as input into a subvi. This subvi will then modify a particular element in the array (i.e. set the 'status' string).
    The first problem I encounter is that I can not select an array element to write to by using the reference. I have tried setting the 'Selection s
    tart[]' and 'Selection size[]' properties and then querying the 'Array element' to get the proper element.
    If I do this, the VI always seems to write to the element which the user has selected (i.e. the element that contains the cursor) instead of the one I am trying to select. I also have not found any other possible use for the 'Selection' properties, so I wonder if I am doing something wrong.
    Of course I can use the 'value' property to get all elements, and then use the replace array element with an index value, but this defeats the purpose of leaving all other elements untouched.
    I had hoped to use this method specifically to avoid overwriting other array elements (such as happens with the replace array element) because the user might be modifying the second array element while I want to modify the first.
    My current solution is to split the array into two arrays: one control and one indicator (I guess that's really how it should be done ;-) but I'd still like to know ho
    w to change a single element in an array without affecting the others by using a reference in case I can use it elsewhere.

    > My situation is that I have an array of clusters on the front panel.
    > Each element is used for a particular test setup, so if the array size
    > is three, it means we have three identical test setups that can be
    > used. The cluster contains two string controls and a button: 'device
    > ID' string, 'start' button and 'status' string.
    >
    > In order to keep the diagrams simple, I would like to use a reference
    > to the array as input into a subvi. This subvi will then modify a
    > particular element in the array (i.e. set the 'status' string).
    >
    It isn't possible to get a reference to a particular element within an
    array. There is only one reference to the one control that represents
    all elements in the array.
    While it may seem better to use references to update
    an element within
    an array, it shouldn't really be necessary, and it can also lead to
    race conditions. If you write to an element that has the
    possibility of the user changing, whether you write with a local, a
    reference, or any other means, there is a race condition between the
    diagram and the user. LV will help with this to a certain extent,
    especially for controls that take awhile to edit like ones that use
    the keyboard. In these cases, if the user has already started entering
    text, it will not be overwritten by the new value unless the key focus
    is taken away from the control first. It is similar when moving a slider
    or other value changes using the mouse. LV will write to the other values,
    but will not rip the slider out of the user's hand.
    To completely avoid race conditions, you can split the array into user
    fields and indicators that are located underneath them. Or, if some
    controls act as both, you can do like Excel. You don't directly type
    into the cell. You choose w
    hich cell to edit, but you modify another
    location. When the edit is completed, it is incorporated into the
    display so that it is never lost.
    Greg McKaskle

  • How to test a simple PL SQL function from another PL SQL script

    Hi,
    I have created a function. Now i need to test that whether it is returning the correct values or not.
    For that, i have written anothe pl sql script and trying to call this function. Im passing all the IN parameters in that function. I assume here that OUT parameters will provide me the result. Im trying to display the OUT parameter one by one to see my result.
    I'm using toad as sql client here connected with oracle.
    pl sql script:-
    DECLARE
    BEGIN
         DBMS_OUTPUT.PUT_LINE('$$$$$$$ VINOD KUMAR NAIR $$$$$$$');
         FETCH_ORDER_PRODUCT_DATA(320171302, 1006, 6999,
    ODNumber OUT VARCHAR2, Line_Number OUT VARCHAR2,
    ServiceID OUT VARCHAR2, BilltoNumber OUT VARCHAR2,
    AnnualPrice OUT NUMBER, CoverageCode OUT VARCHAR2)
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | ODNumber );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | Line_Number );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | ServiceID );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | BilltoNumber );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | AnnualPrice );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | CoverageCode );
    END;
    Function:-
    Program Name : SPOT_Order_Product_Data_For_CFS.sql
    Description : Function to Validate parameters from CFS
    By : Vinod Kumar
    Date : 08/19/2011
    Modification History
    By When TAR Description
    CREATE OR REPLACE FUNCTION FETCH_ORDER_PRODUCT_DATA(orderNumber IN VARCHAR2, customerNumber IN VARCHAR2,
    productLine IN VARCHAR2, ODNumber OUT VARCHAR2,
    Line_Number OUT VARCHAR2, ServiceID OUT VARCHAR2,
    BilltoNumber OUT VARCHAR2, AnnualPrice OUT NUMBER,
    CoverageCode OUT VARCHAR2)
    RETURN VARCHAR2 IS
    lv_err_msg VARCHAR2(100) := '';
    lv_bucket_id VARCHAR2(14);
    lv_bill_number VARCHAR2(30);
    lv_anual_price NUMBER;
    lv_coverage_code VARCHAR2(8);
    lv_quote_num NUMBER(10) := NULL;
    lv_line_num NUMBER(5) := 0;
    lv_customer_number VARCHAR2(30) := customerNumber;
    lv_product_id VARCHAR2(14) := productLine;
    lv_count_quote NUMBER := 0;
    lv_quote_status VARCHAR2(5);
    lv_quote_version NUMBER(2):=0;
    BEGIN
    IF INSTR(orderNumber, '-') = 0 THEN
    lv_quote_num := orderNumber;
    ELSE
    lv_quote_num := SPT_Delimiter(orderNumber, 1, '-');
    lv_line_num := SPT_Delimiter(orderNumber, 2, '-');
    END IF;
    --Check status of the quote COM, APP
    SELECT COUNT(*) INTO lv_count_quote FROM sot_order_header WHERE ORDER_NUMBER=lv_quote_num
    AND ORDER_STATUS IN ('APP', 'COM') AND CUSTOMER_NUMBER = lv_customer_number;
    IF lv_count_quote = 0 THEN
    lv_err_msg := 'Invalid Order number';
    RETURN lv_err_msg;
    END IF;
    -- Fetch the latest version on SPOT quote
    SELECT MAX(VERSION_NUMBER) INTO lv_quote_version FROM SPT_QUOTE_HEADER WHERE QUOTE_NUMBER = lv_quote_num
    AND CUSTOMER_NUMBER = lv_customer_number;
    -- If quote is valid fetch the data in OUT parameters
    IF lv_line_num = 0 THEN
    BEGIN
    SELECT a.CUSTOMER_BILLTO_NUMBER,
    b.LINE_NUMBER, b.BUCKET_ID,
    b.ANNUAL_REF_RATE_USD, b.COVERAGE_CODE
    INTO lv_bill_number,lv_line_num,lv_bucket_id,lv_anual_price,lv_coverage_code
    FROM SPT_QUOTE_HEADER a, SPT_QUOTE_LINE b
    WHERE a.QUOTE_NUMBER = lv_quote_num
    AND a.CUSTOMER_NUMBER = lv_customer_number
    AND a.VERSION_NUMBER = lv_quote_version
    AND a.QUOTE_NUMBER = b.QUOTE_NUMBER
    AND a.VERSION_NUMBER = b.VERSION_NUMBER
    AND b.PRODUCT_ID = lv_product_id;
    ODNumber := lv_quote_num;
    BilltoNumber := lv_bill_number;
    Line_Number := lv_line_num;
    ServiceID := lv_bucket_id;
    AnnualPrice := lv_anual_price;
    CoverageCode := lv_coverage_code;
    RETURN '';
    EXCEPTION WHEN OTHERS THEN
    lv_err_msg := 'Multiple PIDs existing in the SPOT order, please provide the SPOT order + line number as input data';
    RETURN lv_err_msg;
    END;
    ELSE
    BEGIN
    SELECT a.CUSTOMER_BILLTO_NUMBER,
    b.BUCKET_ID, b.ANNUAL_REF_RATE_USD,
    b.COVERAGE_CODE
    INTO lv_bill_number,lv_bucket_id,lv_anual_price,lv_coverage_code
    FROM SPT_QUOTE_HEADER a, SPT_QUOTE_LINE b
    WHERE a.QUOTE_NUMBER = lv_quote_num
    AND a.CUSTOMER_NUMBER = lv_customer_number
    AND a.VERSION_NUMBER = lv_quote_version
    AND a.QUOTE_NUMBER = b.QUOTE_NUMBER
    AND a.VERSION_NUMBER = b.VERSION_NUMBER
    AND b.PRODUCT_ID = lv_product_id
    AND b.LINE_NUMBER = lv_line_num;
    ODNumber := lv_quote_num;
    BilltoNumber := lv_bill_number;
    Line_Number := lv_line_num;
    ServiceID := lv_bucket_id;
    AnnualPrice := lv_anual_price;
    CoverageCode := lv_coverage_code;
    RETURN '';
    EXCEPTION WHEN OTHERS THEN
              lv_err_msg := 'Multiple SPOT lines exist with same parameter';
              RETURN lv_err_msg;
    END;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    lv_err_msg := '@@@ EXCEPTION THROWN @@@ '|| SUBSTR(SQLERRM,1,120);
    RETURN lv_err_msg ;
    END;
    Don't look at the function, it might have errors but my primary concern is how to test this function. Once I start doing its testing then only i can understand any bugs(if any).
    My pl sql is not so good. Im still learning. I don't understand IN and OUT parameters are.
    I just know that IN parameters r those whick we pass in to the function wen we call it and OUT parameters are those through which we get the result.
    Thanks in advance
    Vinod Kumar Nair

    20100511 wrote:
    I wondered how I could test the output of the function from within TOAD?I usually create the following function in my developer schema:
    create or replace function BoolToChar( b boolean ) return varchar2 is
    begin
      if b then
        return( 'TRUE' );
      else
        return( 'FALSE' );
      end if;
    end;To test a function like yours, the following will do in SQL*Plus/TOAD/etc:
    begin
      DBMS_OUTPUT.put_line(
        BoolToChar( XCCC_PO_APPROVALLIST_S1.does_cpa_exist(1017934)  )
    end;
    I'm probably doing 101 things wrong here, but thought I'd ask anyway and risk being shouted at.Shout at? You reckon? I thought people risked being beaten with a lead pipe, or pelted with beer cans and stale pretzels - which makes being shouted at a really safe and viable alternative. {noformat};-){noformat}

  • How to test domain controller on upgraded Win Server 2008 R2

    The windows team recently upgraded the development environment for the domain controller from 2003 to Windows 2008 R2 and I am to test the Idm functionality on this upgraded version. Our current configuration is that the DC and Idm gateway runs on different machines. To test this new DC, i want to install the idm gateway on that server and run some onboarding and termination test cases just to make sure if the AD connection is working on the upgraded DC. But i am getting ’Input/output error’ when i try to install the service and from the documentation it says 'The most common cause of this is that you do not have rights to work with this service.'. The server admin tried installing the gateway with his id as well and it failed. He tested installing in on the 2003 version of DC and it worked, so its not a matter of permission (i think..)...
    Does anyone have any better idea on how to test an upgrade of a DC from version 2003 to 2008 R2? Any help in this matter is appreciated. We are running Idm 8.1 on a Windows platform and an upgrade to OW 8.1.1. Patch 2 is also in the works..
    Thanks in advance.

    I may have found a workaround. Can you try to change the "compatibility mode" in 2008 R2 to "Windows XP SP3" and see if it will install?
    Admittedly I have not done this myself so I'm not entirely sure where or how it's done, but I have confirmation it resolves the issue from others who have faced it.

  • How to extract every component in an array?

    Hello everyone!
    Do you know how to extract every component from an array field?
    For example:
    The following is the defination of a table:
    CREATE TABLE test (
    id NUMBER PRIMARY KEY,
    name VARCHAR2(32),
    shape MDSYS.SDO_GEOMETRY
    And then I insert a new record:
    INSERT INTO test VALUES(
    1,'first',
    MDSYS.SDO_GEOMETRY(
    2003,
    NULL,
    NULL,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),
    MDSYS.SDO_ORDINATE_ARRAY(1,1, 5,7)
    The Question is I want to read the every component (for example 1,1,5,7) in the sdo_ordinate_array one by one. Who knows how to write the SQL?
    I have tried "select a.shape.sdo_ordinates(1) from test a". But it can't work.
    Thank you very much!

    One solution is to read each ordinate from a cursor ina SQL block. Here is an example:
    set serveroutput on
    SET serveroutput on SIZE 1000000
    set concat on
    DEFINE layername = 'LAYER';
    DEFINE geomcolname = 'GEOM';
    DECLARE
    id varchar2(10);
    longitude number;
    latitude number;
    logmile number;
    i number;
    theLayer varchar2(32);
    theGeomCol varchar2(32);
    BEGIN
    FOR rec IN (SELECT ROWID, id, &geomcolname FROM &layername ) LOOP
    id := rec.id;
    i := 1;
    while i < rec.geom.sdo_ordinates.count loop
    longitude:=rec.geom.sdo_ordinates(i);
    latitude:=rec.geom.sdo_ordinates(i+1);
    logmile:=rec.geom.sdo_ordinates(i+2);
    dbms_output.put_line(id || ',' || longitude || ',' || latitude || ',' || logmile);
    i := i + 3;
    end loop;
    END LOOP;
    commit;
    END;
    Maybe that will help.
    Dave
    David R. Miller
    Michael Baker Jr., Inc.
    3601 Eisenhower Avenue
    Alexandria, VA 22314
    [email protected]
    www.mbakercorp.com

  • How to test the rule if multiline container is passing to the task?

    Hi Experts,
                      I am working on leave workflow. I have to get the approvers based on no of days of leave and leave type. I am getting these details in ITEMS_TAB internal table. I am passing this table to a rule. Now my problem is when I tried to simulate the rule I am not getting any input screen to enter the data.
    ITEMS_TAB is an internal table type of   "PTREQ_ITEMS_WF_TAB_FLAT".
    In the rule I have created a container by selecting the radiobutton "ABAP Dict. Data Type" and entered the above reference parameter is it right way?
    Is it possible to test the rule independently if I use multiline container as import parameter in my rule?  If so can anybody please tell me how to test the rule?
    Thank You.
    Srija.

    Hi Pavan,
                     Thank you.
                     To copy the values I am not getting any input screen to input the values. I observed one thing that the type that I am referring in the Rule is a deep structure. Is this is the reason that I am not getting the input screen to enter the values?
    I tested by creating aother rule by taking a field for that rule I am getting the input screen to simulate the Rule.
    Can you please suggest if the rule will not work then what I have to do? without the rule how can I get the agents?
    Thank you.
    Srija

  • How to test the interfaces in XI ?

    Hi ,
    Our Xi system is being upgraded from 3.0 to 7.0. I was asked to test the interfaces once the upgradation is done. I am not sure how this testing is to be done and will there be aby test plan for this??
    Can some one help me on this ??
    Thanks in Advance,
    Hemanthika

    To test, you must have imported all your scenarios in to your new system.then couple of general tips,
    1.testing can be done only after understanding the scenario.
    For this, u refer to the integration scenario in ur design. so this shall give u an idea about all the systems involved in integration and how the data flowing is between them and what kind of systems they are?
    2. For testdata, you might need of business or functional team as you cannot have any info on the file formats etc(depending on different scenarios invloved like R3, SOAP Databse etc)
    these are only general tips. but u can refer to many of the trouble shooting guides already available blogs in sdn for any sought of inputs.But then, SDN is always there.
    you can test/monitor ur results in RWB->component monitoring
    also in sxmb_moni
    thanks
    kiran
    Edited by: kiran dasari on Mar 17, 2008 4:44 PM

  • How to test server proxy in ECC 6.0 ?

    Hi,
    Please tell me how to test server proxy created in SPROXY of ECC 6.0  .
    I am following this blog XI: Debug your inbound ABAP Proxy implementation .
    When i am executing the test service provider i am getting an error with " program terminated " message  creating a dump .
    How to test it through this method ? Is there any other way to test in ECC6.0
    Thanks,
    Laawanya D

    Hi,
    I have put a breakpoint in my proxy code and when i am trying to execute only, i am getting the error "Program terminated" .
    I am using ECC6.0 , so when i am clicking on Test Interface, i am not  getting  "Application Data Entry" parameters  as given in  Stefan's blog , but I am getting something like:
    Input:
    1.Generate template Data
    2.Enforce Stylesheet generation
    (I have checked both 1 & 2 .)
    Error Handling:
    1.Don't catch Application faults
    if i check this and execute , my program gets terminated , leaving a dump and if i dont set it also My program gets terminated .
    So what to do now ?

  • How to test BLOB Table Column in BCBrowser??

    Hi,
    My requirement is to upload a file(pdf,doc,jpg, txt) into DB using ADF.
    I use, Jdev 11.1.1.6, Oracle 10g XE.
    For this, I created the following
    1. A table as MyFilesTab(ID Number, FileName Varchar2(80), File BLOB)
    2. An Entity Object MyFilesEO on MyFilesTab.
    3. Generated a default view object: MyFilesVO
    4. Application Module : TestAM with view instance "MyFiles"
    But When I run TestAM, I see MyFiles as an Input textbox. So I cannot able to add a file that will be stored in my Table.
    Please help me out.

    Just to clarify, my previous post is related to title of this thread("How to test BLOB Table Column in BCBrowser??"),
    and not to "My requirement is to upload a file(pdf,doc,jpg, txt) into DB using ADF" 
    Dario

  • How to test the PCI/PXI 4461

    when i receive a new card, how to test it?
    when i click the "self-test" in the Measurement & Automation Explorer,it shows that "the device has passed the self-test."
    is that means the card is ok?
    or i should make other test to confirm?what test should i do?

    You can also use the test panels in MAX to test each channel of input or output after they are terminated. This is a good verification that your signal conditioning, wiring, etc is working as expected before getting LV involved.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to test if particular character is empty in a row

    Hi All ,
    Requirement : To split the input file into two files .
    If the length of the row is 93 characters and the condition is If characters from 28 to 32 are empty then create a file with the name PCO1 .txt else create a file with the name PCO2 .txt
    Please let me know how to test in a row if particular character has certain value or from 28 to 32 are empty .
    Thanks for your help

    hi Sharma,
    IF line+27(5) EQ space.
    ==> positions 28-32 have no value (i. e. all characters are spaces)
    ELSE.
    ==> positions 28-32 have some value
    ENDIF.
    some explanation:
    line+27(5) ==> this means: 5 characters after position 27
    hope this helps
    ec

Maybe you are looking for

  • Computer (window 8) doesn't recognize my iPod touch 5th gen.

    So my iPod is on the "connect to itunes" spot. When I plug it in, it says something like "USB device cannot be recognized." help?

  • Generate the primary key  automatically while records are saved

    Hi experts, I need to generate the primary key of a custom table automatically when a new record is saved. Pleas help asap. Urgent.

  • Clean up window and make firefox show what it needs to

    I a having a huge problem with firefox as well as most all other browsers I use a netbook computer nearly 100% of the time because of the portability, but I have found that netbooks screens typically are not as big as desk tops, now I don't mean phys

  • Iphone model number

    How i can get the model number from Iphone to know where he come from? I need to know wich is the model number from Hong Kong Iphone now my is model MB489B where is from? thanks in advance

  • G6: Setting default metadata values

    Hello all!I am trying to find a way to set default metadata values in plumtree. For example, if I created a Web Content Crawler to scan MarchofDimes.com, which has various career postings, I would like to be able to default or force these crawled con