python->pascal
Results 1 to 6 of 6

Thread: python->pascal

Threaded View

  1. #1
    Senior Member
    Join Date
    Jul 2003
    Posts
    166

    python->pascal

    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 ?!
    Code:
     result = ''
    What this means? And in nextDecode result is integer.
    Code:
    arg1 & 1 << i != 0
    What does this mean?
    And where is the main function of this ?! ... or it hasn't
    Last edited by Barov4e; January 13th, 2008 at 02:51 PM.
    BGDevS
    [gloworange]www.peaksoft.info [/gloworange]

Similar Threads

  1. Python 2.5 Released
    By HTRegz in forum General Computer Discussions
    Replies: 0
    Last Post: September 19th, 2006, 07:28 PM
  2. Developing a Port Scanner in Python
    By HTRegz in forum The Security Tutorials Forum
    Replies: 12
    Last Post: January 28th, 2006, 07:02 PM
  3. Python Introduction
    By HTRegz in forum Other Tutorials Forum
    Replies: 20
    Last Post: September 10th, 2005, 07:28 AM
  4. Beginning Network Programming in Python
    By PacketThirst in forum Other Tutorials Forum
    Replies: 2
    Last Post: August 14th, 2005, 07:16 PM
  5. Basic Python Tutorial for Newbies
    By [pHA]XeNoCiDe in forum AntiOnline's General Chit Chat
    Replies: 11
    Last Post: July 8th, 2002, 07:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides