Global confusion

Gaetan Corneau Gaetan_Corneau at baan.com
Wed Sep 29 15:07:45 EDT 1999


> Probably, the line
>     nbPar = nbPar + 1
> is telling the python interpretor that 'nbPar' is a local variable,
> since it is being assigned.  So, when local namespace is searched,
> it's not there.

What is interesting, and that I didn't mention in my original message, is
that the error message really occurs here:

Srv.ActiveDocument.Paragraphs[nbPar].Range.InsertParagraphAfter()
     Srv.ActiveDocument.Paragraphs[nbPar].Range.Style =
Srv.ActiveDocument.Styles(style) # <---On THIS line!---
     Srv.ActiveDocument.Paragraphs[nbPar].Range.InsertAfter(text)
     nbPar = nbPar + 1
 
I *suppose* this is because of the COM parameter stuff, and that the [] ends
up in a call that is not "by value".
I know, I'm not clear :)
______________________________________________________
   Gaetan Corneau
   Software Developer (System Integration Team)
   BaaN  Supply Chain Solutions  
   E-mail: Gaetan_Corneau at baan.com        
   Compuserve: Gaetan_Corneau at compuserve.com  
   ICQ Number: 7395494             
   Tel: (418) 266-8252          
______________________________________________________
"Profanity is the one language all programmers know best"

   







More information about the Python-list mailing list