DECLARE SUB enc_dec
CREATE Form AS QFORM
CAPTION = "Form1"
Width = 335
Height = 243
Center
CREATE Button1 AS QBUTTON
CAPTION = "Encode / Decode"
Left = 82
Top = 170
Width = 147
onclick = enc_dec
END CREATE
CREATE RichEdit1 AS QRICHEDIT
Left = 19
Top = 12
Width = 265
Height = 137
TabOrder = 1
plaintext = 1
END CREATE
END CREATE
Form.SHOWMODAL
SUB enc_dec
DIM x AS INTEGER
DIM newstring AS STRING
Richedit1.loadfromfile "textfile.txt"
newstring = Richedit1.text
FOR x = 1 TO LEN(newstring)
newstring = REPLACE$(newstring, (CHR$(256 - ASC(MID$(newstring, x, 1)))), x)
NEXT x
Richedit1.text = newstring
Richedit1.savetofile "textfile.txt"
END SUB
|