String count with substring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sang
    New Member
    • Sep 2006
    • 83

    #31
    Originally posted by r035198x
    1.)You don't have to post all your code like this
    2.)You have put the countTimes method inside another method. This is not allowed and is the reason for the error. Pluck it out so that no method is inside another method.
    3.) When handling exceptions do not use
    Code:
     catch(Exception e) { 
    }
    This hides the exception when it occurs so you don't see it. Ideally you should want to be able to know if your code is throwing an exception.
    Yes I done your advice

    The program is Complie and run Successfully but it does not return any output
    please help to do this

    Code:
    public class KeywordCount {
     public void countKeyword() {
    		 try{
    			 String sql1 = "select JobRefNo,ifnull(Keywords,' ') from JOB_ORDER where Status<>'Expired' and ValidUpto >= sysdate()";
    			 Statement stm1 = dbConnection.createStatement();
    			 ResultSet rs1 = null;
    			 rs1 = stm1.executeQuery(sql1);			
    
    			while(rs1.next()) {
    				String sql2 = "select UserId from JOB_APPLICATION where  NoOfMatch=-1 and JobRefNo=" +rs1.getInt(1);
    				Statement stm2 = dbConnection.createStatement();
    				ResultSet rs2 = null;
    				rs2 = stm2.executeQuery(sql2);
    				while(rs2.next()) {
    			      try {
    					String sql3 = "select TxtResume from CAN_RESUME where UserId="+rs2.getInt(1);
    					Statement stm3 = dbConnection.createStatement();
    					ResultSet rs3 = null;
    					rs3 = stm3.executeQuery(sql3);
    					rs3.next();
    					String TxtResume=rs3.getString(1);
    					String Keywords=rs1.getString(2);
    					String temp[] = Keywords.split(",");
    					for(int i = 0; i < temp.length;i++) {
    					System.out.print(temp[i]+" appears : ");
    					//System.out.print(countTimes(TxtResume, temp[i]) + " times");
    					
    					}
    					} catch (Exception e) {
    					System.out.println("DB error while execute the SQL " + e);
    					}
    			}
    			rs2.close();
    				stm2.close();
    			}
    			}catch (Exception e) {
    					System.out.println("DB error while execute the SQL " + e);
    					}
    	 }			
    		public int countTimes(InputStream in ,String Keywords1){
    			DataInputStream din = new DataInputStream(in);
    			String line = null;
    			int count=0;
    					try	{
    						while((line=din.readLine()) != null){
    						String line2 = line.toLowerCase();
    						int KeywordsLength = Keywords1.length();
    						for(int i = 0; i < line2.length() - KeywordsLength; i++) {
    						if(Keywords1.equals(line2.substring(i, i + KeywordsLength))) {
    						count++;
    						System.out.println("the count is "+count);
    						}
    					}
    						}
    					return count;
    					//
    					//rs1.close();
    					//stm1.close();
    			} catch (Exception e1) {
    				System.out.println("DB error while execute the SQL " + e1);
    				return -1;
    			}
    		}
    	public static void main(String arg[]) {
    		try
    		{
    		KeywordCount key = new KeywordCount();
    		key.countKeyword();
    		//key.countTimes();
    		} catch(Exception e) {
    			System.out.println("Exception is"+e);
    		}
    	}
    }
    please help to do this

    Thankyou
    Sang

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #32
      Originally posted by sang
      Yes I done your advice

      The program is Complie and run Successfully but it does not return any output
      please help to do this

      Code:
      public class KeywordCount {
      public void countKeyword() {
      		 try{
      			 String sql1 = "select JobRefNo,ifnull(Keywords,' ') from JOB_ORDER where Status<>'Expired' and ValidUpto >= sysdate()";
      			 Statement stm1 = dbConnection.createStatement();
      			 ResultSet rs1 = null;
      			 rs1 = stm1.executeQuery(sql1);			
       
      			while(rs1.next()) {
      				String sql2 = "select UserId from JOB_APPLICATION where NoOfMatch=-1 and JobRefNo=" +rs1.getInt(1);
      				Statement stm2 = dbConnection.createStatement();
      				ResultSet rs2 = null;
      				rs2 = stm2.executeQuery(sql2);
      				while(rs2.next()) {
      			 try {
      					String sql3 = "select TxtResume from CAN_RESUME where UserId="+rs2.getInt(1);
      					Statement stm3 = dbConnection.createStatement();
      					ResultSet rs3 = null;
      					rs3 = stm3.executeQuery(sql3);
      					rs3.next();
      					String TxtResume=rs3.getString(1);
      					String Keywords=rs1.getString(2);
      					String temp[] = Keywords.split(",");
      					for(int i = 0; i < temp.length;i++) {
      					System.out.print(temp[i]+" appears : ");
      					//System.out.print(countTimes(TxtResume, temp[i]) + " times");
       
      					}
      					} catch (Exception e) {
      					System.out.println("DB error while execute the SQL " + e);
      					}
      			}
      			rs2.close();
      				stm2.close();
      			}
      			}catch (Exception e) {
      					System.out.println("DB error while execute the SQL " + e);
      					}
      	 }			
      		public int countTimes(InputStream in ,String Keywords1){
      			DataInputStream din = new DataInputStream(in);
      			String line = null;
      			int count=0;
      					try	{
      						while((line=din.readLine()) != null){
      						String line2 = line.toLowerCase();
      						int KeywordsLength = Keywords1.length();
      						for(int i = 0; i < line2.length() - KeywordsLength; i++) {
      						if(Keywords1.equals(line2.substring(i, i + KeywordsLength))) {
      						count++;
      						System.out.println("the count is "+count);
      						}
      					}
      						}
      					return count;
      					//
      					//rs1.close();
      					//stm1.close();
      			} catch (Exception e1) {
      				System.out.println("DB error while execute the SQL " + e1);
      				return -1;
      			}
      		}
      	public static void main(String arg[]) {
      		try
      		{
      		KeywordCount key = new KeywordCount();
      		key.countKeyword();
      		//key.countTimes();
      		} catch(Exception e) {
      			System.out.println("Exception is"+e);
      		}
      	}
      }
      please help to do this

      Thankyou
      Sang
      What output do you want it to give?

      Comment

      • sang
        New Member
        • Sep 2006
        • 83

        #33
        Originally posted by r035198x
        What output do you want it to give?
        The resume and keywords are taken from different table.
        The program is check whether the keywords are in the resume, if the keywords are present Count the each keywords.

        In the out put it will be return

        Keyword How many times present

        for example the keyword is java and it present 3 times

        The output is

        java ===>3 times

        Thankyou
        Sang

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #34
          Originally posted by sang
          The resume and keywords are taken from different table.
          The program is check whether the keywords are in the resume, if the keywords are present Count the each keywords.

          In the out put it will be return

          Keyword How many times present

          for example the keyword is java and it present 3 times

          The output is

          java ===>3 times

          Thankyou
          Sang
          Debug it with println statements to verify that each statement is doing what you think it is doing.

          Comment

          • sang
            New Member
            • Sep 2006
            • 83

            #35
            Originally posted by r035198x
            Debug it with println statements to verify that each statement is doing what you think it is doing.
            My problem is
            Code:
            public void countKeyword() {
            		 try{
            			 String sql1 = "select JobRefNo,ifnull(Keywords,' ') from JOB_ORDER where Status<>'Expired' and ValidUpto >= sysdate()";
            			 Statement stm1 = dbConnection.createStatement();
            			 ResultSet rs1 = null;
            			 rs1 = stm1.executeQuery(sql1);			
            
            			while(rs1.next()) {
            				String sql2 = "select UserId from JOB_APPLICATION where  NoOfMatch=-1 and JobRefNo=" +rs1.getInt(1);
            				Statement stm2 = dbConnection.createStatement();
            				ResultSet rs2 = null;
            				rs2 = stm2.executeQuery(sql2);
            				while(rs2.next()) {
            			      try {
            		
            					String sql3 = "select TxtResume from CAN_RESUME where TxtStatus=1 and UserId="+rs2.getInt(1);					Statement stm3 = dbConnection.createStatement();
            					ResultSet rs3 = null;
            					rs3 = stm3.executeQuery(sql3);
            					rs3.next();
            					String TxtResume=rs3.getString(1);
            					String Keywords=rs1.getString(2);
            					String temp[] = Keywords.split(",");
            		//			countKeyword ct = new countKeyword();
            					for(int i = 0; i < temp.length;i++) {
            					System.out.print(temp[i]+" appears : ");
            					System.out.print(countTimes(TxtResume, temp[i]) + " times");
            					}
            					} catch (Exception e) {
            					System.out.println("DB error while execute the SQL " + e);
            					}
            			}
            			rs2.close();
            				stm2.close();
            			}
            			}catch (Exception e) {
            					System.out.println("DB error while execute the SQL " + e);
            					}			
            	 }
            		public int countTimes(InputStream in ,String Keywords1){
            			DataInputStream din = new DataInputStream(in);
            			String line = null;
            			int count=0;
            					try	{
            						while((line=din.readLine()) != null){
            						String line2 = line.toLowerCase();
            						int KeywordsLength = Keywords1.length();
            						for(int i = 0; i < line2.length() - KeywordsLength; i++) {
            						if(Keywords1.equals(line2.substring(i, i + KeywordsLength))) {
            						count++;
            						//System.out.println("the count is "+count);
            						}
            					}
            						}
            					return count;
            					//
            					//rs1.close();
            					//stm1.close();
            			} catch (Exception e1) {
            				System.out.println("DB error while execute the SQL " + e1);
            				return -1;
            			}
            		}
            In this how can i call the countTimes() in the countKeyword()

            I call this using
            System.out.prin t(countTimes(Tx tResume, temp[i]) + " times");

            but erorr is occured in the above line

            D:\epc\delv\WEB-INF\classes\ic\ bo\KeywordCount .java:51: countTimes(java .io.Input
            Stream,java.lan g.String) in ic.bo.KeywordCo unt cannot be applied to (java.lang.S
            tring,java.lang .String)
            System.out.prin t(countTimes(Tx tResume, t
            emp[i]) + " times");

            please help to do this
            Thanks and regards
            Sang

            Comment

            • r035198x
              MVP
              • Sep 2006
              • 13225

              #36
              Originally posted by sang
              My problem is
              Code:
              public void countKeyword() {
              		 try{
              			 String sql1 = "select JobRefNo,ifnull(Keywords,' ') from JOB_ORDER where Status<>'Expired' and ValidUpto >= sysdate()";
              			 Statement stm1 = dbConnection.createStatement();
              			 ResultSet rs1 = null;
              			 rs1 = stm1.executeQuery(sql1);			
               
              			while(rs1.next()) {
              				String sql2 = "select UserId from JOB_APPLICATION where NoOfMatch=-1 and JobRefNo=" +rs1.getInt(1);
              				Statement stm2 = dbConnection.createStatement();
              				ResultSet rs2 = null;
              				rs2 = stm2.executeQuery(sql2);
              				while(rs2.next()) {
              			 try {
               
              					String sql3 = "select TxtResume from CAN_RESUME where TxtStatus=1 and UserId="+rs2.getInt(1);					Statement stm3 = dbConnection.createStatement();
              					ResultSet rs3 = null;
              					rs3 = stm3.executeQuery(sql3);
              					rs3.next();
              					String TxtResume=rs3.getString(1);
              					String Keywords=rs1.getString(2);
              					String temp[] = Keywords.split(",");
              		//			countKeyword ct = new countKeyword();
              					for(int i = 0; i < temp.length;i++) {
              					System.out.print(temp[i]+" appears : ");
              					System.out.print(countTimes(TxtResume, temp[i]) + " times");
              					}
              					} catch (Exception e) {
              					System.out.println("DB error while execute the SQL " + e);
              					}
              			}
              			rs2.close();
              				stm2.close();
              			}
              			}catch (Exception e) {
              					System.out.println("DB error while execute the SQL " + e);
              					}			
              	 }
              		public int countTimes(InputStream in ,String Keywords1){
              			DataInputStream din = new DataInputStream(in);
              			String line = null;
              			int count=0;
              					try	{
              						while((line=din.readLine()) != null){
              						String line2 = line.toLowerCase();
              						int KeywordsLength = Keywords1.length();
              						for(int i = 0; i < line2.length() - KeywordsLength; i++) {
              						if(Keywords1.equals(line2.substring(i, i + KeywordsLength))) {
              						count++;
              						//System.out.println("the count is "+count);
              						}
              					}
              						}
              					return count;
              					//
              					//rs1.close();
              					//stm1.close();
              			} catch (Exception e1) {
              				System.out.println("DB error while execute the SQL " + e1);
              				return -1;
              			}
              		}
              In this how can i call the countTimes() in the countKeyword()

              I call this using
              System.out.prin t(countTimes(Tx tResume, temp[i]) + " times");

              but erorr is occured in the above line

              D:\epc\delv\WEB-INF\classes\ic\ bo\KeywordCount .java:51: countTimes(java .io.Input
              Stream,java.lan g.String) in ic.bo.KeywordCo unt cannot be applied to (java.lang.S
              tring,java.lang .String)
              System.out.prin t(countTimes(Tx tResume, t
              emp[i]) + " times");

              please help to do this
              Thanks and regards
              Sang
              Your arguments are not matching the countTimes signature. Look at the countTimes method again and understand what each parameter is doing in the method.

              Comment

              • sang
                New Member
                • Sep 2006
                • 83

                #37
                Originally posted by r035198x
                Your arguments are not matching the countTimes signature. Look at the countTimes method again and understand what each parameter is doing in the method.
                Thankyou very much I solved that problem. but i have another error.
                That is DB error please see the code and give the suggesstion to solve it
                Code:
                public void countKeyword() {
                		 try{
                			 String sql1 = "select JobRefNo,ifnull(Keywords,' ') from JOB_ORDER where Status<>'Expired' and ValidUpto >= sysdate()";
                			 Statement stm1 = dbConnection.createStatement();
                			 ResultSet rs1 = null;
                			 rs1 = stm1.executeQuery(sql1);			
                
                			while(rs1.next()) {
                				String sql2 = "select UserId from JOB_APPLICATION where  NoOfMatch=-1 and JobRefNo=" +rs1.getInt(1);
                				Statement stm2 = dbConnection.createStatement();
                				ResultSet rs2 = null;
                				rs2 = stm2.executeQuery(sql2);
                				while(rs2.next()) {
                			      try {
                		
                					String sql3 = "select TxtResume from CAN_RESUME where TxtStatus=1 and UserId="+rs2.getInt(1);					Statement stm3 = dbConnection.createStatement();
                					ResultSet rs3 = null;
                					rs3 = stm3.executeQuery(sql3);
                					rs3.next();
                					String TxtResume=rs3.getString(1);
                					String Keywords=rs1.getString(2);
                					String temp[] = Keywords.split(",");
                		//			countKeyword ct = new countKeyword();
                					for(int i = 0; i < temp.length;i++) {
                					System.out.print(temp[i]+" appears : ");
                					System.out.print(countTimes(TxtResume, temp[i]) + " times");
                					System.out.println();
                					}
                					} catch (Exception e) {
                					System.out.println("DB error while execute the SQL " + e);
                					}
                			}
                			rs2.close();
                				stm2.close();
                			}
                			}catch (Exception e) {
                					System.out.println("DB error while execute the SQL " + e);
                					}			
                	 }
                		public int countTimes(String TxtResume ,String Keywords){
                			//DataInputStream din = new DataInputStream(in);
                			//String line = null;
                			int count=0;
                					try	{
                						//while((line=din.readLine()) != null){
                						//String line2 = line.toLowerCase();
                						int KeywordsLength = Keywords.length();
                						for(int i = 0; i < TxtResume.length() - KeywordsLength; i++) {
                						if(Keywords.equals(TxtResume.substring(i, i + KeywordsLength))) {
                						count++;
                						}
                					}
                						
                					return count;
                					//
                					//rs1.close();
                					//stm1.close();
                			} catch (Exception e1) {
                				System.out.println("DB error while execute the SQL " + e1);
                				return -1;
                			}
                		}
                the error is
                Code:
                Cummins appears : DB error while execute the SQL java.lang.NullPointerException
                -1 times
                Service appears : DB error while execute the SQL java.lang.NullPointerException
                -1 times
                please help to slove this error
                Thankyou
                Sang

                Comment

                • r035198x
                  MVP
                  • Sep 2006
                  • 13225

                  #38
                  Originally posted by sang
                  Thankyou very much I solved that problem. but i have another error.
                  That is DB error please see the code and give the suggesstion to solve it
                  Code:
                  public void countKeyword() {
                  		 try{
                  			 String sql1 = "select JobRefNo,ifnull(Keywords,' ') from JOB_ORDER where Status<>'Expired' and ValidUpto >= sysdate()";
                  			 Statement stm1 = dbConnection.createStatement();
                  			 ResultSet rs1 = null;
                  			 rs1 = stm1.executeQuery(sql1);			
                   
                  			while(rs1.next()) {
                  				String sql2 = "select UserId from JOB_APPLICATION where NoOfMatch=-1 and JobRefNo=" +rs1.getInt(1);
                  				Statement stm2 = dbConnection.createStatement();
                  				ResultSet rs2 = null;
                  				rs2 = stm2.executeQuery(sql2);
                  				while(rs2.next()) {
                  			 try {
                   
                  					String sql3 = "select TxtResume from CAN_RESUME where TxtStatus=1 and UserId="+rs2.getInt(1);					Statement stm3 = dbConnection.createStatement();
                  					ResultSet rs3 = null;
                  					rs3 = stm3.executeQuery(sql3);
                  					rs3.next();
                  					String TxtResume=rs3.getString(1);
                  					String Keywords=rs1.getString(2);
                  					String temp[] = Keywords.split(",");
                  		//			countKeyword ct = new countKeyword();
                  					for(int i = 0; i < temp.length;i++) {
                  					System.out.print(temp[i]+" appears : ");
                  					System.out.print(countTimes(TxtResume, temp[i]) + " times");
                  					System.out.println();
                  					}
                  					} catch (Exception e) {
                  					System.out.println("DB error while execute the SQL " + e);
                  					}
                  			}
                  			rs2.close();
                  				stm2.close();
                  			}
                  			}catch (Exception e) {
                  					System.out.println("DB error while execute the SQL " + e);
                  					}			
                  	 }
                  		public int countTimes(String TxtResume ,String Keywords){
                  			//DataInputStream din = new DataInputStream(in);
                  			//String line = null;
                  			int count=0;
                  					try	{
                  						//while((line=din.readLine()) != null){
                  						//String line2 = line.toLowerCase();
                  						int KeywordsLength = Keywords.length();
                  						for(int i = 0; i < TxtResume.length() - KeywordsLength; i++) {
                  						if(Keywords.equals(TxtResume.substring(i, i + KeywordsLength))) {
                  						count++;
                  						}
                  					}
                   
                  					return count;
                  					//
                  					//rs1.close();
                  					//stm1.close();
                  			} catch (Exception e1) {
                  				System.out.println("DB error while execute the SQL " + e1);
                  				return -1;
                  			}
                  		}
                  the error is
                  Code:
                  Cummins appears : DB error while execute the SQL java.lang.NullPointerException
                  -1 times
                  Service appears : DB error while execute the SQL java.lang.NullPointerException
                  -1 times
                  please help to slove this error
                  Thankyou
                  Sang
                  Check the line number for the exception and locate it in your code

                  Comment

                  • sang
                    New Member
                    • Sep 2006
                    • 83

                    #39
                    Originally posted by r035198x
                    Check the line number for the exception and locate it in your code
                    Thanyou for your kind help

                    I solved the problem and my program is excuted well. But the count will reduce the count by one. my keyword appears actually 3 times but in the output will be printed as 2 times appears.
                    I am trying to finish that problem if you have any suggestion please give me to solve the problem

                    I once again Say Thankyou for your timely help.

                    Thankyou VeryMuch
                    Sang

                    Comment

                    • r035198x
                      MVP
                      • Sep 2006
                      • 13225

                      #40
                      Originally posted by sang
                      Thanyou for your kind help

                      I solved the problem and my program is excuted well. But the count will reduce the count by one. my keyword appears actually 3 times but in the output will be printed as 2 times appears.
                      I am trying to finish that problem if you have any suggestion please give me to solve the problem

                      I once again Say Thankyou for your timely help.

                      Thankyou VeryMuch
                      Sang
                      Try changing your for header to

                      Code:
                       
                      for(int i = 0; i < (TxtResume.length() - KeywordsLength) + 1; i++)

                      Comment

                      • sang
                        New Member
                        • Sep 2006
                        • 83

                        #41
                        Originally posted by r035198x
                        Try changing your for header to

                        Code:
                         
                        for(int i = 0; i < (TxtResume.length() - KeywordsLength) + 1; i++)
                        I tried this one but there is no changes in my output.

                        Thankyou for your kind help,
                        Sang

                        Comment

                        • r035198x
                          MVP
                          • Sep 2006
                          • 13225

                          #42
                          Originally posted by sang
                          I tried this one but there is no changes in my output.

                          Thankyou for your kind help,
                          Sang
                          You can always solve the problem by using return count + 1; but I'd rather you check first that the output you are getting is really not what it should be.

                          Comment

                          • sang
                            New Member
                            • Sep 2006
                            • 83

                            #43
                            Originally posted by r035198x
                            You can always solve the problem by using return count + 1; but I'd rather you check first that the output you are getting is really not what it should be.
                            Thankyou very much for your help

                            Comment

                            • sang
                              New Member
                              • Sep 2006
                              • 83

                              #44
                              Originally posted by r035198x
                              Code:
                               
                              public class strcount {
                              	public static int countTimes(String sentence, String word){
                                int count = 0;
                              	int wordLength = word.length();
                              	for(int i = 0; i < sentence.length() - wordLength; i++) {
                              	 if(word.equals(sentence.substring(i, i + wordLength))) {
                                 count++;
                              	 }
                              	}
                              	return count;
                               }
                               public static void main(String arg[]) {
                                String sentence = "java,jsp,c,dhtml,unix";
                                String word = "java,html";
                                String temp[] = word.split(",");
                                for(int i = 0; i < temp.length;i++) {
                                 System.out.print(temp[i]+" appears : ");
                                 System.out.print(countTimes(sentence, temp[i]) + " times");
                                 System.out.println();
                                }
                               } 
                              
                               }
                              Notice that html is found because of dhtml. Do you want it like that?
                              Hello Sir

                              Another help to do the above program in single method.
                              In the above program the count is seperate function and it is call on the main.
                              but i want to all this on main there is no other function call.

                              I will try this one but my output is 0 please help to do this

                              Code:
                              public class strcount
                               {
                              	public static void main(String arg[]) {
                              	String resume = "java,html,jsp,c,java,dhtml,unix,html";
                              	 String word = "java,jsp,html";
                              	String temp[] = word.split(",");
                              		for(int i = 0; i < temp.length;i++) {
                              		 System.out.println(temp[i]+" appears : ");
                              		}
                              		int count = 0;
                              	int wordLength = word.length();
                              	for(int j = 0; j < resume.length() - wordLength; j++) {
                              	 if(word.equals(resume.substring(j, j + wordLength))) {
                                 count++;
                                 //System.out.print((temp[i]),count);
                              	 }
                              	}
                              	System.out.println(count);
                              	//return count;
                              	}
                               }
                              output is like this
                              Code:
                              java appears :
                              jsp appears :
                              html appears :
                              0
                              please help to solve my problem
                              Thanks and Regards
                              Sang

                              Comment

                              • r035198x
                                MVP
                                • Sep 2006
                                • 13225

                                #45
                                Originally posted by sang
                                Hello Sir

                                Another help to do the above program in single method.
                                In the above program the count is seperate function and it is call on the main.
                                but i want to all this on main there is no other function call.

                                I will try this one but my output is 0 please help to do this

                                Code:
                                public class strcount
                                 {
                                	public static void main(String arg[]) {
                                	String resume = "java,html,jsp,c,java,dhtml,unix,html";
                                	 String word = "java,jsp,html";
                                	String temp[] = word.split(",");
                                		for(int i = 0; i < temp.length;i++) {
                                		 System.out.println(temp[i]+" appears : ");
                                		}
                                		int count = 0;
                                	int wordLength = word.length();
                                	for(int j = 0; j < resume.length() - wordLength; j++) {
                                	 if(word.equals(resume.substring(j, j + wordLength))) {
                                   count++;
                                   //System.out.print((temp[i]),count);
                                	 }
                                	}
                                	System.out.println(count);
                                	//return count;
                                	}
                                 }
                                output is like this
                                Code:
                                java appears :
                                jsp appears :
                                html appears :
                                0
                                please help to solve my problem
                                Thanks and Regards
                                Sang



                                Do not change the structure of your main method, just change the part that called the function and replace that part with the function itself with slight modifications. Why don't you want to call the function?

                                Comment

                                Working...