Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Some questions
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
xevious




PostPosted: Tue Dec 06, 2005 8:17 pm   Post subject: Some questions

I've got a few questions related to things I'm trying to do with turing.

1) Is there any way to change the font of text as it is being input by the user?

2) Is there any way to specify a picture's location that's in a folder in the same location as the turing file, so that it could be used on any computer without having picture files everywhere.

and one that's not really specific to turing:

Is there any way to have a .txt file that cannot be edited by anyone who opens it directly, but can still recieve put from turing (to prevent such things as hacking high scores)
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Tue Dec 06, 2005 8:25 pm   Post subject: (No subject)

Welcome to CompSci.ca

1) Sure is. The best way to do this would be to use getch to get input (put getch in a loop and exit when the enter key is getched. Append each character to a string, that starts as a null string, ""). Draw with Font.Draw. Check out [Turing Tutorials] for some tutorials on these topics.

2) Sure is. Wink You'd need to look at the Dir module. I believe there's a Dir.Current() function.

Your last question is a little tricky. It's easy enough to make a file read-only, but I'd be surprised if Turing can create files and set their permissions. Further, you'd have to run the program as a user who has the permissions to read and write to the file.

Certainly the easiest thing to do here, though not quite as good, is to encrypt your data, so that if the user edits it he'll just screw things up. There are two ways you can do this. The first is to create an encryption/decryption algorithm and use that, or use read/write instead of put/get. These topics should be covered in the file I/O tutorial in [Turing Tutorials].
codemage




PostPosted: Wed Dec 07, 2005 9:58 am   Post subject: (No subject)

On point 3 - encrypt your data, and don't name it as a .txt file.

Giving it an inconspicuous name will keep the overwhelming majority of would-be-hackers away.

If your program is for a predominantly male demographic, name it help.dll. They won't go near it. Very Happy
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: