NetTalk Central

Author Topic: Form from Memory  (Read 2915 times)

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Form from Memory
« on: March 01, 2012, 04:28:58 AM »
I have some global variable that i´m using to define same blogal parameters like webserver port.
this one is saved on INI file and it´s working nice.

so, i´ve created a web form to make changes in this global variable but the fields in form come with zero. this form has default action as change.

what´s wrong?

thank´s
Walter - SOFTVALE

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Form from Memory
« Reply #1 on: March 01, 2012, 05:44:37 AM »
I tried a similar setup here, and it seemed ok.
Can you tweak one of the examples to duplicate the effect and post here please?

cheers
Bruce

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Form from Memory
« Reply #2 on: March 01, 2012, 09:51:39 AM »
it´s here Bruce

Thanks

[attachment deleted by admin]
Walter - SOFTVALE

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Form from Memory
« Reply #3 on: March 01, 2012, 09:45:12 PM »
um - you're example looks fine, except you're not loading the INI value when the WebServer starts.
ie in WebServer;

  INIMgr.Fetch('WebServer','WBPorta',dg:WBPorta)

One minor issue is if the user cancels the form, then for a period the global variable has been cleared. I have tweaked the 6.24 code to avoid this problem.

(aside: changing the port number of the server itself is slightly complex because the server would need to be stopped and restarted, and of course the user would then effectivly need to enter a new url to continue. But that's a very special case and outside the scope of this question I think.)

Cheers
Bruce

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Form from Memory
« Reply #4 on: March 02, 2012, 04:03:14 AM »
Hi Bruce,

Yes, i´m reading INI from Global Embeed/Program Setup. i´m moving it to webserver.
I have other variable that i´m using as global and the main propose is make webapp free of agents. the users could be configure it all from web. that will be running as a service.

thanks
Walter - SOFTVALE

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Form from Memory
« Reply #5 on: March 02, 2012, 04:56:28 AM »
Hi Bruce,

I´ve moved INI.fetch to webserver.ini, just before webserver.open and it still opem form with blank field

cheers
Walter - SOFTVALE

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Form from Memory
« Reply #6 on: March 02, 2012, 06:05:54 AM »
pop the field on your web server procedure so you can see it's value.
then debug your ini write, and ini read and see if it's writing, and reading correctly.
Your example is working fine here.

cheers
Bruce

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Form from Memory
« Reply #7 on: March 02, 2012, 07:17:27 AM »
Hi Bruce,

reading and writing INI is OK. i´m showing the INI value on webserver and it´s ok. but form still openning with blank field.

Cheers,
Walter - SOFTVALE

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Form from Memory
« Reply #8 on: March 06, 2012, 06:46:13 AM »
Walter - SOFTVALE