NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: olu on May 19, 2011, 09:23:35 AM

Title: passing variable form nettalk procedure to a clarion form
Post by: olu on May 19, 2011, 09:23:35 AM
Hi All,
    Am trying to pass a variable from nettalk form to a clarion window, unfortunately i can not use global variable because this variable will be different for each user so it has to be user specific and i can not use session variable (or can i?) inside a clarion window.


Please help anyone , someone!
Title: Re: passing variable form nettalk procedure to a clarion form
Post by: kevin plummer on May 19, 2011, 04:38:25 PM
Hi olu,

Firstly, globals are generally a no no in web apps.

But you have lots of methods available to achieve what you want.

You can just call your windows procedure inside your web app and pass it a parameter as you would in a normal windows app eg L:TotalInvoice = CalcInvoice(p_web.gsv('Inv:Number'))

Add the p_web as an optional parameter (so as not to break you windows app) and simply use your p_web variables inside your windows procedure.

Create a new table and read and write data to it based on the session id. You would still need to pass the session id to the win procedure but if you had lots of variables to pass this could be an easier way.

You could use ini and xml files in the same way as the method above.

Hope that helps,

Cheers,

Kevin
Title: Re: passing variable form nettalk procedure to a clarion form
Post by: Bruce on May 19, 2011, 09:39:35 PM
I would most likely do the second of kevins options. Add p_web as a parameter (perhaps an optional parameter) to the procedure. Then inside the procedure you can use p_web.GetSessionValue and so on.

If the whole concept of what p_web is, is confusing to you, then there's a chapter in the Nettalk book that explains it.

Cheers
Bruce
Title: Re: passing variable form nettalk procedure to a clarion form
Post by: olu on May 20, 2011, 03:47:29 AM
Thanks guys i have use kavins's second idea and that worked fine.