try doing something like this
[code=java]
public boolean addHouse ( House a ) {
boolean done = false;
for (int i = 0; i < collection.leng th; i++)
{
if (collection[i] == null && done == false)
{
collection[i] = a;
done = true;
// REMOVE THIS LINE return true;
...
User Profile
Collapse
-
-
-
yes. the perl script needs some user input. however, the java program doesn't provide an oppurtunity for the user to provide said input, or at least it doesn't in its present state.Leave a comment:
-
Perl in Java
HI,
I have a perl script that I want to call in java. I can call it, the only problem is that the perl script has <STDIN> and the perl sciprt doesn't work. Other perl scripts(without <STDIN>) do work however. here is my code:
...Code:import java.util.*; import java.io.*; class Rename { public static void main(String args[]) { try { Runtime r = Runtime.getRuntime(); -
Perl in Java
HI,
I have a perl script that I want to call in java. I can call it, the only problem is that the perl script has <STDIN> and the perl sciprt doesn't work. Other perl scripts(without <STDIN>) do work however. here is my code:
import java.util.*;
import java.io.*;
class Rename {
public static void main(String args[]) {
try {
Runtime r = Runtime.getRunt ime();... -
I ended up doing it like this
chdir('the dir i wanted') || die("couldn't do it");
mkdir Test;
chdir(Test) ||die("couldn't do it");
thanks for you help thoughLeave a comment:
-
ANDCode:mkdir Test; use Cwd(); $path = getcwd(); #Get the current path $path =~ s/\\/\//sg; opendir(DIR, $path) || die ("cannot open the path");
but those didn't work. they both can create a directory but they won't enter itCode:mkdir Sample; opendir(DIRHANDLE, "/Sample");
Leave a comment:
-
Open new folder and enter it
Hi, i am trying to create a new folder and then enter the new folder. I have tried to do this but have failed on all attempts. any help would be greatly appreciated. -
hi,
what I want the code to do is prompt the user for the extensions they would like to change (if they wanted to change from .mpg to .mpeg they could or from .jpg to .jpeg they could, all with the same script).Leave a comment:
-
Renaming File Extensions
i am a total n00b at perl. i just started learning yesterday. I wanted to make a script to rename extentions. this is what i've come up with. i can't figure out why it doesn't work. any help would be appreciated.
...Code:#!/usr/bin/perl print "What ending would you like to change?"; $ending = <STDIN>; chomp($ending); print "What would you like to change it to?"; $new_ending
No activity results to display
Show More
Leave a comment: