TCL 8.0 vs TCL 7.4 
Author Message
 TCL 8.0 vs TCL 7.4

Hi,
   I am having problems with this C code which is structured as a CGI.
It works with TCL 7.4 it prints from both the C code and the printing
with the code Test.tcl which is also shown below ..
When I compile this code with Tcl 8.0 and run it as a CGI, it only prints
the text from the printf in the C code and not the puts from within
Test.tcl ..
Both display the same output when I run the CGI from the Unix command line
ie compiled with TCl 7.4 and Tcl 8.0 it displays it correctly
Any ideas what I may be doing wrong ??

#include <stdlib.h>
#include <stdio.h>
#include <tcl.h>

Tcl_Interp *interp;
Tcl_Interp *interp_err;
int         code, exitcode = 0;

main()
  {
  char   ErrorMessage[256]={'\0'};
  Tcl_DString value;
  extern    Tcl_Interp *interp;
  extern    Tcl_Interp *interp_err;
  extern    int         code, exitcode;
  int i;
  interp = Tcl_CreateInterp();
  printf("Content-type: text/html\n\n");
  printf("Test\n");
  Tcl_SetVar(interp, "cur_collection","This is a test", TCL_LEAVE_ERR_MSG);
  Tcl_DStringInit(&value);
  for (i=0; i<10; i++)
 Tcl_DStringAppendElement(&value,"a");

  Tcl_SetVar(interp, "description",value.string,TCL_LEAVE_ERR_MSG);
  Tcl_DStringFree(&value);
  code = Tcl_EvalFile(interp, "Test.tcl");

    if (code != TCL_OK) {
      fprintf(stderr, "%s\n", interp->result);
      exitcode = 1;
    }
printf("TCL scripting is done \n");

Quote:
}

Test.tcl
_________

set listLength [llength $description]
for {set i 0} {$i < $listLength } {incr i} {
  puts "<BR>        [lindex $description $i]"

Quote:
}

puts "<BR>"
puts "<H1>$cur_collection</H1>"


Sat, 22 Apr 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. TCL C API 7.4 -> 8.0 problems

2. Tcl 7.4 to Tcl 8.4 porting issues

3. BENCHMARKS: Tcl 7.4 -> Tcl 8.4a1

4. Change from TCL/TK(7.4,4.0) to TCL/TK(7.5,4.1)

5. mSQL tcl extension compatible with tcl > 7.4

6. regsub in tcl 7.3 and tcl 7.4

7. C interface changes between Tcl 7.4 and Tcl 7.5

8. Tknt40r1 (Tcl 7.4, Tk 4.0, Tcl-DP 3.3, Itcl 1.5, BLT 1.8, Tix 4.0)

9. ANNOUNCE: Tknt40r1beta2 (Tcl 7.4/Tk 4.0/Tcl-DP 3.2) for NT

10. safe-tcl / Tcl 7.4 / Tk 4.0

11. Tcl 8.4.3 Vs Tcl 8.0

12. TCL 7.4 serial port

 

 
Powered by phpBB® Forum Software