Category talk:OoRexx: Difference between revisions

Content added Content deleted
m (forced a TOC (table of contents).)
m (added a version of the JavaScript custom highlighting (as a choice), corrected a typo.)
Line 50: Line 50:
: How so? Which differences would those be (excluding bugs, of course). Of course, some classic REXX interpreters are much older than others and don't have some of the newer BIFs or their extensions, but those differences weren't made that way, there was an evolution while keeping capability to the older versions of REXX. REXX programs that I wrote in 1982 will will run unchanged in the CMS and TSO REXXes of 2012.
: How so? Which differences would those be (excluding bugs, of course). Of course, some classic REXX interpreters are much older than others and don't have some of the newer BIFs or their extensions, but those differences weren't made that way, there was an evolution while keeping capability to the older versions of REXX. REXX programs that I wrote in 1982 will will run unchanged in the CMS and TSO REXXes of 2012.


:: What I had in mind here particularly was permitted character sets. I am not an expert in different interpreters - I have used VM\SP on CMS, the Rexx interpreter that came with PCDos7, Kexx, Personal rexx, and for the last decade or more ooRexx (or Object rexx as it was back then) with a little Kexx thrown in. I don't remember it all, but I remember that the not symbol on sp6 was ¬, I don't now remember what was not on PC Dos7. On personal rexx it was ~ which is the message operator on ooRexx. On SP6 you had to start your code with a comment /* */ so the correct interpreter was invoked. In Kexx comments are lines starting with a * - that is a standard, but not a Rexx one.
:: What I had in mind here particularly was permitted character sets. I am not an expert in different interpreters - I have used VM/SP on CMS, the Rexx interpreter that came with PCDos7, Kexx, Personal rexx, and for the last decade or more ooRexx (or Object rexx as it was back then) with a little Kexx thrown in. I don't remember it all, but I remember that the not symbol on sp6 was ¬, I don't now remember what was not on PC Dos7. On personal rexx it was ~ which is the message operator on ooRexx. On SP6 you had to start your code with a comment /* */ so the correct interpreter was invoked. In Kexx comments are lines starting with a * - that is a standard, but not a Rexx one.


::: Yes, KEXX was a subset of REXX, a few other notable restrictions is that every clause had to be complete within one line, and that included comments. KEXX also accepted the normal REXX comments, but again, they had to be complete within one line (no multi-line comments). There were many other restrictions, most of which aren't probably germane to this discussion.
::: Yes, KEXX was a subset of REXX, a few other notable restrictions is that every clause had to be complete within one line, and that included comments. KEXX also accepted the normal REXX comments, but again, they had to be complete within one line (no multi-line comments). There were many other restrictions, most of which aren't probably germane to this discussion.
Line 303: Line 303:
add_toggle_links();
add_toggle_links();
})();</lang> which will <s>format your hard drive</s> add a link before each code block to toggle highlights. I only tested it on Firefox, though it should work with other browsers. If you want to used it and find it lacking, let me know. --[[User:Ledrug|Ledrug]] 16:08, 12 June 2012 (UTC)
})();</lang> which will <s>format your hard drive</s> add a link before each code block to toggle highlights. I only tested it on Firefox, though it should work with other browsers. If you want to used it and find it lacking, let me know. --[[User:Ledrug|Ledrug]] 16:08, 12 June 2012 (UTC)

::: Also, see my (below) version of the above custom javascript. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:38, 2 June 2017 (UTC)


Thanks. When I uncommented that one line, it did exactly what I wanted, but still allowed me to use highlighting when I want it.
Thanks. When I uncommented that one line, it did exactly what I wanted, but still allowed me to use highlighting when I want it.
Line 313: Line 315:
:: (small fix in the code above--shouldn't have caused malfunction, though) I don't know much about IE, and frankly I don't want to care. As to "installing in all your preferences", putting it in the shared custom javascript alone should be enough--or so I thought, I'm no MediaWiki expert. And, "chickenlips"? That's a midwestern euphemism for somthing? --[[User:Ledrug|Ledrug]] 03:00, 13 June 2012 (UTC)
:: (small fix in the code above--shouldn't have caused malfunction, though) I don't know much about IE, and frankly I don't want to care. As to "installing in all your preferences", putting it in the shared custom javascript alone should be enough--or so I thought, I'm no MediaWiki expert. And, "chickenlips"? That's a midwestern euphemism for somthing? --[[User:Ledrug|Ledrug]] 03:00, 13 June 2012 (UTC)


::: Oh, I'm sorry, I thought everybody knew what that is. Chickenlips are the (curly) braces: ''' { } ''' --- a somewhat perjorative and amusing term, I believe.
::: Oh, I'm sorry, I thought everybody knew what that is. Chickenlips are the (curly) braces: ''' { } ''' --- a somewhat pejorative and amusing term, I believe.
----
----
I also vote YES for syntax coloring. As I'm new to Rexx it's fairly difficult for me to read the code without syntax highlights. On the other side I guess everybody agrees that Rexx is not the most widespread and most popular language around, so there are potentially more developers out there who are actually very interested in Rexx and who would need the highlighting as much as I do. --[[User:RolandR|RolandR]] 08:10, 13 June 2012 (UTC)
I also vote YES for syntax coloring. As I'm new to Rexx it's fairly difficult for me to read the code without syntax highlights. On the other side I guess everybody agrees that Rexx is not the most widespread and most popular language around, so there are potentially more developers out there who are actually very interested in Rexx and who would need the highlighting as much as I do. --[[User:RolandR|RolandR]] 08:10, 13 June 2012 (UTC)
i also vote YES for syntax coloring; it's easier to read. --[[User:Glehm|Glehm]] 09:11, 15 June 2012 (UTC)
i also vote YES for syntax coloring; it's easier to read. --[[User:Glehm|Glehm]] 09:11, 15 June 2012 (UTC)

==custom JavaScript==
This is my version of the (above) JavaScript, the main difference is an inclusion of a solid separator (with a slightly different text) &nbsp; between computer programming languages &nbsp; (to aid in scrolling), &nbsp; and it defaults to &nbsp; ''no'' &nbsp; colorization.

I also tried to indent stuff to help me better understand the code logic and flow.
<lang Javascript>(function(){
function get_code_pres() {
var pres = document.getElementsByTagName('pre');
var codes = [];
for(var i=0;i<pres.length;i++)
if(pres[i].className.match(/\bhighlighted_source\b/)) codes.push(pres[i]);
return codes;
}

function toggle_highlight(pre) {
if(pre._alt_html == null) {
pre._alt_html = pre.innerHTML;
var spans = pre.getElementsByTagName('span');
for(var i=0;i<spans.length;i++) spans[i].className = '';
}
else {var z=pre.innerHTML;
pre.innerHTML=pre._alt_html;
pre._alt_html=z;
}
}

function add_toggle_links() {
// the bar below has 66 'db'x characters.
var xdb = '████████████████████████████████████████████████████████████████';
var bar = xdb.concat(' «toggle highlighting»');
var codes = get_code_pres();
for(var i=0;i<codes.length;i++) {
var a=document.createElement('a');
a.textContent = bar;
a.style.cursor = 'pointer';
(function(e) {a.addEventListener('click', function(){ toggle_highlight(e); }, false);
e.parentNode.insertBefore(a, e);
} ) (codes[i]);
toggle_highlight(codes[i]);
}
}

add_toggle_links();
})();</lang>

I wish the &nbsp; ''choice'' &nbsp; of colorization would be made available to all users without each user to have to enter a JavaScript program. &nbsp; The above JavaScript version assumes the choice of '''off''', &nbsp; but that's my choice. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:38, 2 June 2017 (UTC)

-- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:38, 2 June 2017 (UTC)