home *** CD-ROM | disk | FTP | other *** search
- : > filter Alt-input and national characters to Ascii
- :ASCII
- C = D2C(ARG(1));
- if INSERTMODE() then 'macro USEASCII text #'C; else 'text' C;
- : > change characters after "#" according to Ascii table and execute argument
- :USEASCII
- A = ARG(1); P = POS( '#' , A ); 'editv getf ASCII.0';
- M = SUBSTR( A , 1 , P-1 ); T = SUBSTR( A , P+1 ); I = 0;
- if ASCII.0 \= '' then
- do
- S = 1; V = '';
- do U = 1 to LENGTH( T );
- K = SUBSTR( T , U , 1 ); if K <<= '' then iterate;
- if \ I then
- do
- I = 1; $C = 'macro LOCATECURS' CURSOR.3() FIELD.3() FILEID.1();
- 'cursor cmdline'; 'point .WINDLINE';
- 'kedit' ASCII.0 '(profile HIDDEN'; ASCII.0 = FILEID.1();
- end
- 'move 1 :0'; 'top';
- 'nomsg find' K; if RC = 0 then K = SUBSTR( CURLINE.3() , 3 );
- V = V || SUBSTR( T , S , U-S ) || K; S = U+1;
- end
- T = V || SUBSTR( T , S );
- end
- if I then
- do; 'set alt' ALT.1() '0'; $C; 'editv putf ASCII.0'; end
- M || T;
-