ASCII 2 text
jak zamienić text zakodowany w ascii na normalny tekst??
Odpowiedzi: 4
juź sobie poradzilem. potrzebowałem funkcji w AS która przekształca. juz znalazlem.
co to za język??
IMPORT
Fonts, Files, Texts, Out;
CONST
Escape = "/";
PROCEDURE AsciiToText (t: Texts.Text);
VAR
r :Texts.Reader; w: Texts.Writer; ch: CHAR; in: ARRAY 64 OF CHAR; i: LONGINT; font: Fonts.Font;
BEGIN
Texts.OpenReader (r, t, 0); Texts.OpenWriter (w);
Texts.Read (r, ch);
WHILE ~r.eot DO
IF ch = Escape THEN i := 0;
REPEAT Texts.Read (r, ch); in[i] := ch; INC (i) UNTIL (ch = Escape) OR (ch = 20X);
in[i–1] := 0X;
IF ch = Escape THEN Texts.Write (w, Escape)
ELSIF Strings.IsDigit (in[0]) THEN Strings.StrToInt (in, i); Texts.SetColor (w, SHORT(SHORT(i)))
ELSE font := Fonts.This(in); Texts.SetFont (w, font)
END
ELSE Texts.Write (w, ch)
END;
Texts.Read (r, ch)
END;
Texts.Open (t, ""); Texts.Append (t, w.buf)
END AsciiToText;
I jeszcze w JS:
var testNum = 65;
var testChar = 'A';
//number to character
alert(String.fromCharCode(testNum));
//character to number
alert(testChar.charCodeAt(0));
Pozdrawiam.
Strona 1 / 1