Quantcast Bug Report: % Symbol - WoWInterface
 
Thread Tools Display Modes
12-05-07, 01:28 PM   #1
Cosmic Cleric
A Deviate Faerie Dragon
 
Cosmic Cleric's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 15
Exclamation Bug Report: % Symbol

Hello. Using the latest version of WoW UI Designer. Found a problem with how it parses LUA code.

Specifically, I have this piece of code...

Code:
slot  = ( aUnitNumber - 1 ) % 5 + 1;
The "%" symbol is generating an "unexpected symbol" error in the Messages section, and the line on the left side of the editor window that shows the start to end of a function, stops at the line.

Don't know why, but WOW UI Designer doesn't like to see a "%" character in LUA code, which is as far as I know, a valid math symbol in LUA (http://www.lua.org/manual/5.1/manual.html#2.5.1 ).
  Reply With Quote
12-06-07, 09:26 AM   #2
Taffu
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 149
Try using:

Code:
mod(value, modulus)
to complete your equation
  Reply With Quote
12-06-07, 05:20 PM   #3
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
It was probably built with 5.0, which is what WoW started out with. % used to be the upvalue operator, and in 5.0 it didn't exist at all. In 5.1, it became the modulus operator.

Look for a lua/luac.exe in the program folder and see if you can't update it to 5.1.

If all else fails, math.mod() is a valid solution.
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/
  Reply With Quote
12-06-07, 06:47 PM   #4
Taffu
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 149
I tested around with it a bit and it's not just WoWUI Builder. Scite throws the same error when compiling
  Reply With Quote
12-07-07, 01:19 AM   #5
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
Originally Posted by Taffu
I tested around with it a bit and it's not just WoWUI Builder. Scite throws the same error when compiling
Again, SciTE was built with Lua 5.0. In 5.0, % was not the modulus operator. Before 5.0, it was the upvalue operator. Only in 5.1 is it the modulus operator. Use one of the two options I supplied above.
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/
  Reply With Quote
12-07-07, 01:48 PM   #6
Cosmic Cleric
A Deviate Faerie Dragon
 
Cosmic Cleric's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 15
Originally Posted by Shirik
It was probably built with 5.0, which is what WoW started out with. % used to be the upvalue operator, and in 5.0 it didn't exist at all. In 5.1, it became the modulus operator.

Look for a lua/luac.exe in the program folder and see if you can't update it to 5.1.

If all else fails, math.mod() is a valid solution.
I ended up going with the math.mod() section when I first discovered the problem. I haven't tried replacing the lua/luac.exe files(s).

Does anyone know if this add-on still being ACTIVELY developed?
  Reply With Quote
12-09-07, 03:28 AM   #7
Nulkris
A Cobalt Mageweaver
 
Nulkris's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 214
I will update with this fix when I have completed some other work and made sure that I can upload executables with the current crack down.

Nulk
__________________
Nulkris - A80 Rogue - Proudmoore
(Also Drukris, Hamkris on Proudmoore; Hulkris on Jubei'Thos & Khaz Modan)
  Reply With Quote
12-09-07, 04:58 AM   #8
Polarina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 63
Originally Posted by Nulkris
I will update with this fix when I have completed some other work and made sure that I can upload executables with the current crack down.

Nulk
You are not allowed to upload EXE files anymore. Not even within a ZIP file!
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Bug Report: % Symbol

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off