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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 02 May 2012 10:18 PM |
| You were right, forgot a semicolon. Thanks! :) |
|
|
| Report Abuse |
|
|
|
| 02 May 2012 10:21 PM |
I never knew you could get data from your computer...
☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☜☆☞▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞ - Candymaniac, a highly reactive substance. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|