NetTalk Central

Author Topic: passing variable form nettalk procedure to a clarion form  (Read 3617 times)

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
passing variable form nettalk procedure to a clarion form
« 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!

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: passing variable form nettalk procedure to a clarion form
« Reply #1 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: passing variable form nettalk procedure to a clarion form
« Reply #2 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

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
Re: passing variable form nettalk procedure to a clarion form
« Reply #3 on: May 20, 2011, 03:47:29 AM »
Thanks guys i have use kavins's second idea and that worked fine.