This site requires JavaScript, please enable it in your browser!
Greenfoot back
Upupzealot
Upupzealot wrote ...

2011/10/31

New in Greenfoot, can Greenfoot_Promgrams read datas from a file?

Upupzealot Upupzealot

2011/10/31

#
As title. If so, will the file included when I Export the hole Program? I want make a RPG game, and I also want know, can Greenfoot do something with SQL, Thanks.
Upupzealot Upupzealot

2011/11/2

#
OK,I,v tryed in my program, the answer is NO. It runs well when I'm editing it, but after I exported it ,it can't run anymore. I,ve tryed to read some srtings from an TXT file,and here comes some of the code path = System.getProperty("user.dir"); try { fis = new FileInputStream(path + "/doc/Data.txt"); try { read = new InputStreamReader (fis, "UTF-8"); B_Reader = new BufferedReader(read); } catch(UnsupportedEncodingException e) { e.printStackTrace(); } catch(IOException e) { e.printStackTrace(); } } catch(FileNotFoundException e) { e.printStackTrace(); }
Upupzealot Upupzealot

2011/11/2

#
I think the problem is I didn't find the right way to export maybe it there's some other work need to be done before I export the Program
Upupzealot Upupzealot

2011/11/2

#
If somebody could help me,thanks
danpost danpost

2011/11/2

#
I think that the discussion On creating and saving files (http://www.greenfoot.org/topics/195) will answer your question.
Upupzealot Upupzealot

2011/11/2

#
danpost wrote...
I think that the discussion On creating and saving files (http://www.greenfoot.org/topics/195) will answer your question.
Thanks for the response. But what if I want to shar it with my friend in JAR form or a web page? Can I have my own files packed in?
Upupzealot Upupzealot

2011/11/6

#
danpost wrote...
I think that the discussion On creating and saving files (http://www.greenfoot.org/topics/195) will answer your question.
I tried and it works, thanks
You need to login to post a reply.