[Date Prev][Date Next][Subject Prev][Subject Next][Date Index][Subject Index]

HOY



Here's a new U2 item that I wrote for a member of the Nota Bene
list. It's a variant of the TODAY command (to "hardcode" today's
date) that puts the month in Spanish. It works just like TODAY:
HOY uses the default date format, or HOY[datemask]
uses whatever format you specify, for example,
HOY d mmmm yyyy.

There's a wrinkle if you want to put the date idiomatically, as in
"el 4 de setiembre de 2009". It would be nice if you could command
HOY el d de mmmm de yyyy, but it doesn't quite work,
because Editor interprets the "d" in "de" as a date mask, so you get
"el 4 4e setiembre 4e 2009". Too bad. Still, you can command
HOY el d mmmm yyyy and insert the "de"'s manually, or
figure out some other workaround.

Here's the new routine (encoded two ways, XYENCode and XPLencode).
To add it to U2, decode it, DeFine the entire block of code, and
command ADD2U2. The included frame ALPHAMASK* is an old
routine that has been rewritten -- streamlined and debugged. HOY
uses it, as well as frame TRANSLATE, which should already be in U2.

'%--_XYENCode_start--
{{5hoy}}_TODAY_command_en_espa~241ol_[CLD_rev.9/4/09]'^
~B
~<1~>
	~~>
~
~+"~>"~>
~~>
~
~
~
~)~="M"~>
	~
	~
	~+~~>
	~~>
	~
~
~<1~>
	~~>
~
~+"~>"~>
~~>
~+"m~>"~>
~~>
'JM2.translate'Q2
~+"&"+~~>
'JM2.alphamask/nv'Q2
~
~+~+~~>'GT~~B'^
'^
{{5alphamask*}}_Rewrite_string_to_conform_to_alpha_mask
_[CLD_v2_rev.9/3/09]'^
~B',*',_Usage'._
~
'JM2.alphamask/nv'Q2'^
~>0~>
	~~="&"~>
		~~>
		~
		~
		~
		~~>
		'JM2.@lwr'Q2		
		~~>
		~
		~
		~
		~>0~>
			~
			~
			~~>
			~
			~
			~>0'|~>0~>
				~+~~>
				~
			~
			~
			~
			~~>
			~<1&~==@upr(~)~>
				~)~>
			~
			~+~~>
			~
		~
		~<0~>
			~
		~~
	~
~~B'^
'^
'%--_XYENCode___end--

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5hoy}} TODAY command en espa{241}ol [CLD rev.9/4/09][cr|lf]
{002}
{<}IF{<}VA|50{>}<1{>}
{<}SX50,{<}VA$DZ{>}{>}
{<}EI{>}
{<}SX21,"{<}VA$DA"+{<}IS50{>}+"{>}"{>}
{<}SX21,{<}PV21{>}{>}
{<}SV22,m{>}
{<}SV23,{>}
{<}LBa{>}
{<}IF@upr({<}IS50{>}){240}"M"{>}
{<}SV24,{>}
{<}XS50,22,25,26,24{>}
{<}SX23,{<}IS23{>}+{<}IS26{>}{>}
{<}SX50,{<}IS24{>}{>}
{<}GLa{>}
{<}EI{>}
{<}IF{<}VA|23{>}<1{>}
{<}SX23,{<}IS50{>}{>}
{<}EI{>}
{<}SX22,"{<}VA$DA"+{<}IS23{>}+"{>}"{>}
{<}SX22,{<}PV22{>}{>}
{<}SX50,"{<}VA$DA"+{<}IS23{>}+"m{>}"{>}
{<}SX50,{<}PV50{>}{>}
[JM_]2.translate[Q2_]
{<}SX50,{<}IS22{>}+"&"+{<}IS50{>}{>}
[JM_]2.alphamask/nv[Q2_]
{<}XS21,22,24,25,23{>}
{<}SX50,{<}IS24{>}+{<}IS50{>}+{<}IS23{>}{>}[GT_]{<}GT50{>}{002}
[cr|lf]
[cr|lf]
{{;5alphamask*}} Rewrite string to conform to alpha mask [CLD
v2{032}
rev.9/3/09][cr|lf]
{002}
;*; Usage:{032}
{<}SV50,mask&string{>}
[JM_]2.alphamask/nv[Q2_]
[cr|lf]
{<}IF{<}VA|50{>}>0{>}
{<}IF{<}IS50{>}{240}"&"{>}
{<}SX51,{<}VA$FR{>}{>}
{<}SV52,&{>}
{<}SV53,{027}S{>}
{<}XS50,52,54,55,55{>}
{<}SX50,{<}IS55{>}{>}
[JM_]2.@lwr[Q2_]
{<}SX55,{<}IS50{>}{>}
{<}SV52,{027}X{>}
{<}SV50,{>}
{<}LBa{>}
{<}IF{<}VA|54{>}>0{>}
{<}SV56,{>}
{<}XS54,52,57,57,56{>}
{<}SX54,{<}IS56{>}{>}
{<}SV56,{>}
{<}XS57,53,58,56,58{>}
{<}IF{<}VA|56{>}>0!{<}VA{021}57{>}>0{>}
{<}SX50,{<}IS50{>}+{<}IS57{>}{>}
{<}GLa{>}
{<}EI{>}
{<}SV56,{>}
{<}XS55,52,58,58,56{>}
{<}SX55,{<}IS56{>}{>}
{<}IF{<}VA{021}57{>}<1&{<}IS57{>}==@upr({<}IS57{>}){>}
{<}SX58,@upr({<}IS58{>}){>}
{<}EI{>}
{<}SX50,{<}IS50{>}+{<}IS58{>}{>}
{<}GLa{>}
{<}EI{>}
{<}IF"/"{238}{<}IS51{>}<0{>}
{<}PR@50{>}
{<}EI{>}{<}EX{>}
{<}EI{>}
{<}EI{>}{002}
[cr|lf]
[cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx