• Cache 5.0 rourine save and compile

    From Valeriu Gontia@21:1/5 to All on Wed Mar 10 22:56:35 2021
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program?
    The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10)
    s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From OldMster@21:1/5 to gont...@gmail.com on Thu Mar 11 07:14:53 2021
    On Thursday, March 11, 2021 at 1:56:36 AM UTC-5, gont...@gmail.com wrote:
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program?
    The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10)
    s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.
    Might be helpful if you posted the error you are getting.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valeriu Gontia@21:1/5 to All on Thu Mar 11 09:09:45 2021
    четверг, 11 марта 2021 г. в 17:14:54 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:56:36 AM UTC-5, gont...@gmail.com wrote:
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program?
    The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10)
    s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.
    Might be helpful if you posted the error you are getting.

    I transfer the text of the routine to the Cache server (ver 5.0) using AJAX.

    //**** Save and Compile Routine
    function f_compile() {
    var str = routine_name.value;
    var strc = str.substring(0, 1); // "^" extract simbol
    if (~strc.indexOf("^")) {
    document.getElementById("myTextarea").value = "";
    alert("Attention, does not apply to Global !!!");
    return;
    }
    if (zd.value == '') {
    alert('The $ZDirectory must not be empty !!! This should be the path to the database folder. Click and select the area in the left menu !!!');
    return;
    }
    var mumps_string = 'CO ' + routine_name.value + "{~}" + zd.value + "{~}" + editorUI.mirror.getValue();
    var ret = AJAX("PUT", "/cache/do/" , mumps_string, null).responseText;
    document.getElementById("myTextarea").value = ret;
    }

    If it's smaller (I'm guessing in the 8kb limit) it gets written and compiled successfully and I get a message in the browser about it. (Compilation result: 1 ^, SAVED, COMPILED,) When the text is larger, I get not an error, but this message (502 Bad
    Gateway).
    In Cache's native studio, this size of routine is recorded and compiled - everything works fine.
    I got the impression that there is a limit on the size of the transmitted string.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valeriu Gontia@21:1/5 to All on Thu Mar 11 09:06:31 2021
    четверг, 11 марта 2021 г. в 17:14:54 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:56:36 AM UTC-5, gont...@gmail.com wrote:
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program?
    The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10)
    s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.
    Might be helpful if you posted the error you are getting.


    I transfer the text of the routine to the Kasha server (ver 5.0) using AJAX.

    //**** Save and Compile Routine
    function f_compile() {
    var str = routine_name.value;
    var strc = str.substring(0, 1); // "^" extract simbol
    if (~strc.indexOf("^")) {
    document.getElementById("myTextarea").value = "";
    alert("Attention, does not apply to Global !!!");
    return;
    }
    if (zd.value == '') {
    alert('The $ZDirectory must not be empty !!! This should be the path to the database folder. Click and select the area in the left menu !!!');
    return;
    }
    var mumps_string = 'CO ' + routine_name.value + "{~}" + zd.value + "{~}" + editorUI.mirror.getValue();
    var ret = AJAX("PUT", "/cache/do/" , mumps_string, null).responseText;
    document.getElementById("myTextarea").value = ret;
    }

    If it's smaller (I'm guessing in the 8kb limit) it gets written and compiled successfully and I get a message in the browser about it. (Compilation result: 1 ^, SAVED, COMPILED,) When the text is larger, I get not an error, but this message (502 Bad
    Gateway).
    In Kashe's native studio, this size of routine is recorded and compiled - everything works fine.
    I got the impression that there is a limit on the size of the transmitted string.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valeriu Gontia@21:1/5 to All on Thu Mar 11 10:12:16 2021
    четверг, 11 марта 2021 г. в 19:22:29 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 12:09:46 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 17:14:54 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:56:36 AM UTC-5, gont...@gmail.com wrote:
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program?
    The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10)
    s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.
    Might be helpful if you posted the error you are getting.
    I transfer the text of the routine to the Cache server (ver 5.0) using AJAX.

    //**** Save and Compile Routine
    function f_compile() {
    var str = routine_name.value;
    var strc = str.substring(0, 1); // "^" extract simbol
    if (~strc.indexOf("^")) {
    document.getElementById("myTextarea").value = "";
    alert("Attention, does not apply to Global !!!");
    return;
    }
    if (zd.value == '') {
    alert('The $ZDirectory must not be empty !!! This should be the path to the database folder. Click and select the area in the left menu !!!');
    return;
    }
    var mumps_string = 'CO ' + routine_name.value + "{~}" + zd.value + "{~}" + editorUI.mirror.getValue();
    var ret = AJAX("PUT", "/cache/do/" , mumps_string, null).responseText; document.getElementById("myTextarea").value = ret;
    }

    If it's smaller (I'm guessing in the 8kb limit) it gets written and compiled successfully and I get a message in the browser about it. (Compilation result: 1 ^, SAVED, COMPILED,) When the text is larger, I get not an error, but this message (502 Bad
    Gateway).
    In Cache's native studio, this size of routine is recorded and compiled - everything works fine.
    I got the impression that there is a limit on the size of the transmitted string.
    Your problem isn't in %R, but in the AJAX mechanism you are using to transfer the routine. Are you using Weblink, CSP, or something else?

    I'm trying FCGI for now. https://github.com/informatik-aalen/FastCGI-for-GT.M I've tried writing without ^R%
    I am writing in a simple global. The same result. Part of the code is written. Can't figure out where I am doing wrong ...

    RtnSaveAS(head)
    s $ztrap="error"
    k ^gonUTILITY
    s rtname=$p(head,"{~}",1),nms=$p(head,"{~}",2),code=$p(head,"{~}",3)
    zn nms
    f j=1:1 s routine=$p(code,$c(10),j) Q:routine="" d
    . s ^gonUTILITY(j)=routine
    q
    ;;
    In YottaDB and GT.M everything works fine. It turns out that Ajax has nothing to do with it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From OldMster@21:1/5 to gont...@gmail.com on Thu Mar 11 09:22:28 2021
    On Thursday, March 11, 2021 at 12:09:46 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 17:14:54 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:56:36 AM UTC-5, gont...@gmail.com wrote:
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program?
    The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10)
    s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.
    Might be helpful if you posted the error you are getting.
    I transfer the text of the routine to the Cache server (ver 5.0) using AJAX.

    //**** Save and Compile Routine
    function f_compile() {
    var str = routine_name.value;
    var strc = str.substring(0, 1); // "^" extract simbol
    if (~strc.indexOf("^")) {
    document.getElementById("myTextarea").value = "";
    alert("Attention, does not apply to Global !!!");
    return;
    }
    if (zd.value == '') {
    alert('The $ZDirectory must not be empty !!! This should be the path to the database folder. Click and select the area in the left menu !!!');
    return;
    }
    var mumps_string = 'CO ' + routine_name.value + "{~}" + zd.value + "{~}" + editorUI.mirror.getValue();
    var ret = AJAX("PUT", "/cache/do/" , mumps_string, null).responseText; document.getElementById("myTextarea").value = ret;
    }

    If it's smaller (I'm guessing in the 8kb limit) it gets written and compiled successfully and I get a message in the browser about it. (Compilation result: 1 ^, SAVED, COMPILED,) When the text is larger, I get not an error, but this message (502 Bad
    Gateway).
    In Cache's native studio, this size of routine is recorded and compiled - everything works fine.
    I got the impression that there is a limit on the size of the transmitted string.

    Your problem isn't in %R, but in the AJAX mechanism you are using to transfer the routine. Are you using Weblink, CSP, or something else?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From OldMster@21:1/5 to gont...@gmail.com on Thu Mar 11 10:39:54 2021
    On Thursday, March 11, 2021 at 1:12:17 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 19:22:29 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 12:09:46 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 17:14:54 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:56:36 AM UTC-5, gont...@gmail.com wrote:
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program?
    The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10)
    s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.
    Might be helpful if you posted the error you are getting.
    I transfer the text of the routine to the Cache server (ver 5.0) using AJAX.

    //**** Save and Compile Routine
    function f_compile() {
    var str = routine_name.value;
    var strc = str.substring(0, 1); // "^" extract simbol
    if (~strc.indexOf("^")) {
    document.getElementById("myTextarea").value = "";
    alert("Attention, does not apply to Global !!!");
    return;
    }
    if (zd.value == '') {
    alert('The $ZDirectory must not be empty !!! This should be the path to the database folder. Click and select the area in the left menu !!!');
    return;
    }
    var mumps_string = 'CO ' + routine_name.value + "{~}" + zd.value + "{~}" + editorUI.mirror.getValue();
    var ret = AJAX("PUT", "/cache/do/" , mumps_string, null).responseText; document.getElementById("myTextarea").value = ret;
    }

    If it's smaller (I'm guessing in the 8kb limit) it gets written and compiled successfully and I get a message in the browser about it. (Compilation result: 1 ^, SAVED, COMPILED,) When the text is larger, I get not an error, but this message (502
    Bad Gateway).
    In Cache's native studio, this size of routine is recorded and compiled - everything works fine.
    I got the impression that there is a limit on the size of the transmitted string.
    Your problem isn't in %R, but in the AJAX mechanism you are using to transfer the routine. Are you using Weblink, CSP, or something else?
    I'm trying FCGI for now. https://github.com/informatik-aalen/FastCGI-for-GT.M
    I've tried writing without ^R%
    I am writing in a simple global. The same result. Part of the code is written. Can't figure out where I am doing wrong ...

    RtnSaveAS(head)
    s $ztrap="error"
    k ^gonUTILITY
    s rtname=$p(head,"{~}",1),nms=$p(head,"{~}",2),code=$p(head,"{~}",3)
    zn nms
    f j=1:1 s routine=$p(code,$c(10),j) Q:routine="" d
    . s ^gonUTILITY(j)=routine
    q
    ;;
    In YottaDB and GT.M everything works fine. It turns out that Ajax has nothing to do with it.

    I'm not familiar with FCGI, but it appears it was written for GT.M (and by extension YottaDB). What operating system are you running Cache 5 on? Does FCGI use a web server, or is it direct? I make extensive use of REST API's to both YottaDB and Cache,
    and the web server configuration is usually where my problem is.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valeriu Gontia@21:1/5 to All on Thu Mar 11 12:01:04 2021
    четверг, 11 марта 2021 г. в 20:39:56 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:12:17 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 19:22:29 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 12:09:46 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 17:14:54 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:56:36 AM UTC-5, gont...@gmail.com wrote:
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program? The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10) s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.
    Might be helpful if you posted the error you are getting.
    I transfer the text of the routine to the Cache server (ver 5.0) using AJAX.

    //**** Save and Compile Routine
    function f_compile() {
    var str = routine_name.value;
    var strc = str.substring(0, 1); // "^" extract simbol
    if (~strc.indexOf("^")) {
    document.getElementById("myTextarea").value = "";
    alert("Attention, does not apply to Global !!!");
    return;
    }
    if (zd.value == '') {
    alert('The $ZDirectory must not be empty !!! This should be the path to the database folder. Click and select the area in the left menu !!!');
    return;
    }
    var mumps_string = 'CO ' + routine_name.value + "{~}" + zd.value + "{~}" + editorUI.mirror.getValue();
    var ret = AJAX("PUT", "/cache/do/" , mumps_string, null).responseText; document.getElementById("myTextarea").value = ret;
    }

    If it's smaller (I'm guessing in the 8kb limit) it gets written and compiled successfully and I get a message in the browser about it. (Compilation result: 1 ^, SAVED, COMPILED,) When the text is larger, I get not an error, but this message (502
    Bad Gateway).
    In Cache's native studio, this size of routine is recorded and compiled - everything works fine.
    I got the impression that there is a limit on the size of the transmitted string.
    Your problem isn't in %R, but in the AJAX mechanism you are using to transfer the routine. Are you using Weblink, CSP, or something else?
    I'm trying FCGI for now. https://github.com/informatik-aalen/FastCGI-for-GT.M
    I've tried writing without ^R%
    I am writing in a simple global. The same result. Part of the code is written. Can't figure out where I am doing wrong ...

    RtnSaveAS(head)
    s $ztrap="error"
    k ^gonUTILITY
    s rtname=$p(head,"{~}",1),nms=$p(head,"{~}",2),code=$p(head,"{~}",3)
    zn nms
    f j=1:1 s routine=$p(code,$c(10),j) Q:routine="" d
    . s ^gonUTILITY(j)=routine
    q
    ;;
    In YottaDB and GT.M everything works fine. It turns out that Ajax has nothing to do with it.
    I'm not familiar with FCGI, but it appears it was written for GT.M (and by extension YottaDB). What operating system are you running Cache 5 on? Does FCGI use a web server, or is it direct? I make extensive use of REST API's to both YottaDB and Cache,
    and the web server configuration is usually where my problem is.


    I use Cache 5.0 in linux CentOS 7. FCGI a use a Nginx - web server. I can't use newer versions of Cache now, but I'll try to see how it behaves on newer versions. I tried it on Cache 2015 and it all works fine. I can assume that this is due to Csche 5.0
    but what exactly I can not say

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valeriu Gontia@21:1/5 to All on Thu Mar 11 11:41:59 2021
    четверг, 11 марта 2021 г. в 20:39:56 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:12:17 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 19:22:29 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 12:09:46 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 17:14:54 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:56:36 AM UTC-5, gont...@gmail.com wrote:
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program? The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10) s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.
    Might be helpful if you posted the error you are getting.
    I transfer the text of the routine to the Cache server (ver 5.0) using AJAX.

    //**** Save and Compile Routine
    function f_compile() {
    var str = routine_name.value;
    var strc = str.substring(0, 1); // "^" extract simbol
    if (~strc.indexOf("^")) {
    document.getElementById("myTextarea").value = "";
    alert("Attention, does not apply to Global !!!");
    return;
    }
    if (zd.value == '') {
    alert('The $ZDirectory must not be empty !!! This should be the path to the database folder. Click and select the area in the left menu !!!');
    return;
    }
    var mumps_string = 'CO ' + routine_name.value + "{~}" + zd.value + "{~}" + editorUI.mirror.getValue();
    var ret = AJAX("PUT", "/cache/do/" , mumps_string, null).responseText; document.getElementById("myTextarea").value = ret;
    }

    If it's smaller (I'm guessing in the 8kb limit) it gets written and compiled successfully and I get a message in the browser about it. (Compilation result: 1 ^, SAVED, COMPILED,) When the text is larger, I get not an error, but this message (502
    Bad Gateway).
    In Cache's native studio, this size of routine is recorded and compiled - everything works fine.
    I got the impression that there is a limit on the size of the transmitted string.
    Your problem isn't in %R, but in the AJAX mechanism you are using to transfer the routine. Are you using Weblink, CSP, or something else?
    I'm trying FCGI for now. https://github.com/informatik-aalen/FastCGI-for-GT.M
    I've tried writing without ^R%
    I am writing in a simple global. The same result. Part of the code is written. Can't figure out where I am doing wrong ...

    RtnSaveAS(head)
    s $ztrap="error"
    k ^gonUTILITY
    s rtname=$p(head,"{~}",1),nms=$p(head,"{~}",2),code=$p(head,"{~}",3)
    zn nms
    f j=1:1 s routine=$p(code,$c(10),j) Q:routine="" d
    . s ^gonUTILITY(j)=routine
    q
    ;;
    In YottaDB and GT.M everything works fine. It turns out that Ajax has nothing to do with it.
    I'm not familiar with FCGI, but it appears it was written for GT.M (and by extension YottaDB). What operating system are you running Cache 5 on? Does FCGI use a web server, or is it direct? I make extensive use of REST API's to both YottaDB and Cache,
    and the web server configuration is usually where my problem is.


    I use Cache 5.0 in linux CentOS 7. FCGI a use a Nginx - web server. I can't use newer versions of Cache now, but I'll try to see how it behaves on newer versions.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From OldMster@21:1/5 to gont...@gmail.com on Thu Mar 11 14:05:23 2021
    On Thursday, March 11, 2021 at 3:01:05 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 20:39:56 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:12:17 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 19:22:29 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 12:09:46 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 17:14:54 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:56:36 AM UTC-5, gont...@gmail.com wrote:
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program? The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10)
    s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.
    Might be helpful if you posted the error you are getting.
    I transfer the text of the routine to the Cache server (ver 5.0) using AJAX.

    //**** Save and Compile Routine
    function f_compile() {
    var str = routine_name.value;
    var strc = str.substring(0, 1); // "^" extract simbol
    if (~strc.indexOf("^")) { document.getElementById("myTextarea").value = "";
    alert("Attention, does not apply to Global !!!");
    return;
    }
    if (zd.value == '') {
    alert('The $ZDirectory must not be empty !!! This should be the path to the database folder. Click and select the area in the left menu !!!');
    return;
    }
    var mumps_string = 'CO ' + routine_name.value + "{~}" + zd.value + "{~}" + editorUI.mirror.getValue();
    var ret = AJAX("PUT", "/cache/do/" , mumps_string, null).responseText;
    document.getElementById("myTextarea").value = ret;
    }

    If it's smaller (I'm guessing in the 8kb limit) it gets written and compiled successfully and I get a message in the browser about it. (Compilation result: 1 ^, SAVED, COMPILED,) When the text is larger, I get not an error, but this message (
    502 Bad Gateway).
    In Cache's native studio, this size of routine is recorded and compiled - everything works fine.
    I got the impression that there is a limit on the size of the transmitted string.
    Your problem isn't in %R, but in the AJAX mechanism you are using to transfer the routine. Are you using Weblink, CSP, or something else?
    I'm trying FCGI for now. https://github.com/informatik-aalen/FastCGI-for-GT.M
    I've tried writing without ^R%
    I am writing in a simple global. The same result. Part of the code is written. Can't figure out where I am doing wrong ...

    RtnSaveAS(head)
    s $ztrap="error"
    k ^gonUTILITY
    s rtname=$p(head,"{~}",1),nms=$p(head,"{~}",2),code=$p(head,"{~}",3)
    zn nms
    f j=1:1 s routine=$p(code,$c(10),j) Q:routine="" d
    . s ^gonUTILITY(j)=routine
    q
    ;;
    In YottaDB and GT.M everything works fine. It turns out that Ajax has nothing to do with it.
    I'm not familiar with FCGI, but it appears it was written for GT.M (and by extension YottaDB). What operating system are you running Cache 5 on? Does FCGI use a web server, or is it direct? I make extensive use of REST API's to both YottaDB and Cache,
    and the web server configuration is usually where my problem is.
    I use Cache 5.0 in linux CentOS 7. FCGI a use a Nginx - web server. I can't use newer versions of Cache now, but I'll try to see how it behaves on newer versions. I tried it on Cache 2015 and it all works fine. I can assume that this is due to Csche 5.
    0 but what exactly I can not say

    In the configuration manager, the 'Advanced' tab, in the 'Process' section, check the $ZF String size - FCGI may use $ZF to move the data back and forth. Mine is set to 32767, but maybe yours is set smaller.

    Mark

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Valeriu Gontia@21:1/5 to All on Fri Mar 12 02:13:51 2021
    пятница, 12 марта 2021 г. в 00:05:24 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 3:01:05 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 20:39:56 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:12:17 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 19:22:29 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 12:09:46 PM UTC-5, gont...@gmail.com wrote:
    четверг, 11 марта 2021 г. в 17:14:54 UTC+2, OldMster:
    On Thursday, March 11, 2021 at 1:56:36 AM UTC-5, gont...@gmail.com wrote:
    Hello everyone !
    I am trying to use the Cache ver. 5.0 routine ^%R https://www.yumpu.com/en/document/view/36857498/using-the-cache-r-routine-intersystems-documentation
    Can you tell me how to increase the buffer of the saved program?
    The impression is that it is less than 32 kb.
    Code:
    rtnSAVE(head,code)
    s rtname=$p(head,"~",1),namespace=$p(head,"~",2)
    Znspace namespace
    s code(0)=0
    f j=1:1 s string=$p(code,$c(10),j) q:string="" d
    . s code(j)=string
    s code(0)=j-1
    s name=rtname
    s ext="INT"
    s routine=name_"."_ext
    s options="CS" ; Compile and Save
    s errors="" ; empty list
    s return = $$ROUTINE^%R(routine,.code,.errors,options)
    s errcode=$$FMTERR^%R(.errors, .code)
    i errcode'="" d
    . s %fcgi("o","stdout",i)=errcode_$c(13,10)
    e s %fcgi("o","stdout",i)="Compilation result: "_return_$c(13,10)
    s %fcgi("o","header","Content-Type")="text/plain"
    q
    ;;
    In Cache itself, (studio) saves without problems
    Doesn't want to use the code above. gives the impression
    that by default is somewhere 8-16 kb ...

    thank.
    Might be helpful if you posted the error you are getting.
    I transfer the text of the routine to the Cache server (ver 5.0) using AJAX.

    //**** Save and Compile Routine
    function f_compile() {
    var str = routine_name.value;
    var strc = str.substring(0, 1); // "^" extract simbol
    if (~strc.indexOf("^")) { document.getElementById("myTextarea").value = ""; alert("Attention, does not apply to Global !!!");
    return;
    }
    if (zd.value == '') {
    alert('The $ZDirectory must not be empty !!! This should be the path to the database folder. Click and select the area in the left menu !!!');
    return;
    }
    var mumps_string = 'CO ' + routine_name.value + "{~}" + zd.value + "{~}" + editorUI.mirror.getValue();
    var ret = AJAX("PUT", "/cache/do/" , mumps_string, null).responseText;
    document.getElementById("myTextarea").value = ret;
    }

    If it's smaller (I'm guessing in the 8kb limit) it gets written and compiled successfully and I get a message in the browser about it. (Compilation result: 1 ^, SAVED, COMPILED,) When the text is larger, I get not an error, but this message (
    502 Bad Gateway).
    In Cache's native studio, this size of routine is recorded and compiled - everything works fine.
    I got the impression that there is a limit on the size of the transmitted string.
    Your problem isn't in %R, but in the AJAX mechanism you are using to transfer the routine. Are you using Weblink, CSP, or something else?
    I'm trying FCGI for now. https://github.com/informatik-aalen/FastCGI-for-GT.M
    I've tried writing without ^R%
    I am writing in a simple global. The same result. Part of the code is written. Can't figure out where I am doing wrong ...

    RtnSaveAS(head)
    s $ztrap="error"
    k ^gonUTILITY
    s rtname=$p(head,"{~}",1),nms=$p(head,"{~}",2),code=$p(head,"{~}",3) zn nms
    f j=1:1 s routine=$p(code,$c(10),j) Q:routine="" d
    . s ^gonUTILITY(j)=routine
    q
    ;;
    In YottaDB and GT.M everything works fine. It turns out that Ajax has nothing to do with it.
    I'm not familiar with FCGI, but it appears it was written for GT.M (and by extension YottaDB). What operating system are you running Cache 5 on? Does FCGI use a web server, or is it direct? I make extensive use of REST API's to both YottaDB and
    Cache, and the web server configuration is usually where my problem is.
    I use Cache 5.0 in linux CentOS 7. FCGI a use a Nginx - web server. I can't use newer versions of Cache now, but I'll try to see how it behaves on newer versions. I tried it on Cache 2015 and it all works fine. I can assume that this is due to Csche
    5.0 but what exactly I can not say
    In the configuration manager, the 'Advanced' tab, in the 'Process' section, check the $ZF String size - FCGI may use $ZF to move the data back and forth. Mine is set to 32767, but maybe yours is set smaller.

    Mark


    Unfortunately, i have these settings exactly as you say.
    $ZF String (bytes) = 32767.
    I even increased $ZF Heap (bytes) =270336 mahimum
    Today i tried this situation again exactly on Cache 2015. Everything works flawlessly.
    I wanted to try this to work with an old version of Cache 5.0 in a web browser to edit and compile routines and globals.
    After all, her native studio is intended only for Windows XP
    Initially, we invented it for GT.M and YottaDB, then we thought that it would not be bad for Kashe 5.0, (probably also for MSM), but there are some nuances.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex Maslov@21:1/5 to All on Mon Mar 15 01:05:26 2021
    Valeriu,
    the source of your problem is the attempt to send the routine source as one line.
    The maximum string size in Cache 5.0 is 32K charters, while in Cache 2015 it is ~ 3M characters.
    An INT code is not explicitly limited in size, while an OBJ size has different limits in different Cache versions. I'd better not discuss it as the successful compilation of your routines in Studio proves that you aren't hitting the OBJ size limit yet.

    HTH.
    P.S. Asking such questions at https://community.intersystems.com/ usually provides quicker and better responses.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)