Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jan 11th, 2007, 1:58 PM   #1
fresher
Newbie
 
Join Date: Dec 2006
Posts: 13
Rep Power: 0 fresher is on a distinguished road
accepting user input

Hi all, i've this code below which prompts a user to select from a list of ip addresses.e.g 192.168.2.1....etc. Now i wona modify this code so that if the machine on which the program is run has a different network part (192.168.2.) then I can prompt the user to enter their network ID e.g (148.145.23.) then increment the last bit using a for loop. Anyone able to help me out pls? thanks in advance

I have added this block of code below in order to do this but it doesnt work:
System.out.print("Enter your network part or hit enter to proceed: ");
            String network = in.readString();
            
            //test
            System.out.println(network);
            
            //if enter is pressed - same network
            if (network == null)
        
            {
            
            System.out.print("SELECT A MACHINE TO VIEW FROM LIST: ");
            int choice = in.readInteger();
            }

            else
            {
                //pass new network part to ip string variable
                ip = network;
            }

nb: this code is part of my previous post on ' passing a string to a variable.....' click here to view full code:http://www.programmingforums.org/for...-variable.html
any help appreciated.
fresher is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
User input jayme C++ 38 Nov 25th, 2005 8:27 PM
FiveDigit + RandomeNumber Game. TecBrain Java 0 Nov 18th, 2005 3:53 PM
User Input for Number Format ericelysia1 Java 0 Jul 21st, 2005 4:41 PM
Problem read'ing from file and user input jmsilver Bash / Shell Scripting 3 May 20th, 2005 3:35 PM
Instant Messaging App Help AusTex C 0 Apr 27th, 2005 5:52 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC