This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
LDShadowLord's profile picture

[ERROR] 'then' expected

Started by LDShadowLord, 22 December 2012 - 11:15 PM
LDShadowLord #1
Posted 23 December 2012 - 12:15 AM
Ok, I'm attempting to revive an old program I found to do what I wanted and this error keeps popping up.

Password = a.readLine()
					    YourCurrent = tonumber(a.readLine())
					    YourPay = tonumber(tWords[4])
					    a.close()
					  
					    if tWords[3] == Password and fs.exists("Accounts/" ..tWords[5]) then
							    if YourCurrent > YourPay pr YourCurrent == YourPay then                           <------- Error Line
									    test = fs.open("Accounts/" ..tWords[5], "r")
									    TheirPass = test.readLine()
									    TheirCurrency = tonumber(test.readLine())
									    test.close()
That error line is where it says I need to put a then but I have one and I have a double '=='. could anyone shed some light on the subject?
remiX #2
Posted 23 December 2012 - 12:17 AM
if YourCurrent > YourPay pr YourCurrent == YourPay then 
"pr" .. did you re-write the code or copy paste?
NDFJay #3
Posted 23 December 2012 - 12:26 AM
if YourCurrent > YourPay pr YourCurrent == YourPay then 
"pr" .. did you re-write the code or copy paste?

think he re-write it… a little typo can make a big error

solution to the problem change "pr" to "or"
LDShadowLord #4
Posted 23 December 2012 - 12:56 AM
Jeesh, im a f****ng indiot. Thanks guys. I'll go shoot myself now.
ChunLing #5
Posted 23 December 2012 - 02:21 AM
That could be more idiotic than making a typo substituting "p" for "o".

Just sayin'.
Doyle3694 #6
Posted 23 December 2012 - 03:39 AM
then if pressing you middle finger 1 cm to much to the left is idiotic, that is another question.