[naviserver-devel] Naviserver keep variables after connection closed?

2020-03-12 Thread D.Fox
Hiya, I've been messing about with a small database based off a page of the tcler's wiki. https://blog.tcl.tk/1598 However I am running in to issues that an array variable are not being kept and are lost when the connection closes. If I run the following proc via command line (tclsh) it wor

Re: [naviserver-devel] Naviserver keep variables after connection closed?

2020-03-12 Thread Zoran Vasiljevic
Use nsv_xxx set of commands Am 12. März 2020 22:07:26 MEZ schrieb "D.Fox" : >Hiya, > >I've been messing about with a small database based off a page of the >tcler's wiki. >https://blog.tcl.tk/1598 > >However I am running in to issues that an array variable are not being >kept and are lost when

Re: [naviserver-devel] Naviserver keep variables after connection closed?

2020-03-12 Thread D.Fox
Thanks, I updated the server as I was getting core dumps. I am assuming nsv_set and would I need to create the array blank first? Each ID is a new array holding information, incremented by the last ID. I get this error otherwise: -code 1 -level 0 -errorstack {INNER {invokeStk1 nsv_set db(1,Owner

Re: [naviserver-devel] Naviserver keep variables after connection closed?

2020-03-12 Thread Zoran Vasiljevic
It is: nsv_set arrayname element ?value? Please consult doc pages about nsv commands. Am 12. März 2020 22:48:03 MEZ schrieb "D.Fox" : >Thanks, I updated the server as I was getting core dumps. I am assuming >nsv_set and would I need to create the array blank first? >Each ID is a new array holding

Re: [naviserver-devel] Naviserver keep variables after connection closed?

2020-03-12 Thread D.Fox
Yes. I have been reviewing the manual, but it's still not working for me. It's still not holding persistence nor am I having any luck. Which is why I am posting here. set dbRecord [getFormValue dbRecord] nsv_set id $dbRecord nsv_set db ($id,Owner) "$petOwner" nsv_set db ($id,Name) "$petName" pu

Re: [naviserver-devel] Naviserver keep variables after connection closed?

2020-03-12 Thread Zoran Vasiljevic
puts outputs the data into the servers log since stdout and stderr are redirested to logfile . It does not work as in Tcl shell where stdout is connected to your terminal. nsv_set db $id $owner is the right syntax The db is your name of the array, the $id is the key and $owner is the value. Am

Re: [naviserver-devel] Naviserver keep variables after connection closed?

2020-03-12 Thread D.Fox
Thank you very much for the explanation. Not sure where it was going wrong, I think it was the { } like in the pure TCL, but now works. Thank you for your assistance. The final code: set petOwner [getFormValue petOwner] ;#nsget Form set petName [getFormValue petName] set dbToken [getFormValue