#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    27
    Rep Power
    0

    Question Basic Error -Need Help?????


    Hi 2 all,

    when i run it it gives me following error:

    "NameError: name 'process' is not defined."

    Can anybody look at it and tell me what is problem?

    Thanks.


    My scriptcode is indented)

    import DataFile

    inpd1 = DataFile.ReadDataFile()

    out1pd = process(inpd1) #local function

    def process(inpd):
    outstream = mix( inpd.stream1 )

    outpd = processdata()

    outpd.stream1 = outstream
    outpd.massflow = outstream.massflow
    outpd.pressure = outstream.pressure
    outpd.temperature = outstream.temperature
    outpd.components = outstream.components
    outpd.volume_flow = outstream.massflow / inpd.density_of_material

    return outpd

    DataFile.CreateDataFile(out1pd)

    DevHims
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    Next time, post your code within [code] and [/code] tags to indent it correctly. As to your specific bug, move the code for def process: above the line where you call process()
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    27
    Rep Power
    0

    Thumbs up


    Thanks man. It is working now. Next time i will make sure code it indented.

    DevHims

IMN logo majestic logo threadwatch logo seochat tools logo