func to determine is a word is global
global?: func [ {find out, if the given Word is a Global Word} word [word!] ][ same? word bind word 'system ]
12364 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
global?: func [ {find out, if the given Word is a Global Word} word [word!] ][ same? word bind word 'system ]
alert("My world is biiiiiiiiiiiiig".wordWrap(10, "\n+", true)); alert("My world is biiiiiiiiiiiiig".wordWrap(10, "\n>", false));
//+ Jonas Raoni Soares Silva //@ http://jsfromhell.com/string/wordwrap [v1.0] String.prototype.wordWrap = function(m, b, c){ var i, j, l, s, r; if(m < 1) return this; for(i = -1, l = (r = this.split("\n")).length; ++i < l; r[i] += s) for(s = r[i], r[i] = ""; s.length > m; r[i] += s.slice(0, j) + ((s = s.slice(j)).length ? b : "")) j = c == 2 || (j = s.slice(0, m + 1).match(/\S*(\s)?$/))[1] ? m : j.input.length - j[0].length || c == 1 && m || j.input.length + (j = s.slice(m).match(/^\S*/)).input.length; return r.join("\n"); };
import pythoncom, win32com.client app = win32com.client.gencache.EnsureDispatch("Word.Application") doc = 'C:\\lang\\try\\bdham\\p1' app.Documents.Open(doc + '.doc') app.ActiveDocument.SaveAs(doc + '.html', FileFormat=win32com.client.constants.wdFormatHTML) app.ActiveDocument.Close() # now repeat with p2, p3, etc.