def access_global(gName,AorR,value): #By D@CC #On 2021 E May 19 #Article: 164.html selectCode 00 #uSD: unknown #Source: author # This must be defined in the pir2A.py # It doesn't need to be called from outside the pir2A.py # check if in the gAL (globalAccessList) global gAL gAL1="" gAL1=gAL1+"."+"g_targTempL0" ; global g_targTempL0 gAL1=gAL1+"."+"g_gALtest" ; global g_gALtest nCount=1 #print("in access_global,gAL:"+gAL) #print("gAL:"+gAL) #print("found:", gAL.find(".") ) #print("found:"+gName,gAL.find(gName)) if gAL.find(gName)==-1 : #print("didn't find:"+gName) print("ERROR global Name cannot be accessed:"+gName) returnValue = gName+" ERROR: is not in the globalAccessList!" else: # match/case don't work yet in Python if gName == "g_gALtest": if AorR == "Assign": g_gALtest = value else: returnValue = g_gALtest if gName =="g_targTempL0": if AorR == "Assign": g_targTempL0 = value else: returnValue = g_targTempL0 #if end if AorR=="Assign" : if isTypeStr(value): returnValue=gName+" was assigned value:"+value+":" else: returnValue=gName+" was assigned value:"+str(value)+":" #if end else: continueDoh=1 #if end #if end return returnValue #def end #/access_global.py