I have 2 functions and i want to use the variable  returned by one function 
in another function, how can i achieve this?
I want to use resultsARE in *function1 *in the same way in *function2 *as 
attempted in the highlited lines.

*FUNCTION1*
def companies():
    *resultsARE=db.services(request.args(0))*
    rslts=db(db.business.services==resultsARE.id).select(db.business.ALL, 
orderby=db.business.company_name)
    services=len(rslts)
    return locals()

*FUNCTION2*
def Results():
    results=db.locations(request.args(0))
    comps=companies()
    for services in comps:
        serv=services
    rslts=db(db.business.place==results.id).select
*(db.business.services==resultsARE.id)*
    services=len(rslts)
    return locals()
Mostwanted

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to