Case gives 100 errors, please help

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: May 2008
Posts: 7
Reputation: Relegant is an unknown quantity at this point 
Solved Threads: 0
Relegant Relegant is offline Offline
Newbie Poster

Case gives 100 errors, please help

 
0
  #1
May 13th, 2008
This case,

  1. case 18302:
  2. if (playerLevel[19] <= 1) {
  3. guard();
  4. addSkillXP(19, 50);
  5. isNpc = true;
  6. updateRequired = true;
  7. appearanceUpdateRequired = true;
  8. else if (playerLevel[19] >= 1) {
  9. sendMessage("You need a shapeshifting level of 1 to do this.");
  10. }
  11. break;

I made it by myself, and it gives 100 errors,
what could be wrong with it?


The code means,
  1. if player level 19 (19 = shapeshifting) equals 1 or higher, itll turn your character into a guard and will add Experience to skill 19 (Shapeshifting), 50 experience.
  2. But if the level is 0 or lower, it will send a message saying
  3. You need a shapeshifting level of 1 to do this.

Please help, thanks.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,837
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 503
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: Case gives 100 errors, please help

 
0
  #2
May 13th, 2008
Originally Posted by Relegant View Post
This case,

  1. case 18302:
  2. if (playerLevel[19] <= 1) {
  3. guard();
  4. addSkillXP(19, 50);
  5. isNpc = true;
  6. updateRequired = true;
  7. appearanceUpdateRequired = true;
  8. else if (playerLevel[19] >= 1) {
  9. sendMessage("You need a shapeshifting level of 1 to do this.");
  10. }
  11. break;

I made it by myself, and it gives 100 errors,
what could be wrong with it?


The code means,
  1. if player level 19 (19 = shapeshifting) equals 1 or higher, itll turn your character into a guard and will add Experience to skill 19 (Shapeshifting), 50 experience.
  2. But if the level is 0 or lower, it will send a message saying
  3. You need a shapeshifting level of 1 to do this.

Please help, thanks.
Hard to say without seeing the rest of the code and the error messages. Don't assume that there are actually 100 errors. It could be a few errors or even one error compounding itself and the printout shows 100 errors when there really aren't. A single missed semicolon somewhere, a missing, extra, or misplaced bracket, a misspelling, etc., can result in 100 errors. I don't see any syntax errors in this code. You could be referring to a variable that doesn't exist or a function that doesn't exist or whatever. Impossible to say from what you have posted. Read the error messages carefully to give you a clue of what the problem is, fix the first error, compile again, fix the next, compile again, etc. It's very unlikely that you really have that many errors stemming from this code.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 7
Reputation: Relegant is an unknown quantity at this point 
Solved Threads: 0
Relegant Relegant is offline Offline
Newbie Poster

Re: Case gives 100 errors, please help

 
0
  #3
May 13th, 2008
Well it is true, i think. When i delete this case i do not get 100 errors, it says.
Last edited by Relegant; May 13th, 2008 at 10:12 pm.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,837
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 503
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: Case gives 100 errors, please help

 
0
  #4
May 13th, 2008
Originally Posted by Relegant View Post
Well it is true, i think. When i delete this case i do not get 100 errors, it says.
My point is that often you only have to correct one thing to make 100 errors go away. You may not have to correct 100 things. This is just speculation, however. It's impossible to give you advice on how to correct the errors unless you post the specific error messages and you post more code.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 7
Reputation: Relegant is an unknown quantity at this point 
Solved Threads: 0
Relegant Relegant is offline Offline
Newbie Poster

Re: Case gives 100 errors, please help

 
0
  #5
May 15th, 2008
Errors.

  1. private int somejunk;
  2. ^
  3. client.java:22963: illegal start of expression
  4. public int EssenceMineX[] = {2893,2921,2911,2926,2899};
  5. ^
  6. client.java:22964: illegal start of expression
  7. public int EssenceMineY[] = {4846,4846,4832,4817,4817};
  8. ^
  9. client.java:22972: illegal start of expression
  10. public int EssenceMineRX[] = {3253,3105,2681,2591};
  11. ^
  12. client.java:22973: illegal start of expression
  13. public int EssenceMineRY[] = {3401,9571,3325,3086};
  14. ^
  15. client.java:22981: illegal start of expression
  16. public boolean stairs(int stairs, int teleX, int teleY) {
  17. ^
  18. client.java:22981: ';' expected
  19. public boolean stairs(int stairs, int teleX, int teleY) {
  20. ^
  21. client.java:22981: <identifier> expected
  22. public boolean stairs(int stairs, int teleX, int teleY) {
  23. ^
  24. client.java:22981: not a statement
  25. public boolean stairs(int stairs, int teleX, int teleY) {
  26. ^
  27. client.java:22981: ';' expected
  28. public boolean stairs(int stairs, int teleX, int teleY) {
  29. ^
  30. client.java:22981: ';' expected
  31. public boolean stairs(int stairs, int teleX, int teleY) {
  32. ^
  33. client.java:23071: illegal start of expression
  34. public boolean resetStairs() {
  35. ^
  36. client.java:23071: ';' expected
  37. public boolean resetStairs() {
  38. ^
  39. client.java:23080: illegal start of expression
  40. public boolean crackCracker() {
  41. ^
  42. client.java:23080: ';' expected
  43. public boolean crackCracker() {
  44. ^
  45. client.java:23095: illegal start of expression
  46. public boolean IsInWilderness(int coordX, int coordY, int Type) {
  47. ^
  48. client.java:23095: ';' expected
  49. public boolean IsInWilderness(int coordX, int coordY, int Type) {
  50. ^
  51. client.java:23095: <identifier> expected
  52. public boolean IsInWilderness(int coordX, int coordY, int Type) {
  53. ^
  54. client.java:23095: not a statement
  55. public boolean IsInWilderness(int coordX, int coordY, int Type) {
  56. ^
  57. client.java:23095: ';' expected
  58. public boolean IsInWilderness(int coordX, int coordY, int Type) {
  59. ^
  60. client.java:23095: ';' expected
  61. public boolean IsInWilderness(int coordX, int coordY, int Type) {
  62. ^
  63. client.java:23109: illegal start of expression
  64. public int[] twoHanderz = {7158,1319,6528,14915};
  65. ^
  66. client.java:23110: illegal start of expression
  67. public boolean is2Hander()
  68. ^
  69. client.java:23110: ';' expected
  70. public boolean is2Hander()
  71. ^
  72. client.java:23118: illegal start of expression
  73. public void robpaladin()
  74. ^
  75. client.java:23118: illegal start of expression
  76. public void robpaladin()
  77. ^
  78. client.java:23118: ';' expected
  79. public void robpaladin()
  80. ^
  81. client.java:23131: illegal start of expression
  82. public void robhero()
  83. ^
  84. client.java:23131: illegal start of expression
  85. public void robhero()
  86. ^
  87. client.java:23131: ';' expected
  88. public void robhero()
  89. ^
  90. client.java:23144: illegal start of expression
  91. public void robwarrior()
  92. ^
  93. client.java:23144: illegal start of expression
  94. public void robwarrior()
  95. ^
  96. client.java:23144: ';' expected
  97. public void robwarrior()
  98. ^
  99. client.java:23158: illegal start of expression
  100. public boolean Attack() {
  101. ^
  102. client.java:23158: ';' expected
  103. public boolean Attack() {
  104. ^
  105. client.java:23552: illegal start of expression
  106. public boolean ResetAttack() {
  107. ^
  108. client.java:23552: ';' expected
  109. public boolean ResetAttack() {
  110. ^
  111. client.java:23560: illegal start of expression
  112. public int lnew = 0;
  113. ^
  114. client.java:23561: illegal start of expression
  115. public int otherpkps = 0;
  116. ^
  117. client.java:23562: illegal start of expression
  118. public int otherkillc = 0;
  119. ^
  120. client.java:23564: illegal start of expression
  121. private void appendSetFocusDestination(stream str) {
  122. ^
  123. client.java:23564: illegal start of expression
  124. private void appendSetFocusDestination(stream str) {
  125. ^
  126. client.java:23564: ';' expected
  127. private void appendSetFocusDestination(stream str) {
  128. ^
  129. client.java:23564: ';' expected
  130. private void appendSetFocusDestination(stream str) {
  131. ^
  132. client.java:23568: illegal start of expression
  133. public void PKz() {
  134. ^
  135. client.java:23568: illegal start of expression
  136. public void PKz() {
  137. ^
  138. client.java:23568: ';' expected
  139. public void PKz() {
  140. ^
  141. client.java:23604: illegal start of expression
  142. public void CheckDrop() {
  143. ^
  144. client.java:23604: illegal start of expression
  145. public void CheckDrop() {
  146. ^
  147. client.java:23604: ';' expected
  148. public void CheckDrop() {
  149. ^
  150. client.java:23661: illegal start of expression
  151. public boolean ApplyDead() {
  152. ^
  153. client.java:23661: ';' expected
  154. public boolean ApplyDead() {
  155. ^
  156. client.java:23710: illegal start of expression
  157. public boolean ApplyDeadz() {
  158. ^
  159. client.java:23710: ';' expected
  160. public boolean ApplyDeadz() {
  161. ^
  162. client.java:23754: illegal start of expression
  163. public int keepItem = 0;
  164. ^
  165. client.java:23755: illegal start of expression
  166. public int keepItem2 = 0;
  167. ^
  168. client.java:23756: illegal start of expression
  169. public int keepItem3 = 0;
  170. ^
  171. client.java:23757: illegal start of expression
  172. public int keepItemAmount = 0;
  173. ^
  174. client.java:23758: illegal start of expression
  175. public int keepItemAmount2 = 0;
  176. ^
  177. client.java:23759: illegal start of expression
  178. public int keepItemAmount3 = 0;
  179. ^
  180. client.java:23761: illegal start of expression
  181. public void setSkillLevel(int skillNum, int currentLevel, int XP) {
  182. ^
  183. client.java:23761: illegal start of expression
  184. public void setSkillLevel(int skillNum, int currentLevel, int XP) {
  185. ^
  186. client.java:23761: ';' expected
  187. public void setSkillLevel(int skillNum, int currentLevel, int XP) {
  188. ^
  189. client.java:23761: <identifier> expected
  190. public void setSkillLevel(int skillNum, int currentLevel, int XP) {
  191. ^
  192. client.java:23761: not a statement
  193. public void setSkillLevel(int skillNum, int currentLevel, int XP) {
  194. ^
  195. client.java:23761: ';' expected
  196. public void setSkillLevel(int skillNum, int currentLevel, int XP) {
  197. ^
  198. client.java:23761: ';' expected
  199. public void setSkillLevel(int skillNum, int currentLevel, int XP) {
  200. ^
  201. client.java:23853: illegal start of expression
  202. public void resetKeepItem() {
  203. ^
  204. client.java:23853: illegal start of expression
  205. public void resetKeepItem() {
  206. ^
  207. client.java:23853: ';' expected
  208. public void resetKeepItem() {
  209. ^
  210. client.java:23862: illegal start of expression
  211. public void keepItem1() {
  212. ^
  213. client.java:23862: illegal start of expression
  214. public void keepItem1() {
  215. ^
  216. client.java:23862: ';' expected
  217. public void keepItem1() {
  218. ^
  219. client.java:23874: illegal start of expression
  220. public void keepItem2() {
  221. ^
  222. client.java:23874: illegal start of expression
  223. public void keepItem2() {
  224. ^
  225. client.java:23874: ';' expected
  226. public void keepItem2() {
  227. ^
  228. client.java:23886: illegal start of expression
  229. public void keepItem3() {
  230. ^
  231. client.java:23886: illegal start of expression
  232. public void keepItem3() {
  233. ^
  234. client.java:23886: ';' expected
  235. public void keepItem3() {
  236. ^
  237. client.java:23929: illegal start of expression
  238. public boolean ApplyRingOfLife() {
  239. ^
  240. client.java:23929: ';' expected
  241. public boolean ApplyRingOfLife() {
  242. ^
  243. client.java:23949: illegal start of expression
  244. public boolean ApplyRingz() {
  245. ^
  246. client.java:23949: ';' expected
  247. public boolean ApplyRingz() {
  248. ^
  249. client.java:23968: illegal start of expression
  250. public boolean CheckForSkillUse() { //Use Item On Item
  251. ^
  252. client.java:23968: ';' expected
  253. public boolean CheckForSkillUse() { //Use Item On Item
  254. ^
  255. client.java:23994: illegal start of expression
  256. public boolean CheckForSkillUse2(int ItemID, int ItemSlot) { //Use Item
  257. On Object
  258. ^
  259. client.java:23994: ';' expected
  260. public boolean CheckForSkillUse2(int ItemID, int ItemSlot) { //Use Item
  261. On Object
  262. ^
  263. client.java:23994: <identifier> expected
  264. public boolean CheckForSkillUse2(int ItemID, int ItemSlot) { //Use Item
  265. On Object
  266. ^
  267. client.java:23994: not a statement
  268. public boolean CheckForSkillUse2(int ItemID, int ItemSlot) { //Use Item
  269. On Object
  270. ^
  271. client.java:23994: ';' expected
  272. public boolean CheckForSkillUse2(int ItemID, int ItemSlot) { //Use Item
  273. On Object
  274. ^
  275. client.java:24380: illegal start of expression
  276. public boolean CheckForSkillUse3(int Item, int Slot) {
  277. ^
  278. client.java:24380: ';' expected
  279. public boolean CheckForSkillUse3(int Item, int Slot) {
  280. ^
  281. client.java:24380: <identifier> expected
  282. public boolean CheckForSkillUse3(int Item, int Slot) {
  283. ^
  284. client.java:24380: not a statement
  285. public boolean CheckForSkillUse3(int Item, int Slot) {
  286. ^
  287. client.java:24380: ';' expected
  288. public boolean CheckForSkillUse3(int Item, int Slot) {
  289. ^
  290. client.java:24844: illegal start of expression
  291. public boolean CheckForSkillUse4(int Item) {
  292. ^
  293. client.java:24844: ';' expected
  294. public boolean CheckForSkillUse4(int Item) {
  295. ^
  296. client.java:24844: ';' expected
  297. public boolean CheckForSkillUse4(int Item) {
  298. ^
  299. 100 errors
  300. Press any key to continue . . .
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,837
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 503
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: Case gives 100 errors, please help

 
0
  #6
May 15th, 2008
Originally Posted by Relegant View Post
Errors.

  1. private int somejunk;
  2. ^
  3. client.java:22963: illegal start of expression
  4. public int EssenceMineX[] = {2893,2921,2911,2926,2899};
  5. ^
  6. client.java:22964: illegal start of expression
  7. public int EssenceMineY[] = {4846,4846,4832,4817,4817};
  8. ^
  9. client.java:22972: illegal start of expression
  10. public int EssenceMineRX[] = {3253,3105,2681,2591};
  11. ^
  12.  
  13.  
  14. .... etc. ...
  15.  
  16.  
  17. ^
  18. 100 errors
  19. Press any key to continue . . .

These are all scoping issues. Your real error is not at these lines. When you get those types of errors, you almost inevitably are missing a bracket or have an extra one. The compiler thinks these are commands, not function headers, etc. Your problem is here:
  1. case 18302:
  2. if (playerLevel[19] <= 1)
  3. {
  4. guard();
  5. addSkillXP(19, 50);
  6. isNpc = true;
  7. updateRequired = true;
  8. appearanceUpdateRequired = true;
  9. else if (playerLevel[19] >= 1)
  10. {
  11. sendMessage("You need a shapeshifting level of 1 to do this.");
  12. }
  13.  
  14. break;
You are missing a closing bracket for your if statement. Everything else probably stems from that. Add a bracket before "break" on line 13. Indentation will help you catch those bracket errors since missing brackets will stand out much better when you indent.
Last edited by VernonDozier; May 15th, 2008 at 6:04 pm. Reason: fixed typo
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 7
Reputation: Relegant is an unknown quantity at this point 
Solved Threads: 0
Relegant Relegant is offline Offline
Newbie Poster

Re: Case gives 100 errors, please help

 
0
  #7
May 15th, 2008
Thank you soo much!
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,837
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 503
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: Case gives 100 errors, please help

 
0
  #8
May 15th, 2008
Originally Posted by Relegant View Post
Thank you soo much!
You're welcome. However, I gave you partially bad advice and I screwed up on my own indentation. You are missing a bracket, but the missing it in a different place that I thought. Originally, I suggested this:
  1. case 18302:
  2. if (playerLevel[19] <= 1)
  3. {
  4. guard();
  5. addSkillXP(19, 50);
  6. isNpc = true;
  7. updateRequired = true;
  8. appearanceUpdateRequired = true;
  9. else if (playerLevel[19] >= 1)
  10. {
  11. sendMessage("You need a shapeshifting level of 1 to do this.");
  12. }
  13. // put closing bracket here
  14. break;
It now looks to me that you need a closing bracket, but you are missing it before the "else if" statement, not before the "break" statement, so this:
  1. case 18302:
  2. if (playerLevel[19] <= 1)
  3. {
  4. guard();
  5. addSkillXP(19, 50);
  6. isNpc = true;
  7. updateRequired = true;
  8. appearanceUpdateRequired = true;
  9.  
  10. // missing bracket HERE
  11.  
  12.  
  13. else if (playerLevel[19] >= 1)
  14. {
  15. sendMessage("You need a shapeshifting level of 1 to do this.");
  16. }
  17. // do not need bracket here. Already have one ending the "else if" statement.
  18. break;
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC