Doesn't loop a while(true) !!!

I made an Client Chat applet, but for some reason it doesn't do the read/write part to the socket that happens while(true)!!!
Well, actually it doesn't even load the screen! I mean the layout...
As you can see, wrote some System.out.println() to see where it gets stuck, and gets up to "7" and stops - it writes "7" only once and it's in a while(true)!!!
Please help me...
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.io.*;
import java.net.*;
public class main extends Applet {
  boolean sent = false;
  String senttxt = null;
  TextArea maintext = new TextArea(17,50);
  TextField sendtext = new TextField(40);
  Button send = new Button("Send!");
  public void init() {
    setLayout(new FlowLayout());
    add(maintext);
    add(sendtext);
    add(send);
    maintext.setEditable(false);
    cmain();
    catch(Exception e) {
      System.out.println(7);
  public main() {
  /**Construct the applet*/
  private void cmain() {
        Socket echoSocket = null;
        PrintWriter out = null;
        BufferedReader in = null;
        System.out.println(1);
        try {
            echoSocket = new Socket("127.0.0.1", 4445);
              System.out.println(2);
            out = new PrintWriter(echoSocket.getOutputStream(), true);
              System.out.println(3);
            in = new BufferedReader(new InputStreamReader(echoSocket.getInputStream()));
              System.out.println(4);
        } catch (UnknownHostException e) {
            maintext.append("Couldn't find server - maybe offline");
            System.out.println("Couldn't find server - maybe offline");
        } catch (IOException e) {
            maintext.append("There was a problem connecting server");
            System.out.println("There was a problem connecting server");
          System.out.println(5);
        BufferedReader stdIn = new BufferedReader(new StringReader("User Connected!\n"));
          System.out.println(6);
        try {
          while (true) {
            System.out.println(7);
              if(sent) {
                stdIn = new BufferedReader(new StringReader(senttxt+"\n"));
                try { out.println(stdIn.readLine()); } catch (IOException e) { }
                senttxt = null;
                sent=false;
                System.out.println(8);
              try { maintext.append(in.readLine()); } catch (IOException e) { System.out.println(9); }
        } finally {
          System.out.println(8);
          out.close();
          try { in.close(); } catch (IOException e) { }
          try { stdIn.close(); } catch (IOException e) { }
          try { echoSocket.close(); } catch (IOException e) { }
  public boolean action(Event evt, Object arg) {
    if(evt.target instanceof Button || evt.target instanceof TextField) {
      senttxt = sendtext.getText();
      sendtext.setText("");
      sent=true;
      return true;
    return false;
}

I gess your program stops waiting in the in.readLine() on the "try { maintext.append(in.readLine()); } catch (IOException e) { System.out.println(9); }" sentence.
First time your program enters the while(true) it writes the "7", then goes directly to that sentence because sent==false. When reading something from in, it should write "7" again.

Similar Messages

  • Is usng while(true) loop in run mthd of thread good idea 2 make it wait ind

    hi freinds.
    sorry for writing short forms in my subject, but what i want to know is that is is using while(true) loop in run method of thread good idea to make it wait indefinately.
    if not then what might be a good idea.
    I Just need to Start a thread and make it wait indefinitely,
    thanks

    No. "while (true) {}" is a horribly bad way to do
    nothing, as that thread will use 100% of the CPU.
    What does "wait indefinitely" mean? Surely it can't
    mean "wait forever", but if it doesn't mean that then
    I can't guess what it does mean. Do you want to wait
    until some condition is true? Or do you want to wait
    a random amount of time? More information would help.Hello Dr.Clap, read your comments then checked my task manager and found that indeed it occupies 100% of CPU usage. thats really horrible , even i dont want that . ok i will explain u what i am trying to do along with my program on how i have accomplished it . please correct me where i went wrong.
    My Requirement
    my Application is deployed on JBOSS which has its JMS. now lets say i have defined a Queue named "MyAppQueue" and i know that all the senders whereever they may be will post there messages on this queue.
    Now my responsibility is to write a MessageReceiver which is continously running and checking this queue for messages. whenever it receives a message it immidiately calls the messagesListener which processes the message.
    So sow my requirement of Writing such MessageReceiver is that , it should always be in running mode(that means once i start it, it starts forever since this is going to be a REal time application) and continously checking the queue, as soon as some message comes it calls messageListener. and also that this messageReceiver should be fast , i mean coz many messages may come at once say 40-50 messages in a minute.
    so please tell me how do i now write this MessageReceiver.
    the way i have written
    My Code
    package test.jms;
    import java.util.Properties;
    import javax.jms.JMSException;
    import javax.jms.Queue;
    import javax.jms.QueueConnection;
    import javax.jms.QueueConnectionFactory;
    import javax.jms.QueueReceiver;
    import javax.jms.QueueSession;
    import javax.jms.Session;
    import javax.jms.TextMessage;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class MyThreadReceiver implements Runnable{
        String queueName = null;
         Context jndiContext = null;
         QueueConnectionFactory queueConnectionFactory = null;
         QueueConnection queueConnection = null;
         QueueSession queueSession = null;
         Queue queue = null;
         QueueReceiver queueReceiver = null;
         TextMessage message = null;
         MyQueueListener myQueueListener = new MyQueueListener();
        /* (non-Javadoc)
         * @see java.lang.Runnable#run()
        String j;
        public void run() {
            // TODO Auto-generated method stub
            while(true){
               try {
               // Thread.sleep(10000);
            }catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
        public static void main(String[] args) {
            MyThreadReceiver myReceiver = new MyThreadReceiver();
            myReceiver.establishConnection();
          /* after connection is established to the queue, i am not closing the   connection.i am making a thread and passing my class object to it and in run method i have written while(true ) loop to somehow make my MessageReceiver program run indefinately.. */
            Thread thread = new Thread(myReceiver);
            thread.start();
            System.out.println("finished");
         this method opens connection to the queue. and i am not closing this connection .
        private void establishConnection(){
                 queueName = "queue/testQueue";
                      try {
                        Properties env = new Properties();
                        env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
                        jndiContext = new InitialContext();
                   }catch (NamingException e) {
                        System.out.println("Could not create JNDI API " + "context: " + e.toString());
                        System.exit(1);
                   try {
                        queueConnectionFactory = (QueueConnectionFactory)jndiContext.lookup("QueueConnectionFactory");
                        queue = (Queue) jndiContext.lookup(queueName);
                   }catch (NamingException e) {
                        System.out.println("JNDI API lookup failed: " + e.toString());
                        System.exit(1);
                   try {
                        queueConnection = queueConnectionFactory.createQueueConnection();
                        queueSession =      queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
                        queueReceiver = queueSession.createReceiver(queue);
                        queueReceiver.setMessageListener(myQueueListener);
                        queueConnection.start();
                   } catch (JMSException e) {
                        System.out.println("Exception occurred: " +
                        e.toString());
                   } finally {
                        //if (queueConnection != null) {
                        //try {
                        //queueConnection.close();
                        //}catch (JMSException e) {}
       please correct my code. thanks in advance

  • Alternative Solution to While(true) in MessageQueue

    Hey Guys
    Ive decided to decouple my system so it will hold a queue of messages that can then by passed on to Observers.
    I used a while(true) statement that would constantly loop to get updates and then notify observers.
    That was the only way I could think of doing it, is there a better solution?
    This is an idea of whats happening so far:
    public class MessageQueue extends Observable implement Observer, Runnable
           //Array stores messages
           String[] message;
           //this checks my array for new messages and removes and returns the first message from the array
           public String get()
           //this places items on the array
           public void put(String message)
           public void run
                   while(true)
                          String msg = get();
                          setChanged();
                          notifyObservers(msg);
    }Is there a better method that wont take up alot of CPU usage?
    any help on this would be great
    Cheers

    Hey took your advice and opted to use a Vector so i could add and test if it was empty:
        public synchronized String get()
            String  s = null;
            while(!message.isEmpty())
                s = message.firstElement();
                message.removeElement(s);
                try
                    wait();
                catch(InterruptedException ex)
                    ex.printStackTrace();
            return s;
        }Message was edited by:
    FatClient

  • While(true) VS for(;;)

    I usually use for(;;) if I need to make a loop run until it hits a "break;". Is Java more comfortable with having a while(true) instead? The reason I ask, is because it just came to me, that for(;;) might be doing more operations than while(true), since it would check for what would normally be in the (;;)...not sure though, so I came here for advice.
    Obviously its probably not a big optimization, but advice would be useful for future coding.
    Thank you.
    -Neo-

    BTW I always prefer to have an expression in the
    while loop...
    But then, it's not an "infinite" loop... :o)Disagree: in this case, while(true) is also NOT
    an infinite loop.
    Because: both can be interrupted!Disagree on the basis of pedantry and semanticism. LOL
    Conceded that they can be interrupted (I hesitate to write "duh"); however, notice the quotes around "infinite". In the common usage I've seen, while(someExpression()) or while(someBooleanPrimitive) are intended to be interrupted (e.g., the condition will likely change at some point), while while(true) is intended to run "infinitely".
    Maybe after I have a few more years of experience, I'll notice a different trend, but my experience so far is what I based my light-hearted comment on.

  • [BUG REPORT] SmartWatch doesn't wake up while tapping on it

    After last update my Smartwatch doesn't waku up while tapping on it. I can wake it up only with button. This problem exists while screen of watch goes off on a any widget. When screen goes off while displaying a time - i can wake up by tapping on it.
    It is severe problem, i think it drains battery.
    Siemens S4>Siemens C25>Siemens C35i>SE T68i>SE T630>NEC E616>SE K750>SE C702>SE Hazel>SE Xperia Neo V>Sony Xperia S>Xperia Z & Pentagram Quadra 7US & Motorola Defy Mini

    I got some new information about this see bellow.
    Seven of the ten available clock types work with wake up by double tap on it. The other three do not work like that (Smart digital clock and the two Analog clocks below). In general the clocks with the movement detection don't work with double tap.
    Please use one of the seven clock types when double tap is supposed to be used.
    This has been reviewed to have a more consistent solution. But besides that it can be the case that the accelerometer needs a reset, which is done by pressing the key. This is the explanation why the double tap does not work constantly.
     - Community Manager Sony Xperia Support Forum
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • Is there a way to "loop" audio while I try audio filters?

    Is there a way to "loop" audio while I try audio filters?
    Thanks

    Yes.
    Toggle Loop to ON
    Set an In and Out in the timeline then select Play In to Out.
    If you can't find these commands in the Menu Bar or are looking for the keyboard commands, use Help.
    Have fun.
    x

  • Flash Player doesn't loop internet animations

    My Flash Player doesn't loop animations that are supposed to repeat theirselves.
    It always stops at the last frame,
    but this only happens to online animations.
    Is there some feature where I could change that?
    Right-clicking and pressing ''repeat'' doesn't work either, since it doesn't even enable it.

    No, of course not.
    I have two computers,
    my old one still has the old Flash Player (I think), and the new one the new version.
    The old computer plays the animation like it's supposed to be, unlike my new one.
    That's impossible if it's missing/containing a command.

  • How to code a parallel 'for loop' and 'while loop' where the while loop cannot terminate until the for loop has finished?? (queues also present)

    I've attached a sample VI that I just cannot figure out how to get working the way that I want.  I've labeled the some sections with black-on-yellow text boxes for clarity during the description that follows in the next few sentences.  Here's what I want:
    1) overall -- i'm intend for this to be a subVI that will do data acquisition and write the data to a file.  I want it to use a producer/consumer approach.  The producer construct is the 'parallel for loop' that runs an exact number of times depending on user input (which will come from the mainVI that is not included).  For now I've wired a 1-D array w/ 2 elements as a test case.  During the producer loop, the data is acquired and put into a queue to be delt with in the consumer loop (for now, i just add a random number to the queue).
    2) the consumer construct is the 'parallel while loop'.  It will dequeue elements and write them to a file.  I want this to keep running continuously and parallel until two conditions are met.
          i. the for loop has finished execution
          ii. the queue is empty.
       when the conditions are met, the while loop will exit, close the queue, and the subVI will finish. (and return stuff to mainVI that i can deal with on my own)
    Here's the problems.
    1)  in the "parallel for loop" I have a flat sequence structure.. I haven't had time to incorporate some data dependency into these two sequential sections, but basically, I just care that the "inner while loop" condition is met before the data is collected and queued.  I think I can do this on my own, but if you have suggestions, I'm interested.
    2)  I can easily get the outer for and while loops to run sequentially, but I want them to run in parallel.  My reasoning for this is that that I anticipate the two tasks taking very different amounts of time. .. basically, I want the while loop to just keep polling the queue to get everything out of it (or I suppose I could somehow use notifiers - suggestions welcome)...  the thing is, this loop will probably run faster than the for loop, so just checking to see that the queue is empty will not work... I need to meet the additional condition that nothing else will be placed in the queue - and this condition is met when the for loop is complete. basically, I just can't figure out how to do this.
    3) for now, I've placed a simple stop button in the 'parallel while loop', but I must be missing something fundamental here, because the stop button is totally unresponsive.  i.e. - when I press it, it stays depressed, and nothing happens.
    suggestions are totally welcome!
    thanks,
    -Z
    Attachments:
    daq01v1.vi ‏59 KB

    I'd actually like to add a little more, since I thought about it a bit and I'm still not quite certain I understand the sequence of events...
    altenbach wrote:
    zskillz wrote:
    So i read a bit more about the 'dequeue element' function, and as I understand it, since there is no timeout wired to the dequeue element function, it will wait forever, thus the race condition I suggested above can never happen!
    Yes, you got it!
    As I've thought about it a bit more, there's a few things that surprise me... first, the reason the 'dequeue element while loop' errors is not because there's nothing in the queue, it's becaues the queue has been released and it's trying to access that released queue...   However the problem I have is this --- Even though there's no timeout wired to the dequeue element, I still would think that the while loop that contains it would continue to run at whatever pace it wanted -- and as i said before.. most of the time, it would find that there is nothing to dequeue, but once in a while, something is there.  however, it seems that this loop only runs when something has been enqueued.  the reason I say this is illustrated in the next code sample MODv2 that's attached below.  I've added a stop button to the "queue size while loop" so the program runs until that is pressed.  I've also added a simple conditional in the "dequeue while loop"  that generates a random number if it a button is pressed... but this button is totally non-responsive... which means to me that the "dequeue while loop" isn't actually continuously running, but only when an element is added to the queue.  this still seems almost like the 'dequeue while loop" waits for a notifier from the queue telling it to run.  can you explain this to me? because it is different from what I expect to be happening.
    rasputin wrote:
    I tried to open your VIs but it doesn't work. LV
    is launched, the dialog box (new, open, configure...) opens and then...
    nothing. Not even an error message. I guess it isn't a problem of LV
    version or a dialog box would appear saying this. Could you, please,
    send a image of the code?
    Thanks,
    Hi Rasputin, I'm using LV8.  I assume that was your problem, but who knows.  I've attached a pic of of altenbach's solution since it's what I needed.
    thanks
    -Z
    Message Edited by zskillz on 10-20-2006 11:49 AM
    Attachments:
    daq01v1MODv2.vi ‏63 KB
    daq01v1MODpic.JPG ‏116 KB

  • Recursive Loop Error while doing standard cost estimate

    SAP Gurus,
    We are trying to do standard cost estimate on a material and we are getting error because it is going in recursive loop even though we have used "recursive allowed" indicator for item components in the BOM. The error message numbers are CK 730 and CK 740. We are using 4.6c. I have tried the same scenario in ECC 6.0 and still I get the same problem.
    Below is my BOM structure:
    Material 10890345 (has low-level code 012)
            ---> 10867220 (has low-level code 013) and has recursive allowed indicator
    10867220
            ---> 10846733  (has low-level code 014) and has recursive allowed indicator
    10846733
            ---> 10890345 (has low-level code 012) and has recursive allowed indicator
    According to me, the BOM for material 10846733 is causing the problem.
    For some weird reason while doing the costing run for material 10890345, it s not stopping and going in a loop.10890345  and 10846733 should ideally have the same low-level code as they are recursive.
    Please help to provide some solutions at the earliest on how to avoid recursive loop during costing.
    Regards,
    Swapnil

    Dear,
    I have 2 things to shear with you.
    The method we followed to solve the iteration is as below
    1.Config change -
    Valuation variant in the costing variant, we changed the sequence as below
    material valuation
    4 planned price 1
    2 std price
    3 Mov ave price
    2. Material master change
    made all the semi finished goods and finished goods
    procurement type = E,
    costing with qty structure,
    Enter the planned price1
    By doing this what happens is
    when system first start the iteration, takes the planned price 1 and start iterating and next time in the second iteration it takes the calculated price from qty structure till it finds the difference between the value calculated is less than .001. Then it gives the result
    Why lot size is important is, in our case in some levels the usage is very less compared to the first material header qty and system used to stop in between  and not even reaching the last level as during the cycle it was reaching less .001 difference. may be in your case it may not be the case...just check
    Please come back after trying this. this was the only last option i had to solve the issue in my client.
    Another alternative is to have a different material for costing purpose to stop the iteration which i will not recommend as we need to do some calculation for each stage and input the cost of dummy material in each stage.
    My client is happy with the result as the difference between manual calculation and system calculation is less then .1%...this is because SAP will not consider the difference beyond .001, but in excel you get as many as decimals you want.

  • Avoiding Logical Loop Error while defaulting values

    Hi Experts,
    We have a requirement where lets say Attribute A and Attribute B are displayed on the screen, we need to default value for Attribute B to NA if value of Attribute A is set by the user to "XYZ", else whatever value user enters in Attribute B will be set. To achieve this, we are setting the value of the Attribute B in the rule document. If we use the validation rule table like mentioned below, it throws a logical loop error:
    Attribute A
    “NA”
    Attribute B = "XYZ"
    Attribute A
    otherwise
    To avoid this, we are using a dummy attribute for Attribute A (which is not displayed on the screen) to set in the rule document as mentioned below and this attribute will be shown in the decision report:
    Attribute A Dummy
    “NA”
    Attribute B = "XYZ"
    Attribute A
    otherwise
    The issue is, we are sending the Session data to Siebel through OPA connectors. Now these dummy attributes as mentioned above (which are not displayed on UI) are not sent as part of the Session data as these are inferred attributes.
    Is there any way to:
    1. Solve the logical loop error issue so that we dont have to use the dummy attribute
    2. If we have to use dummy attributes, then how to send them to Siebel as part of session data.

    From:http://www.oracle.com/technetwork/apps-tech/policy-automation/documentation/index.html
    Oracle Policy Automation Connector for Siebel 10.4.4 Developer Help (HTML - Please be patient while the help index loads.)
    Full developer help for OPA Connector for Siebel 10.4.4, from getting started with mapping, to configuring and deploying rule projects, and handling session data being passed to and from Web Determinations. Includes information on the new Siebel integration object approach available since the 10.3 version of this connector. Note that only rulebases developed with Oracle Policy Modeling 10.4.0, 10.4.1, 10.4.2, 10.4.3 or 10.4.4 can be deployed to OPA Connector for Siebel 10.4.4.
    Specifically,  see the Topics under "Data Mapping" in the table of contents.

  • Do I use a FOR LOOP or WHILE LOOP for a program like this?

    How do I write a progam in a way that in a certain expression 't+C', the variable t would decrease until the expression t+C will equal a certain expression .99x. Assuming .99x is a constant and C is a constant also. Also I would like to output the maximum value for the variable t (that satisfies the equation t+C=.99X) into a text box.
    Thank You

    Hey Altenbach..maybe I'm being a little vague
    This is for my senior project and I am designing a software package that helps design/simulate the characteristics of a cpacitive pressure sensor.
    If the membrane of the sensor contains a bimetal layer(polymer and metal)...well at some point the thickness 't' of the metal will affect the Young's modulus of the polymer.
    So i have chosen the tolerance of the bimetal in such a way that the combined Young's modulus (of polymer and metal) is at least still 99% of the Young's modulus of the Polymer.
    Now the thcikness t of the metal greatly affects the Young's moudulus of the bimetal...so if a user inputs a really high thickness t for his metal, the program will calculate the combined Young's Modulus and if it is lower than 99% of the Polymer then the program should spit out or suggest the maximum thickness t for which the combined Yung's modulus=99%of polymer.
    So far.
    The combined young's moudulus looks like this
    Yc=(tp/tc)Yp+(tm/tc)Ym.....where tp is polymer thickness and tm is metal thickness, tc is total thickness, Ym is metal Young's modulus and Yp is polymer Young's modulus...
    Now if Yc>.99Yp  and the user inputs a tm to be ridiculously high....then the program should output the maximum value of tm for which Yc=.99Yp. and also pop up an error message saying "your thcikness is too high" or summin like that. I don't know how to write for  or while loops...
    I really hope this helps....thank you very much

  • Message "Address doesn't exist 6951" while posting GR to PO

    Hello,
    Trying to post a GR to a purchase order. A message comes saying "address doesn't exist 6951". While checking XK02, the system does not display the "Address" field. i.e. a run time error comes when the address field is checked. The error says
    "Runtime Errors         DYNPRO_NOT_FOUND"
    "The system attempted to use dynpro 0000 in program "SAPLSZA1".    This dynpro does not exist."
    Checked the program. The exact point where the error is trigerred is while calling the sub screen i.e. "CALL SUBSCREEN ADDRESS INCLUDING 'SAPLSZA1' '0300'.
    Please advise.
    Note : This error is pertaining to only this vendor.
    Regards,
    Sakthy

    HI,
    vendor adress is stored with key "adress number" in table ADRC. Whatever the reason is, the adress number 6951 assigned to this particular vendor does not exist in table ADRC.
    Best regards, Christian

  • Cycle desktop pictures doesn't loop

    Hi,
    For my desktop picture, I have a photo album in iPhoto of all my favourite travel photos. I set the System Preferences to change them every minute, in random order. My problem is that I only have about 60 of them, and so after about an hour, it gets to the end and just stops, and stays on one picture. I would like to be able to loop it, so that it keeps changing them indefinitely, like loop on iTunes. The only way I have found to do this is to go into System Preferences when it's reached the end, and untick "Random Order',then retick it. There must be an easier way. Can anyone help me?

    Thank you for your feedback. I hope it will help many people having drive letters assignation problems.
    have a nice day.
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • Loop option set, but flash doesn't loop

    I'm loading some swf files on my website and they all use the
    same code. They include the loop=true command but some loop and
    some don't.
    Does anybody have any idea why this would happen?

    Hello, I created an advert using adobe flash to be displayed on a flat screen TV for an office . The flash movie I created for this purpose contains nested movie clips. The nested movie clips stopped as I wished - since I used the stop() command within them. However, in the main timeline, I purposely did not add the stop() command because I expect that the entire flash movie to play all over again. But the entire flash movie is not looping. In the publish settings, the loop is checked. Someone should please help - I need the entire movie to keep looping.

  • Program hangs at While loop breakpoint while stepping

    I have a breakpoint set on a While loop. I run the program and it stops at the breakpoint. I set up some probes and continue to run through the loop. After several iterations the program will not respond to further run commands.

    This sounds incredbly bizarre.
    Could you post this code for us to look at?
    I have seen one strange thing using the debugging tools and this is not it.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • How do i add money to my skype account on my iphone?

    I have Skype on my iphone - how do I add money to the account?

  • How can I get a service for new powerbook 15" 1.67 screen?

    I would like to know how I can get a service for my brand new PB15" screen. Today I have read an message on the Korean apple forum that New unit of 15" 1.67 doesn't have any line problem. So, I really want to know whether it is true or not. If it is,

  • Can you create a form that you can save to disk?

    I created a form for a client. While testing, I got a prompt that the file cannot be saved when completed. It can only be printed. What I'm trying to do is create an estimate form for my client he can fill and save. He then can email or print the for

  • AT200 Connection to Windows 7

    Hi, I recently bought AT200 from Germany. It works well except that I don't know how to connect it to PC for file exchanging. I used Acer tablet before and it worked in a wink. I tried to install all drivers, the MTP USB shows that it fails. My OS is

  • HTTP error code: 110

    Hi ALL Can any body give me details regarding  what doest this error code indiacte? " Error while receiving by HTTP error code: 110" any related document or SAP note will be helpfull? Thanks in advance Sandeep