Preventing unwanted Line Breaks in a txt file
Posted: Mon Feb 22, 2016 4:50 am
I'm using a pair of Encrypt & Decrypt functions that I found here - http://forums.livecode.com/viewtopic.php?f=11&t=22200
They are working fine; except that I have a problem when
- I encrypt a long (approx 100 char) string
- and write the encrypted version to a .txt file
- and then try to use the Decrypt function to read it.
The problem is occurring because the encrypted string is long (also approx 100 char with no spaces), and something is inserting a line break into it after approximately 72 characters. I know this because if I take the two encrypted strings that I'm being left with (on two separate lines), and join them together, then they Decrypt fine.
I've found lots of info on the forums on how to add line breaks, but how do I prevent unintended line breaks?
To initialize my file I'm using
- Put "file:" & ggDocumentsFolder & "/Puzzles.txt" into ggPuzzlesFile
- Put "MySetupParameters" into line 1 of URL (ggPuzzlesFile)
To write my encrypted strings into the file I'm using
- Put EncryptIt(StringIWantEncrypted) into line xyz of URL (ggPuzzlesFile)
I experimented with changing this to a binfile, but wasn't familiar enough with binfiles to find a solution.
LiveCode 7.1.0; developing on Windows 7; trying to build an app for Android.
Thanks in advance (and sorry for bothering everyone again)
They are working fine; except that I have a problem when
- I encrypt a long (approx 100 char) string
- and write the encrypted version to a .txt file
- and then try to use the Decrypt function to read it.
The problem is occurring because the encrypted string is long (also approx 100 char with no spaces), and something is inserting a line break into it after approximately 72 characters. I know this because if I take the two encrypted strings that I'm being left with (on two separate lines), and join them together, then they Decrypt fine.
I've found lots of info on the forums on how to add line breaks, but how do I prevent unintended line breaks?
To initialize my file I'm using
- Put "file:" & ggDocumentsFolder & "/Puzzles.txt" into ggPuzzlesFile
- Put "MySetupParameters" into line 1 of URL (ggPuzzlesFile)
To write my encrypted strings into the file I'm using
- Put EncryptIt(StringIWantEncrypted) into line xyz of URL (ggPuzzlesFile)
I experimented with changing this to a binfile, but wasn't familiar enough with binfiles to find a solution.
LiveCode 7.1.0; developing on Windows 7; trying to build an app for Android.
Thanks in advance (and sorry for bothering everyone again)