Sep-28-2018, 06:41 PM
Think of a function as a calculator. You give it some info, it gives you some response. If you give it "4+3", it will ALWAYS give you "7" as a response. It won't look up what 7 currently means, and sometimes return "8", it'll always give you the same response for a given argument.
It's getting hard for you to track down errors, because your functions aren't black boxes. They either don't take arguments, or use those arguments to get a part of an external whole.
Let's take FindFnum() for example:
From these snippets, it looks like you're not really using functions at all. It looks like you're using a dict to hold some value, and then doing something with it, using functions as a sort of nickname to parts of the dict.
It's getting hard for you to track down errors, because your functions aren't black boxes. They either don't take arguments, or use those arguments to get a part of an external whole.
Let's take FindFnum() for example:
def FindFnum(): CustomerSaleID = CustomerSaleOBJID() Fnum = str(CustomerIndex[CustomerSaleID][3]) return FnumWhat's a
CustomerIndex
? What does CustomerSaleOBJID
return when you don't pass it anything? Ideally, CustomerSaleOBJID
would return every single customer sales record you have, for every single customer you've ever done business with, because you didn't narrow it down at all. But it doesn't. It returns whatever the magic number InxLoc
is, from whatever the mysterious LoadedSales
is.From these snippets, it looks like you're not really using functions at all. It looks like you're using a dict to hold some value, and then doing something with it, using functions as a sort of nickname to parts of the dict.