Txt encoding
Txt encoding
I have difficulty to implement text encoding/decoding in my programs. Could anyone provide a simple example ?
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Txt encoding
What kind of problems do you have?
Re: Txt encoding
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.
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.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Txt encoding
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.
Code: Select all
OPTION CODEPASS "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
Thank you for this quick reply.
Re: Txt encoding
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" >> ?
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" >> ?
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Txt encoding
Why do you need this?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" >> ?
-
- Posts: 814
- Joined: Tue Apr 09, 2013 12:23 pm
- My devices: iPhone,iPad
Windows - Location: Groningen, Netherlands
- Flag:
Re: Txt encoding
Maybe this is of some help: viewtopic.php?f=20&t=214smbstarv 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" >> ?
Re: Txt encoding
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.
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.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Txt encoding
I see.
I think that Henko's variant with data coding is more correct in this case.
I think that Henko's variant with data coding is more correct in this case.