generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Java String

Previous Thread :: Next Thread 
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
02 May 2012 09:52 PM
String fileName = "C:\Users\Ziz\AppData\Local\Roblox\plugins\javaHelloLua\plugin.lua"

Error:

Under C:\: Invalid escape sequence. This is a pathname, not an escape sequence. How do I fix this?
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
02 May 2012 10:01 PM
I've never used Java, but if it's anything like C++, you need to have double backslash (\\) for everywhere there's a backslash, because backslash is used to remove functions from all the keys (", ', and anything else that would disappear inside a string) and give functions to some (Such as \n for a new line).

String fileName = "C:\\Users\\Ziz\\AppData\\Local\\Roblox\\plugins\\javaHelloLua\\plugin.lua"
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
02 May 2012 10:16 PM
That makes it say it's an invalid tag... hang on...
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
02 May 2012 10:18 PM
You were right, forgot a semicolon. Thanks! :)
Report Abuse
Candymaniac is not online. Candymaniac
Joined: 08 Oct 2009
Total Posts: 8985
02 May 2012 10:21 PM
I never knew you could get data from your computer...

☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☜☆☞▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞ - Candymaniac, a highly reactive substance.
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
03 May 2012 07:59 AM
I don't know if you can, this is me sending data TO my computer. Tossed together a program that makes a plugin that prints "Hello Lua from Java!". Oh, but when I put it into Notepad, creating a new line (\n) doesn't work correctly. In output, it prints it with a new line, but in the plugin it doesn't. It still works, I'd just like to be able to fix that. How?
Report Abuse
GoldSheep is not online. GoldSheep
Joined: 18 Jun 2010
Total Posts: 23
03 May 2012 08:05 AM
Want to fix the new line problem? Don't use Notepad, it doesn't display new lines correctly for some reason. I suggest downloading Notepad++ instead, it is much better for programming.
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
03 May 2012 01:23 PM
My notepad++ always breaks... Besides, as a plugin it works fine anyway, it's just a problem in notepad.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
03 May 2012 02:01 PM
String s = System.getProperty("file.separator");
String fileName = "C:"+s+"Users"+s+"Ziz"+s+"AppData"+s+"Local"+s+"Roblox"+s+"plugins"+s+"javaHelloLua\plugin.lua";

String fileName = "C:\\Users\\Ziz\\AppData\\Local\\Roblox\\plugins\\javaHelloLua\\plugin.lua";
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
03 May 2012 02:02 PM
This is because '\' is an escape character. Characters AFTER it sort of format the string and do other stuff to it. Putting TWO of them indicates a single '\'
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
03 May 2012 02:02 PM
And on Unix, the file separator is a forward slash '/' therefore using System.getProperty("file.separator") is recommended
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image