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
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
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
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
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
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
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