Page 1 of 1
Txt encoding
Posted: Tue Aug 12, 2014 9:22 am
by smbstarv
I have difficulty to implement text encoding/decoding in my programs. Could anyone provide a simple example ?
Re: Txt encoding
Posted: Tue Aug 12, 2014 9:25 am
by Mr. Kibernetik
What kind of problems do you have?
Re: Txt encoding
Posted: Tue Aug 12, 2014 10:23 am
by smbstarv
I first tried to insert " option codepass" into my program, which gave a syntax error.
Then I inserted " input password$ ! option codepass password$"
This works well. I changed .txt into .cod.
But then, the coded program still bothers me with asking for a password, which is not what I want.
I want the password asked for, only when I try to change .cod into .txt.
Could you help me ? Thx.
Re: Txt encoding
Posted: Tue Aug 12, 2014 12:18 pm
by Mr. Kibernetik
Ok, you write:
where "password" is your password.
This should be done NOT IN YOUR CODED program. This should be done in a separate program - this is just a setting for your device.
And this is enough. This should be done ONLY ONCE. You will not need to do it ever again: your device will remember it.
After you set your password, you will be able to encode ANY your programs with this password.
You may ask: why you need to set a password at all?
Answer: it will be possible to decode encoded program ONLY if the device where program is decoded (tried to de decoded) is set to the same password as you set before.
Re: Txt encoding
Posted: Tue Aug 12, 2014 12:59 pm
by smbstarv
Thank you for this quick reply.
Re: Txt encoding
Posted: Sun Dec 14, 2014 9:26 pm
by smbstarv
Using option codepass, it's possible to encode any file in the SB environment. And this works fine.
I wonder however if it could also be made possible to encode a file WITHIN YOUR PROGRAM, e.g. a datafile by using
<< FILE "datafilename.txt" RENAME "datafilename.cod" >> ?
Re: Txt encoding
Posted: Sun Dec 14, 2014 9:31 pm
by Mr. Kibernetik
smbstarv wrote:Using option codepass, it's possible to encode any file in the SB environment. And this works fine.
I wonder however if it could also be made possible to encode a file WITHIN YOUR PROGRAM, e.g. a datafile by using
<< FILE "datafilename.txt" RENAME "datafilename.cod" >> ?
Why do you need this?
Re: Txt encoding
Posted: Mon Dec 15, 2014 12:01 am
by Henko
smbstarv wrote:Using option codepass, it's possible to encode any file in the SB environment. And this works fine.
I wonder however if it could also be made possible to encode a file WITHIN YOUR PROGRAM, e.g. a datafile by using
<< FILE "datafilename.txt" RENAME "datafilename.cod" >> ?
Maybe this is of some help:
viewtopic.php?f=20&t=214
Re: Txt encoding
Posted: Mon Dec 15, 2014 8:35 am
by smbstarv
Thank you Henko.
To mr K.
Why do i need this ?
Well, suppose I have - on my not very private ipad - a sb program to archive private data.
The program is encoded and the program can only be run after entering a password.
If I also want to protect the private data files, I have to encode these in the same way as I did with the program, i.e outside the program, renaming the file's extensions from .txt to .cod.
I wondered if this couldn't be done directly within the program by means of then FILE RENAME statement.
Re: Txt encoding
Posted: Mon Dec 15, 2014 8:54 am
by Mr. Kibernetik
I see.
I think that Henko's variant with data coding is more correct in this case.