Hi guys,
I have a problem converting a very simple software from python to pascal. I haven't use python before and that is the reason I can't understand some codes. I am attaching the source. But here is what I can't understand:
Code:
def nextDecode(arg1):
global index
result = 0
for i in range(arg1):
rc = shouldDecodeStep(index)
if (rc == -1):
break
else:
if rc:
result = result | 1 << i
index += 1
return result - (1 << arg1 - 1)
First, which is the body of "for" loop? And what does this:
Code:
result = result | 1 << i
Code:
try:
val1 = textbuffer[lindex / 7]
val2 = lindex % 7
return (val1 >> val2 & 1 == 1)
except Exception, e:
return -1
I suppose this is try/except in pascal ?!
What this means? And in nextDecode result is integer.
What does this mean?
And where is the main function of this ?! ... or it hasn't