[GiDlist] problem with bas file
Posted: Sun Feb 09, 2003 10:39 pm
Hi GiD-Team,
I am writing the template file for a problem type and I have a problem about data storing. I store some values (the user inputs them through a window which is created with a tcl procedure within the tcl file of the problem type) in global variables during the preprocess and I need to temporarily store these values in variables in the template file, so as to decide by these values which data in the configuration files I have to access to write the input file.
I tried the *tcl command of the bas file to get the values of the global variables in the tcl file, but the problem with this command is the fact that I cannot store these values but only write them directly into the input file.
Next is what I have written in the bas file:
*tcl(Belastungsart)
That corresponds to a procedure in the tcl file:
proc Belastungsart { } {
global VoreinstellungPriv
if { $VoreinstellungPriv(Belastungsart) == " schlaffe_Last " } {
return { 1 } }
if { $VoreinstellungPriv(Belastungsart) == " starre_Platte " } {
return { 2 } }
if { $VoreinstellungPriv(Belastungsart) == " elastische_Platte " } {
return { 3 } }
}
What I would need to do is to store the value I get from the tcl procedure with the *tcl command in a variable in the bas file; something like this:
*Set var belastungsart=*tcl(Belastungsart)
...
*if(belastungsart==2)
...
*endif
That does not work because the *tcl command is not an arithmetic expression. Is there a possibility to store other data in a variable in the bas file?
If not, how can I get to temporarily store some gobal variables of the tcl file in the bas file?
thaks for response,
Andreas Friedberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030209/8a0196c8/attachment.htm
I am writing the template file for a problem type and I have a problem about data storing. I store some values (the user inputs them through a window which is created with a tcl procedure within the tcl file of the problem type) in global variables during the preprocess and I need to temporarily store these values in variables in the template file, so as to decide by these values which data in the configuration files I have to access to write the input file.
I tried the *tcl command of the bas file to get the values of the global variables in the tcl file, but the problem with this command is the fact that I cannot store these values but only write them directly into the input file.
Next is what I have written in the bas file:
*tcl(Belastungsart)
That corresponds to a procedure in the tcl file:
proc Belastungsart { } {
global VoreinstellungPriv
if { $VoreinstellungPriv(Belastungsart) == " schlaffe_Last " } {
return { 1 } }
if { $VoreinstellungPriv(Belastungsart) == " starre_Platte " } {
return { 2 } }
if { $VoreinstellungPriv(Belastungsart) == " elastische_Platte " } {
return { 3 } }
}
What I would need to do is to store the value I get from the tcl procedure with the *tcl command in a variable in the bas file; something like this:
*Set var belastungsart=*tcl(Belastungsart)
...
*if(belastungsart==2)
...
*endif
That does not work because the *tcl command is not an arithmetic expression. Is there a possibility to store other data in a variable in the bas file?
If not, how can I get to temporarily store some gobal variables of the tcl file in the bas file?
thaks for response,
Andreas Friedberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030209/8a0196c8/attachment.htm