Declaring variables

HMS Surprise john at datavoiceint.com
Thu May 17 09:02:50 EDT 2007


On May 16, 6:48 pm, Matimus <mccre... at gmail.com> wrote:
> On May 16, 9:57 am, HMS Surprise <j... at datavoiceint.com> wrote:
>
> > I looked in the language but did not find a switch for requiring
> > variables to be declared before use.
>
> > Is such an option available?
>
> > Thanks,
>
> > jvh
>
> You do have to declare a variable before use. You do so by assigning
> it a value. You can't use a variable before it has been assigned.

Yes this is where the problem arises. This is a gross
oversimplification , but is where I typically find problems.

jh


#~~~~~~~~~~~~~~~~~~~~~~
createdIncidentId = 0
.
.
.
#attempt to change varialbe
createdIncidentID = 1
.
.
.
if createdIncidentId == 1:
   ...




More information about the Python-list mailing list