Results 1 to 7 of 7
  1. #1
    kronus980's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Long Beach, California
    Posts
    44
    Reputation
    10
    Thanks
    1
    My Mood
    Aggressive

    [Help] Help with arrays

    Okay. I don't usually ask for too much help, but whenever it comes to arrays, I always have too look back at some sort of reference. What would be the best practice to get arrays down for sure? Any help would be appreciated, thanks.






    [IMG]https://i931.photobucke*****m/albums/ad158/kronus980/bg_logo.png[/IMG]



  2. #2
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    What aspect of arrays? Just the syntax for creating them? Or the related member functions they have in java (wait, I am thinking of java, right?)

    If you are just trying to get the syntax down then really the only way to do it is through repetition. Do it often enough then it will become ingrained into your mind.

    Just try to write an unnecessarily long program that has lots of arrays. Or maybe until you are used to them, instead of creating normal variables, always create arrays with 1 element (because even though it is pointless it will surely give you a lot of practice)

  3. #3
    kronus980's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Long Beach, California
    Posts
    44
    Reputation
    10
    Thanks
    1
    My Mood
    Aggressive
    Like.. I know there's a way to get a file name, and it requires using arrays.. and a loop, but yeah. Basically the utilization of arrays is what I need help with. Cause I know how to use them, but I find them some what useless. So just need a way to use them for practice.






    [IMG]https://i931.photobucke*****m/albums/ad158/kronus980/bg_logo.png[/IMG]



  4. #4
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Array's are very important and very easy in Java. As for getting a file name. Im sure there's some class for listing files in a directory. I don't use Java much anymore so I can't remember off the top of my head, but when in doubt check the Java API.

    EDIT: Followed my own advice...
    Quote Originally Posted by Java API
    listFiles

    public File[] listFiles(FileFilter filter)

    Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter. The behavior of this method is the same as that of the listFiles() method, except that the pathnames in the returned array must satisfy the filter. If the given filter is null then all pathnames are accepted. Otherwise, a pathname satisfies the filter if and only if the value true results when the FileFilter.accept(java.io.File) method of the filter is invoked on the pathname.

    Parameters:
    filter - A file filter
    Returns:
    An array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname. The array will be empty if the directory is empty. Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.
    Throws:
    SecurityException - If a security manager exists and its SecurityManager.checkRead(java.lang.String) method denies read access to the directory
    Last edited by why06; 06-16-2010 at 10:23 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  5. #5
    kronus980's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Long Beach, California
    Posts
    44
    Reputation
    10
    Thanks
    1
    My Mood
    Aggressive
    That sorta helps. Thanks guys. And gratz on the game hacking team thingy! :O!






    [IMG]https://i931.photobucke*****m/albums/ad158/kronus980/bg_logo.png[/IMG]



  6. #6
    ^...,^'s Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    New Zealand,Auckland
    Posts
    698
    Reputation
    4
    Thanks
    90
    My Mood
    Lonely

  7. #7
    kronus980's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Long Beach, California
    Posts
    44
    Reputation
    10
    Thanks
    1
    My Mood
    Aggressive
    I hope it's a perma ban. But I think I got them down. And the way you read a line of text, and you don't put anything in the array brackets... Which is weird. You use the FileReader import and BufferedReader. Anyways, you pass down the File reader into the buffered reader. Like this:

    Code:
    FileReader fr = new FileReader();
    BufferedReader read_line = new BufferdReader(fr);
    Something might go in the FileReader. Maybe "this". I forgot. I prolly gotta check the source. But yeah. Thanks for that API ref.






    [IMG]https://i931.photobucke*****m/albums/ad158/kronus980/bg_logo.png[/IMG]



Similar Threads

  1. [Help Request] Need help with numpad while recording macro !
    By JonathanTBM in forum Vindictus Help
    Replies: 2
    Last Post: 05-10-2011, 07:37 PM
  2. [Help Request] help with ca hacks
    By moises8 in forum Combat Arms Help
    Replies: 4
    Last Post: 05-10-2011, 05:55 PM
  3. [Help Request] Anyone can help with this ?
    By devileyebg in forum Vindictus Help
    Replies: 1
    Last Post: 05-01-2011, 03:57 PM
  4. [Help Request] need help with mod
    By .:MUS1CFR34K:. in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 4
    Last Post: 05-01-2011, 12:40 PM
  5. [Help Request] need help with modding
    By BayBee Alyn in forum Combat Arms Help
    Replies: 0
    Last Post: 04-27-2011, 09:06 PM