[melbourne-pug] Simple syntactic error?

g sobers g.forumz at gmail.com
Fri May 23 07:49:50 CEST 2008


Problem solved.

Appreciate the assistance.

Best,
wirefree



On 5/23/08, g sobers <g.forumz at gmail.com> wrote:
>
> Addressing each of your suggestions below with resulting output:
>
> *@Kevin Littlejohn*
> *- Are you certain cb_calling is even being called? *
> Confirming the same. Checked via print statement.
>
> - *cb_calling should definitely declare state as global - and for style,
> I'd want the global declaration in keys() as well
> *Declared: global *state* in keys() as well as global *state* in cb_calling.
> To no avail.
>
> *@Tennessee Leeuwenburg*
> *- The "state" in cb_calling is not the same "state" you declare earlier.
> You'll need to declare it global inside cb_calling for it to work.*
> PyS60 documentation confirms "if a variable is defined outsite any
> function, it belongs automatically to the global scope."
>
> *@*Anthony Briggs
> *- appuifw is a framework, so your keys function will be called in a
> different 'context'. Your framework might be using state for something
> else, or is otherwise messing around with globals. Try changing
> 'state' to 'foo_state' or similar and see if that helps.
> *That is indeed correct. However, in the case of the intended
> functionality, *state* only becomes relevant when a key is pressed i.e.
> keys() is called.
>
> Which state are you suggesting being changed?*
>
> **
> - And yes, you should have 'global state' in each of your functions,
> otherwise you'll drive a local variable over the top of your global.
> *Done.
>
>
> *All of the above attempts have been unsuccessful. Quite perplexing.*
>
> Just a brief plain english understanding of the intended
> functionaity, present results and implemented code:
>
> *Canvas receives a key event and passes it to keys(). If the phone's 'yes'
> key is pressed, a note stating the event displays correctly. However, when
> the phone rings and is answered, state is assigned
> 'EStatusConnected' parameter. At this point, second of the if-statements in
> keys() should result in a note stating 'yes key is pressed & call active'.
> But, the note statement of the first if-statement continues to be displayed.
> *
>
> *NOTE*: The following code, source for this script, works perfectly.
>
> http://mindinthewater.blogspot.com/2008/01/recording-phone-calls-on-s60-phone-part.html
>
> Look forward to your suggestion.
>
> Best,
> wirefree
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/melbourne-pug/attachments/20080523/a2dd77a4/attachment.htm>


More information about the melbourne-pug mailing list