Python Forum
Global variable does not seem to be global.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Global variable does not seem to be global.
#7
I didn't quite understand your example in that I saw that you incremented recNo and then returned it. At first look I was under the impression that it was returned right after it was incremented and that the rest of the function was not being executed. Having looked at it again, I think I now see what is actually happening. The recNo is incremented and after executing the rest of the function using the new value of recNo, then it is reutrned to update the global. I went back and changed my code to yours and it is working fine.

Thank you. I really do appreciate you help and your patience.
Reply


Messages In This Thread
RE: Global variable does not seem to be global. - by Columbo - Jul-15-2019, 11:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why doesn't list require global keyword? johnywhy 9 811 Jan-15-2024, 11:47 PM
Last Post: sgrey
  It's saying my global variable is a local variable Radical 5 1,166 Oct-02-2023, 12:57 AM
Last Post: deanhystad
  Trying to understand global variables 357mag 5 1,122 May-12-2023, 04:16 PM
Last Post: deanhystad
  Why Pip is not listed in the official Global Python Module index? quazirfan 2 761 Apr-21-2023, 10:55 AM
Last Post: snippsat
  Delete all Excel named ranges (local and global scope) pfdjhfuys 2 1,789 Mar-24-2023, 01:32 PM
Last Post: pfdjhfuys
  Serial Port As Global Prasanjith 2 1,501 Mar-23-2023, 08:54 PM
Last Post: deanhystad
  global varname Skaperen 6 1,091 Mar-03-2023, 12:10 AM
Last Post: Skaperen
  Global variables or local accessible caslor 4 1,029 Jan-27-2023, 05:32 PM
Last Post: caslor
  global variables HeinKurz 3 1,150 Jan-17-2023, 06:58 PM
Last Post: HeinKurz
  How to use global value or local value sabuzaki 4 1,155 Jan-11-2023, 11:59 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020