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

Username:   Password: 
 RegisterRegister   
 Creating .txt on desktop
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
chipanpriest




PostPosted: Wed Dec 21, 2011 4:46 pm   Post subject: Creating .txt on desktop

I am creating a program that creates a number of text files based on the user's input. What I need help with, is how to save the .txt files to the desktop because if you do what I did, it says that it cant find it because there is no folder named "desktop" in the turing folder. So if anyone could help me out, I would appreciate it.

Turing:
open : file, "Desktop/hey" + intstr (ch (i)) + ".txt", put, mod, seek
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Wed Dec 21, 2011 4:56 pm   Post subject: RE:Creating .txt on desktop

The Desktop folder is actually located under your home folder. For example, mine would be C:\Users\DemonWasp\Desktop on Windows Vista/7 or C:\Documents and Settings\DemonWasp\Desktop on Windows XP and earlier.
Tony




PostPosted: Wed Dec 21, 2011 5:01 pm   Post subject: RE:Creating .txt on desktop

Yeah, it would be kind of weird for the Desktop folder to be inside of the Turing folder Razz

(in specific -- relative vs. absolute path)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
ProgrammingFun




PostPosted: Wed Dec 21, 2011 6:04 pm   Post subject: RE:Creating .txt on desktop

Considering that it's always gonna be windows, you can try:
Turing:

open : file, "$Desktop/hey" + intstr (ch (i)) + ".txt", put, mod, seek
chipanpriest




PostPosted: Wed Dec 21, 2011 6:30 pm   Post subject: RE:Creating .txt on desktop

that didnt work lol but i got it to work on my computer i was just wondering if i could have gotten it to work on any computer
ProgrammingFun




PostPosted: Wed Dec 21, 2011 7:01 pm   Post subject: RE:Creating .txt on desktop

You could always ask the user for the save/open path. Wink
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  [ 6 Posts ]
Jump to:   


Style:  
Search: