Ad
  • Custom User Avatar

    Avoid global variables. They add state between function calls that you may have not anticipated. Your function works on your machine likely because you are only testing one call per program; in that respect, your function is correct. However, this global state interferes with all other calls beyond that first one. Restructure your code to not use global variables (recommended) or make sure you reset all global state on each call.