Hiding messages in strings.

SYS 64738
User avatar
Posts: 179
Joined: Tue May 06, 2014 12:12 pm
Location: UK

Hiding messages in strings.

Post by Shaun_B » Mon Aug 25, 2014 3:30 pm

Here's a quirk of Commodore BASIC for you:
Firstly, type your string as you usually would, then go to the line with your string in and at the end at the last character of it, press SHIFT+INS/DEL for as many characters as you have (in the example, 13). Now press the INS/DEL key up to the closing quotation mark. A reversed T should fill the string to the closing quotation mark.

Printing the string will not show anything (and in the listing it looks like an empty string), but printing it to the length of the original message using the LEFT$ command will show it.

This was a nice trick when I wanted to hide my passwords when I was 10 or 11 ;-)



BASIC Programming - making the mistakes so that you don't have to.
Circles and Squares.
Nothing I post here will stand up in a court of law.

User avatar
Posts: 22
Joined: Sun Apr 13, 2014 9:06 pm
Location: Washington State

Re: Hiding messages in strings.

Post by buzbard » Tue Aug 26, 2014 2:43 pm

I used to do that as well.
Here's another way to do it:
In line 10 after the 'REM' type 2 double quotes, delete the second, to exit quote mode.
Press CTRL+9, to enter reverse mode.
Press 'T' for every character back to, the 'H" (in this case 18 times).
Press CTRL+0 to exit reverse mode.
Finally, type a double quote and press RETURN.

It's a few more steps, but you don't need the LEFT$ function any more. ;)
You do not have the required permissions to view the files attached to this post.
It's Ok if you don't agree with me, I can't force you to be right.

Post Reply Previous topicNext topic