Creating a function with  a for loop and %type

Hello,
I am trying to create a function which contains a for loop as well as %type.
This function is on a student table and i am trying to create a function which will display the zip which is a varchar2(5).
I need to do this through this function.
However, I can't seem to get it running.
Can anyone help?
below is what i tried as well as other options and was not successful.
I also displayed my error with the show error command.
SQL> create or replace function zip_exist
2 return varchar2
3 is
4 v_zip student.zip%TYPE;
5 cursor c_zip is
6 select zip
7 from
8 student
9 where zip=zip;
10 begin
11 open c_zip;
12 v_zip IN c_zip
13 loop
14 v_zip:=c_zip%TYPE;
15 end loop;
16 close c_zip;
17 end;
18 /
Warning: Function created with compilation errors.
SQL> show error
Errors for FUNCTION ZIP_EXIST:
LINE/COL ERROR
12/7 PLS-00103: Encountered the symbol "IN" when expecting one of the
following:
:= . ( @ % ;
16/1 PLS-00103: Encountered the symbol "CLOSE"
SQL>
kabrajo

user10873577 wrote:
Hello,
I am trying to create a function which contains a for loop as well as %type.
This function is on a student table and i am trying to create a function which will display the zip which is a varchar2(5).
I need to do this through this function.
However, I can't seem to get it running.
Can anyone help?
below is what i tried as well as other options and was not successful.
I also displayed my error with the show error command.
SQL> create or replace function zip_exist
2 return varchar2
3 is
4 v_zip student.zip%TYPE;
5 cursor c_zip is
6 select zip
7 from
8 student
9 where zip=zip;
10 begin
11 open c_zip;
12 v_zip IN c_zip
13 loop
14 v_zip:=c_zip%TYPE;
15 end loop;
16 close c_zip;
17 end;
18 /
Warning: Function created with compilation errors.
SQL> show error
Errors for FUNCTION ZIP_EXIST:
LINE/COL ERROR
12/7 PLS-00103: Encountered the symbol "IN" when expecting one of the
following:
:= . ( @ % ;
16/1 PLS-00103: Encountered the symbol "CLOSE"
SQL>
kabrajoTry This
Create a sample table
SQL> create table student(id number(10),zip varchar2(5));
Table created.Insert the record
SQL> insert into student values(1111,'A5454');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from student;
        ID ZIP
      1111 A5454
SQL> create or replace function zip_exist(v_id number)
  2   return varchar2
  3   is
  4   v_zip student.zip%TYPE;
  5  BEGIN
  6   select zip
  7   INTO v_zip
  8   FROM student
  9   where id=v_id;
10   Return v_zip;
11  EXCEPTION WHEN NO_DATA_FOUND THEN
12                  RETURN 'INVALD';
13  WHEN OTHERS THEN
14                 return  'NA!';
15   end;
16  /
Function created.
SQL> set serveroutput on
SQL> select zip_exist(1111) from dual;
ZIP_EXIST(1111)
A5454
SQL> select zip_exist(2222) from dual;
ZIP_EXIST(2222)
INVALDHope this helps
Regards,
Achyut K

Similar Messages

  • Stop user creating process order with material for specific order type

    Hey Team,
    Is there a way where I can stop creating process order with material for specific order type says Z*. We are using ZNMA  order type to create trial batch and we do not want to create process order with material for this order type.
    Any ideas?
    Thanks
    Bhavesh Patel.

    You can restrict the order creation in CO01 based on authorization, Remove the authorization for Z order type for the particular user,  Check with your basis Guy

  • Help with a FOR loop and an object array

    I need to make a for loop that takes an array of objects that contain the parameters year, type, and model (all ints) and sort by year, then divide the array in all the objects with the same year and sort them by type, then divide the array again into the objects with the same year AND type and sort them by model.
    the object a Dress objects, the get methods are get+nameof parameter.
    the array is a 1D array called Dresses.
    I have made a paralell array to store the value of the parameters and sort that then move the array acording to that sorted array. The problem is in the division of the array.

    We'll give your request to do (or finish) your homework for you the attention it deserves.

  • Please help with the FOR loop and the array..

    I was trying to place some words in the Movie Clip
    "TextPanel" and set a
    random position to each of them.
    But it's not working.
    1) I created a Movie Clip "word" and inside that MC I created
    a text field
    and gave it an identifier "textFiled".
    2) The linkage name for Movie Clip "word" I set to "word".
    3) In the actionscript I created an Array called "aWords".
    4) Then I created a FOR loop that should
    place (attach) Movie Clips "word0", "word1", "word2" and
    "word3" to the
    movie clip TextPanel, and set the textField text for each of
    them to the
    text from the Array.
    But the script attaches 4 Movie Clips with a name
    "Undefined", instead of 4
    different names (from the Array).
    What is wrong with this script?
    var aWords:Array = [apple,banana,orange,mango];
    for(i=0;i<aWords.length;i++){
    var v = TextPanel.attachMovie("word","word"+i,i);
    v.textFiled.text = aWords
    v._x = randomNumber(0,Stage.width);
    v._y = randomNumber(0,Stage.height);
    Thanks in advance

    But in my Post I already wrote v.textFiled.text = aWords
    so I don't understand what were you correcting..
    And one more:
    I have tested it by changing the
    v.textFiled.text = aWords; to v.textFiled.text = "some
    word";
    and it's working fine.
    So there is something wrong with the Array element, and I
    don't know why..
    "aniebel" <[email protected]> wrote in
    message
    news:ft2d5k$lld$[email protected]..
    > Change:
    > v.textFiled.text = aWords;
    >
    > to:
    > v.textFiled.text = aWords
    >
    > It needs to know which element inside the array you want
    to place in the
    > textfield (or textfiled) :)
    >
    > If that doesn't work, double check that your instance
    name is correct
    > inside
    > of "word".
    >

  • Created a package with packager for updates and install failed

    Brand new iMac with CC2014 installed. Created a package of just updates. When running the update package, installation failed. Any ideas anyone?

    Moving the discussion to Enterprise Deployment for Creative Cloud, Creative Suite,
    Thanks,
    Atul Saini

  • For loop and xml - how to point the right content in a XML file with a dynamically created button?

    Hi Everybody,
    as my first experience in AS3 I'm bulding a photo multigallery. In that gallery I have some buttons, each one pointing to its respective set of images.
    Each button is created with the for loop, that picks the information from a XML file. From this XML I get the text of the button, the position etc. What I did with some sucess. But there is a scary problem: I don't know how to make each button load the respective and unique set of images.
    I've tryied several different methods, with no effect, to make each loop to give to each button an unique identity to load the respective set of images.
    I imagine that the solution pass by the use of arrays. I wrote some code, and I guess that I'm almost there (but not sure). Here is my AS3 code until now:
    // CREATE MENU CONTAINER //
    var menuContainer:MovieClip = new MovieClip();
    menuContainer.x=10;
    menuContainer.y=300;
    addChild(menuContainer);
    // CREATE IMAGES CONTAINER //
    var imagesContainer:MovieClip = new MovieClip();
    imagesContainer.x=10;
    imagesContainer.y=10;
    addChild(imagesContainer);
    //// LOAD XML ////
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
    xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
    var xml:XML;
    function whenLoaded(evt:Event):void {
         xml=new XML(evt.target.data);
         var mySetsList:XMLList=xml.children();
         //// MENU BUTTONS ////
         // CREATE ARRAYS //
         var totalArray:Array = new Array();
         var setNodesArray:Array = new Array();
         var setNamesArray:Array = new Array();
         // POSITIONING BUTTONS INSIDE MENU CONTAINER//
         var rowsQuantity:Number=3;
         var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
         var cellWidth:Number=160;
         // CREATE BUTTONS //
         for (var i:int=0; i< mySetsList.length(); i++) {
              var newSetButtonMC:setButtonMC=new setButtonMC();
              //what do I do here to make it works? To give each button created a unique id.
              setNodesArray.push(i);
              //trace(setNodesArray);
              var imageNodesArray:Array = new Array();
              for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
                   imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("imageTitle"));
              totalArray.push(imageNodesArray);
              newSetButtonMC.setButtonText.text=mySetsList.attribute("galeriaTitle")[i];
              newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
              var cellX:Number=Math.floor(i/rowsQuantity);
              var cellY:Number=i%rowsQuantity;
              newSetButtonMC.x=cellX*cellWidth;
              newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
              newSetButtonMC.addEventListener(MouseEvent.CLICK, onClick);
              menuContainer.addChild(newSetButtonMC);
         totalArray.push(setNodesArray);
         //// MENU BUTTONS ACTIONS ////
         function onClick(mevt:MouseEvent):void {
              trace(totalArray [0][0]);
              trace(totalArray [0][0]);
              // in the line above I achieved some success loading a specific info from XML.
              // but I don't know what to do with it.
              //what do I do here? To make each button to load its own node from XML.
    Here is my XML:
    <GALERIA galeriaTitle="galeria 01">
      <IMAGE imageTitle="imageTitle01">feio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">muitofeio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisfeio.jpg</IMAGE>
    </GALERIA>
    <GALERIA galeriaTitle="galeria 02">
      <IMAGE imageTitle="imageTitle01">estranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">maisestranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisestranho.jpg</IMAGE>
    </GALERIA>
    Thanks everyone . ABSTRATO

    you can assign each newSetButtonMC and ivar property that points to its i value or, even easier:
    // CREATE MENU CONTAINER //
    var menuContainer:MovieClip = new MovieClip();
    menuContainer.x=10;
    menuContainer.y=300;
    addChild(menuContainer);
    // CREATE IMAGES CONTAINER //
    var imagesContainer:MovieClip = new MovieClip();
    imagesContainer.x=10;
    imagesContainer.y=10;
    addChild(imagesContainer);
    //// LOAD XML ////
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
    xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
    var xml:XML;
    function whenLoaded(evt:Event):void {
         xml=new XML(evt.target.data);
         var mySetsList:XMLList=xml.children();
         //// MENU BUTTONS ////
         // CREATE ARRAYS //
         var totalArray:Array = new Array();
         var setNodesArray:Array = new Array();
         var setNamesArray:Array = new Array();
         // POSITIONING BUTTONS INSIDE MENU CONTAINER//
         var rowsQuantity:Number=3;
         var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
         var cellWidth:Number=160;
         // CREATE BUTTONS //
         for (var i:int=0; i< mySetsList.length(); i++) {
              var newSetButtonMC:setButtonMC=new setButtonMC();
              //what do I do here to make it works? To give each button created a unique id.
              setNodesArray.push(i);
              //trace(setNodesArray);
              var imageNodesArray:Array = new Array();
              for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
                   imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("imageTitle"));
             nextSetButtonMC.imageArray = imageNodesArray;
              //totalArray.push(imageNodesArray);
              newSetButtonMC.setButtonText.text=mySetsList.attribute("galeriaTitle")[i];
              newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
              var cellX:Number=Math.floor(i/rowsQuantity);
              var cellY:Number=i%rowsQuantity;
              newSetButtonMC.x=cellX*cellWidth;
              newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
              newSetButtonMC.addEventListener(MouseEvent.CLICK, onClick);
              menuContainer.addChild(newSetButtonMC);
         totalArray.push(setNodesArray);
         //// MENU BUTTONS ACTIONS ////
         function onClick(mevt:MouseEvent):void {
              var mc:setButtonMC=setButtonMC(mevt.currentTarget);
    for(i=0;i<mc.imageArray.length;i++){
    trace(mc.imageArray[i]);
    Here is my XML:
    <GALERIA galeriaTitle="galeria 01">
      <IMAGE imageTitle="imageTitle01">feio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">muitofeio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisfeio.jpg</IMAGE>
    </GALERIA>
    <GALERIA galeriaTitle="galeria 02">
      <IMAGE imageTitle="imageTitle01">estranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">maisestranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisestranho.jpg</IMAGE>
    </GALERIA>
    Thanks everyone . ABSTRATO

  • How can I Create a Client Configuration File for RemoteApp and Desktop Connection with Server 2012?

    I have a working RDS RemoteApp site and looking to test out the feature in Windows 7 Control Panel\All Control Panel Items\RemoteApp and Desktop Connections
    I came across this link: Create a Client Configuration File for RemoteApp and Desktop Connection and I believe this is what I need to do first, but these instructions are for
    Server 2008, and I'm running 2012.
    Any suggestions or tips on how I can begin testing this with Server 2012?

    Hi,
    You can manually enter the path to the 2012 feed and it will connect and download the RemoteApps and Desktop connections.
    If you need a sample .wcx file I have posted one here a couple of times.  If you want I will look for it and post a link.
    -TP
    I tried adding my URL's below, these are sample links that work for me right now for when I log into the web page, but neither of these work.  And I'm not sure what I would need to do with or how to create a .wcx file.
    When I type in my URL of: https://connect.mydomain.org/RDWeb, I get redirected to: 
    https://connect.mydomain.org/RDWeb/Pages/en-US/login.aspx?ReturnUrl=/RDWeb/Pages/en-US/Default.aspx

  • The demand of my application is that i can not replace for loop with a while loop.because i need fixed number of iterations and as far as i know fixed iterations could be only with possible with the for loop.

    the demand of my application is that i can not replace for loop with a while loop.because i need fixed number of iterations and as far as i know fixed iterations could be only with possible with the for loop.
    your recommended second option that i could add true/false case.
    this true/false case must be inside the for loop or outside the for loop?if this case is inside the for
    loop, how can i send stop command from outer while
    loop?
    more over do you have any example for this please?
    thanks"

    You can execute a fixed number of iterations using a while loop by comparing the iteration count to the number of iterations you want and wiring the output of that comparison (e.g. Less Than or Equal To) to the continue (or stop) terminal of your while loop. Which comparison you use depends on personal preference, where you wire the desired count and the interation count, and whether you're using the while loop as Continue if True or Stop if True.
    Ben gave you step-by-step instructions in response to your previous question. Look here for Ben's response.
    Ben's response looks pretty good and detailed to me. It certa
    inly deserved better than a 1-star rating.

  • I'm having problems manipulating array data within a for loop, and extracting the required sub-arrays generated.

    Hi,
    I'm using labVIEW V5.1
    I'm trying to generate 10 1D arrays, the first array is initialized to all zeroes, then I have set up a for loop which shifts the first element by 1, then a random number is placed into the first element position. I am using a shift register to feed back in the newly generated array into the start of the loop.
    By the end of the each loop I want to be able to use the array generated in an algorithm outside the loop. However I only want the Nx1 array that has just been generated.
    Unfortunately, I cannot figure out how to resize, reshape or index the output array to do this.
    I would like the loop to
    give me out a 1D array after each iteration.
    Any help would be greatly appreciated.

    I hope I've understood your problem.
    First your vi was lacking of the sub-vi working as shift register, I've replaced it with the rotate function.
    The indexing of your arrays create a 2D array whose rows are your 1D array.To pick only one of them you have to use the index array function and select which one you want.
    To use your temporary data in another part of your application you should use a local variable of array2.
    I did it in a separated while loop That I syncronized with the for loop using occurrence, in this way the while loop runs each time a new value is inserted in array2 (each loop of the for loop structure).
    If you don't need this syncronization just get rid of occurrence functions.
    I place a delay in the for loop to show what happens when running.
    Hope it was helpful.
    Alberto Locatelli
    Attachments:
    array_test_v3.vi ‏35 KB

  • Issues with nested for loops - saving images from a camera

    Hi all,
    I've written a vi. to capture a specific number of images ('Image No') and save these images, outputted to a folder of my choice.  Each image is identified sequentially.  However, I wish to do a number of iterations ('Run') of this capture sequence, such that the filename of each image would be 'Filename (Run)_(Image No).png', e.g. run 5, image 10 would be 'Filename 5_10.png'.  I have tried a nested for loop for this but I receive an error 'Asynchronous I/O operation in progress' (I've attached a printscreen).
    Can anyone assist me in solving this problem? I preiously posted this in machine Vision but got no response (http://forums.ni.com/t5/Machine-Vision/Capturing-image-sequences-issues-with-nested-for-loops/m-p/19...).  Please find attached my vi.
    Kindest regards and thanks,
    Miika
    Solved!
    Go to Solution.
    Attachments:
    Labview problem.jpg ‏3841 KB
    Image sequence save to file.vi ‏48 KB

    Miika,
    the problem is not the filenam, but the name of the folder (AHHHHH!). You try to create the same folder in the outer for loop over and over again.... (it is the error message above the '======', not below )
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Trying to save key strokes with a for loop

    I have been trying to action script for years with no
    success. I to some time off and learned javascript and some oop
    (ruby) so I thought I would take another stab at it. I am still
    having problems. Here goes...
    I have several movieclips on the stage that will be set up as
    buttons. They all have the same effects associated with mouseover
    and mouseout so I thought I could save some key strokes with a for
    loop. But I can't get it working right. Could someone tell me what
    I am doing wrong please?
    If anyone can help it would be appreciated.

    kglad,
    Thanks for taking a look. In answer to your question. The
    movie clip instance names are mc_ItemText0 ... mc_ItemText3.
    quote:
    those declarations at the top of your for-loop aren't doing
    anything useful. what are the names of you movieclips that are
    on-stage?
    In reg\ards to the variable declarations, sorry my variable
    names are causing confusion. I use the name "mc" for two different
    variables. Once for the FOR loop and a separate time locally in the
    functions grow and shrink. The ones set for the For loop are used
    in the 'onEvents' at the bottom of the script. Sorry for the
    confusion.
    Because the code works if I take it out of the FOR loop and
    replace the
    's with the numbers that corruspond to the movie clip; I don't
    think the similar names are conflicting because of the scope. To
    make the code more readable and eliminate confusion I have posted
    the code with unique variable names.
    I have searched the forum for FOR loop difficulties and
    found several cases that seemed similar to mine, but I didn't
    understand what was happening.
    Examples:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=288&threadid =1253110&highlight_key=y&keyword1=for%20loop
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=288&threadid =1202338&highlight_key=y&keyword1=for%20loop
    My code with unique variable names to end confusion:

  • For Loop and Void Method Questions

    Question 1: How would I write a for loop that repeats the according to the number entered, to prompt the user to enter a number (double) between 1 and 100. If the number is outside this range it is not accepted.
    Question: 2 Also how would I write a for loop to do sum and find the average of the array numbers in a seperate void method( does not return anything to the main method)?
    Question: 3 (first code snippet) With my for loop that is used to process each number in the array and square it and cube it and display the results to 2 decimal places. How do I make it so say I want the array to allow me to enter 2 numbers (so I enter 2 numbers) then it asks me to enter a number between 1 -100 (which will prompt 2 times) that it shows me the results for the entered numbers between 1-100 after one another instead of number then result number then result like I how it now.
    for (int index = 0; index < howNum; index++) // process each number in the array
              enterYourNumbers = JOptionPane.showInputDialog   
                            ("Enter a number between 1 and 100");                       
              numArray = new double[howNum]; 
            try
                numArray[index] = Double.parseDouble(enterYourNumbers);
            catch (NumberFormatException e)
                    enterYourNumbers = JOptionPane.showInputDialog
                              ("Enter a number between 1 and 100");                          
                DecimalFormat fmt = new DecimalFormat ("###,###.00");
                JOptionPane.showMessageDialog(null, enterYourNumbers + " "  + "squared is "  + fmt.format(calcSquare(numArray[index]))
                                              + "\n" + enterYourNumbers + " " +  "cubed is " + fmt.format(calcCube(numArray[index])));                                                                           
                wantToContinue = JOptionPane.showInputDialog ("Do you want to continue(y/n)? ");
      while (wantToContinue.equalsIgnoreCase("y"));
    import javax.swing.*;
    import java.text.DecimalFormat;
    public class Array
        public static void main(String[] args)
            int howNum = 0;
            int whichNum = 0;     
            double[] numArray;
            boolean invalidInput = true;
            String howManyNumbers, enterYourNumbers, wantToContinue;
      do // repeat program while "y"
          do // repeat if invalid input
            howManyNumbers = JOptionPane.showInputDialog
                        ("How many numbers do you want to enter");                     
            try
                 howNum = Integer.parseInt(howManyNumbers);
                 invalidInput =  false;
            catch (NumberFormatException e )
                howManyNumbers = JOptionPane.showInputDialog
                            ("How many numbers do you want to enter");
          while (invalidInput);
          for (int index = 0; index < howNum; index++) // process each number in the array
              enterYourNumbers = JOptionPane.showInputDialog   
                            ("Enter a number between 1 and 100");                       
              numArray = new double[howNum]; 
            try
                numArray[index] = Double.parseDouble(enterYourNumbers);
            catch (NumberFormatException e)
                    enterYourNumbers = JOptionPane.showInputDialog
                              ("Enter a number between 1 and 100");                          
                DecimalFormat fmt = new DecimalFormat ("###,###.00");
                JOptionPane.showMessageDialog(null, enterYourNumbers + " "  + "squared is "  + fmt.format(calcSquare(numArray[index]))
                                              + "\n" + enterYourNumbers + " " +  "cubed is " + fmt.format(calcCube(numArray[index])));                                                                           
                wantToContinue = JOptionPane.showInputDialog ("Do you want to continue(y/n)? ");
      while (wantToContinue.equalsIgnoreCase("y"));
        public static double calcSquare(double yourNumberSquared)
            return yourNumberSquared * yourNumberSquared;       
        public static double calcCube(double yourNumberCubed)
           return yourNumberCubed * yourNumberCubed * yourNumberCubed;              
        public static void calcAverage(double yourNumberAverage)
    }

    DeafBox wrote:
    Question 1: How would I write a for loop that repeats the according to the number entered, to prompt the user to enter a number (double) between 1 and 100. If the number is outside this range it is not accepted. Use a while loop instead.
    Question: 2 Also how would I write a for loop to do sum and find the average of the array numbers in a seperate void method( does not return anything to the main method)? Why would you want to use 2 methods. Use the loop to sum the numbers. Then after the loop a single line of code calculates the average.
    Question: 3 (first code snippet) With my for loop that is used to process each number in the array and square it and cube it and display the results to 2 decimal places. How do I make it so say I want the array to allow me to enter 2 numbers (so I enter 2 numbers) then it asks me to enter a number between 1 -100 (which will prompt 2 times) that it shows me the results for the entered numbers between 1-100 after one another instead of number then result number then result like I how it now. If I understand you correctly, use 2 loops. One gathers user inputs and stores them in an array/List. The second loop iterates over the array/List and does calculations.

  • I need help with my for loop in this array

    Ok well, I can't get my code to work. Also, please remember that this is just my draft so it isnt pretty. I will fix it up later so please look at it. The thing I want to do is look into the array for a time that matches what the user entered and return the toString() of that one. I know there is something wrong with my for loop but I cant figure how to fix it. please help. here is what i have so far:
    import javax.swing.JOptionPane;
    public class Runner
        public static void main (String[] args)
            String timeStr;
            int time, again, optiStr;
            Inbound[] in = new Inbound[25];
             in[0]=new Inbound ("",0,"On Time num0");
             in[1]=new Inbound ("",2,"On Time num1");
             in[2]=new Inbound ("",3,"Delayed num2");
             in[3]=new Inbound ("",4,"On Time");
             in[4]=new Inbound ("",5,"On Time");
             in[5]=new Inbound ("",6,"Canceled");
             in[6]=new Inbound ("",1,"Canceled num6");
             in[7]=new Inbound ("",8,"On Time");
             in[8]=new Inbound ("",9,"Delayed");
             in[9]=new Inbound ("",10,"On Time");
             in[10]=new Inbound ("",11,"Delayed");
             in[11]=new Inbound ("",12,"On Time");
             in[12]=new Inbound ("",13,"Delayed");
             in[13]=new Inbound ("",14,"On Time");
             in[14]=new Inbound ("",15,"On Time");
             in[15]=new Inbound ("",16,"On Time");
             in[16]=new Inbound ("",17,"Canceled");
             in[17]=new Inbound ("",18,"On Time");
             in[18]=new Inbound ("",19,"On Time");
             in[19]=new Inbound ("",20,"Canceled");
             in[20]=new Inbound ("",21,"On Time");
             in[21]=new Inbound ("",22,"Delayed");
             in[22]=new Inbound ("",23,"On Time");
             in[23]=new Inbound ("",24,"Cancled");
             in[24]=new Inbound ("",7,"On Time num24");
            do{
                timeStr = JOptionPane.showInputDialog ("In military time, what hour do you want?");
                time = Integer.parseInt(timeStr);
                if (time<=0 || time>24)
                 JOptionPane.showMessageDialog (null, "Error");
                 optiStr = JOptionPane.showConfirmDialog (null, "If you want Incoming flights click Yes, but if not click No");
                if (optiStr==JOptionPane.YES_OPTION)
    //(ok this is the for loop i am talking about )
                    for (int index = 0; index < in.length; index++)
                      if ( time == Inbound.getTime())
                   JOptionPane.showMessageDialog (null, Inbound.tostring());  //return the time asked for
    //               else JOptionPane.showMessageDialog (null, "else");
                }//temp return else if failed to find time asked for
    //             else
    //               if (optiStr==JOptionPane.CANCEL_OPTION)
    //                 JOptionPane.showMessageDialog(null,"Canceled");
    //              else
    //                {Outbound.run();
    //                JOptionPane.showMessageDialog (null, "outbound");}//temp
                  again=JOptionPane.showConfirmDialog(null, "Try again?");
            while (again==JOptionPane.YES_OPTION);
    }any help would be greatly appriciated.

    rumble14 wrote:
    Ok well, I can't get my code to work. Also, please remember that this is just my draft so it isnt pretty. I will fix it up later so please look at it. The thing I want to do is look into the array for a time that matches what the user entered and return the toString() of that one. I know there is something wrong with my for loop but I cant figure how to fix it. please help. here is what i have so far:
    >//(ok this is the for loop i am talking about )
    for (int index = 0; index < in.length; index++)
    if ( time == Inbound.getTime())
    JOptionPane.showMessageDialog (null, Inbound.tostring());  //return the time asked for
    Inbound.getTime() is a static method of your Inbound class, that always returns the same value, I presume? As opposed to each of the 25 members of your array in, which have individual values?
    Edited by: darb on Mar 26, 2008 11:12 AM

  • Create withholding tax data subsequently for reconciled and open items in c

    Hi All,
    Mine is a US co code and I have a  vendor for which invoice and payment documents are posted. After posting the invoice i found that the vendor is subjected to classic withholding tax which i did not calculate when posting invoice, making payments.
    Now i have changed the vendor master data with relevant withholding tax details.
    I know the program RFWT0020 allows us to create withholding tax data subsequently for reconciled and open items in cases where vendors or customers become liable for withholding tax with a tax rate of 0 %.
    It is not working out for me.
    Can any body help me on this.
    Thanks in advance.

    Dear all,
    by se38 --> report documentation, You can read carefully the following:
    The auxiliary program makes it possible to convert both classic and extended withholding tax data. However, with classic withholding tax, ONLY VENDOR data can be converted.
    In addition, the program enables the withholding tax code to be changed for reconciled and open items with existing withholding tax data. For this, the tax rate of the existing withholding tax data as well as the tax rate of the new withholding tax code must be 0%. The new withholding tax codes are taken from the customer or vendor master data. In the case of extended withholding tax, the withholding tax code is only changed if the related withholding tax categories are the same.  The withholding tax base amount is not changed by this procedure.
    Recreating or changing the withholding tax data requires that the program first be executed for INVOICES and then executed for PAYMENTS in a subsequent step.
    I hope this helps You.
    Mauri

  • Created a document with FM Author 12 and added a template in FM12 to the document

    Created a document with FM Author 12 and added a template in FM12 to the document. Can't open the document again in FM Author 12 "This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel".

    Should both programs be in "Authoring" mode?

Maybe you are looking for