UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 03 Feb 2012 05:44 PM |
ErrorMsg.Text:sub(1, (i - 2)).." '"..ErrorMsg.sub(i, string.len(ErrorMsg.Text))
I see nothing wrong with this. |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2012 05:49 PM |
ErrorMsg.sub
That should be
ErrorMsg:sub |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 03 Feb 2012 05:50 PM |
You have a apostrophe beside in front of the second quotation marks. I don't see any reason for it to be there.
ErrorMsg.Text:sub(1, (i - 2)).." "..ErrorMsg.sub(i, string.len(ErrorMsg.Text)) |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 03 Feb 2012 05:54 PM |
@dark I fixed that, but it still returns the error.
@Neon With, or without the apostrophe; the code returns the error. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Feb 2012 07:20 PM |
" '"
Did you close this? Because it looks like you did
" "'
Meaning you didn't close the first quote. Did you? |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|
|
| 03 Feb 2012 07:49 PM |
string.sub(ErrorMsg.Text, 1, (i-2)) .. " '" .. string.sub(ErrorMsg.Text, 1, string.len(ErrorMsg.Text))
|
|
|
| Report Abuse |
|
|
|
| 03 Feb 2012 08:07 PM |
Try this:
ErrorMsg.Text:sub(1, (i - 2)).." '"..ErrorMsg.Text:sub(i, string.len(ErrorMsg.Text)) or ErrorMsg.Text:sub(1, (i - 2)).." '"..ErrorMsg:sub(i, string.len(ErrorMsg.Text)) |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 03 Feb 2012 08:08 PM |
| You're version makes no difference; it still returns an error. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 03 Feb 2012 09:06 PM |
What is ErrorMessage? A gui text label?
[=|I rate myself 6.5/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 03 Feb 2012 09:30 PM |
Could you please post the whole loop?
[=|I rate myself 6.5/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 03 Feb 2012 09:36 PM |
for i = 1, string.len(ErrorMsg.Text) do if ErrorMsg.Text:sub(i, i):match("%d") then if not ErrorMsg.Text:sub((i - 1), (i - 1)):match("%d") then ErrorMsg.Text:sub(1, (i - 2)).." '"..ErrorMsg.Text:sub(i, string.len(ErrorMsg.Text)) elseif not ErrorMsg.Text:sub((i + 1), (i + 1)):match("%d") then ErrorMsg.Text:sub(1, i).."' "..ErrorMsg.sub((i + 2), string.len(ErrorMsg.Text)) end end elseif ErrorMsg.Text:sub(i, i) == "\\" then ErrorMsg.Text = ErrorMsg.Text:sub(1, (i - 1))..""..ErrorMsg.Text:sub(i + 1, string.len(ErrorMsg.Text)) end |
|
|
| Report Abuse |
|
|
| |
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 03 Feb 2012 10:51 PM |
Probably a separator of some sort.
[=|I rate myself 6.5/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 04 Feb 2012 07:59 AM |
| What it's supposed to do is look through a string, remove every quotation mark, and make it a apostrophe. It's also supposed to remove a backslash in the string. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 04 Feb 2012 10:38 AM |
| So, the gsub method removes certain characters from a string? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 04 Feb 2012 10:57 AM |
What if I just wanted to remove part of a string then?
`*\~-{ Are we there yet T.T? }-~/*` |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|