Txt encoding

Post Reply
smbstarv
Posts: 98
Joined: Wed Nov 27, 2013 3:44 pm
My devices: Ipad 6th gen
Flag: Netherlands
Contact:

Txt encoding

Post by smbstarv »

I have difficulty to implement text encoding/decoding in my programs. Could anyone provide a simple example ?

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Txt encoding

Post by Mr. Kibernetik »

What kind of problems do you have?

smbstarv
Posts: 98
Joined: Wed Nov 27, 2013 3:44 pm
My devices: Ipad 6th gen
Flag: Netherlands
Contact:

Re: Txt encoding

Post 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.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Txt encoding

Post by Mr. Kibernetik »

Ok, you write:

Code: Select all

OPTION CODEPASS "password"
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.

smbstarv
Posts: 98
Joined: Wed Nov 27, 2013 3:44 pm
My devices: Ipad 6th gen
Flag: Netherlands
Contact:

Re: Txt encoding

Post by smbstarv »

Thank you for this quick reply.

smbstarv
Posts: 98
Joined: Wed Nov 27, 2013 3:44 pm
My devices: Ipad 6th gen
Flag: Netherlands
Contact:

Re: Txt encoding

Post 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" >> ?

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Txt encoding

Post 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?

Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: Txt encoding

Post 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

smbstarv
Posts: 98
Joined: Wed Nov 27, 2013 3:44 pm
My devices: Ipad 6th gen
Flag: Netherlands
Contact:

Re: Txt encoding

Post 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.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Txt encoding

Post by Mr. Kibernetik »

I see.
I think that Henko's variant with data coding is more correct in this case.

Post Reply