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

Username:   Password: 
 RegisterRegister   
 User Upload Image (browse for folder for image)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
s3ven




PostPosted: Thu Jun 10, 2010 1:09 pm   Post subject: User Upload Image (browse for folder for image)

What is it you are trying to achieve?
I would like to allow the user of my turing program to be able to browse/upload/select an image from a folder on the computer and load it into turing

What is the problem you are having?
I don't know how to allow the user to store the image into a variable.


Describe what you have tried to solve this problem
I check the turing reference and didn't find anythign useful


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing:

%Example:
put"Please select/browse/upload the image you want"
-----browse button or something to allow the user to click on the image(upload it)
image:= Pic.FileNew ("uploadedimage")


Please specify what version of Turing you are using
latest version
Sponsor
Sponsor
Sponsor
sponsor
chrisbrown




PostPosted: Thu Jun 10, 2010 1:17 pm   Post subject: RE:User Upload Image (browse for folder for image)

At first I got excited because I didn't know this existsed:
http://compsci.ca/holtsoft/doc/gui_openfilefull.html

Then I realized it doesn't:
Note: This function is not available in the current version of the GUI Procedure Library (shipping with Turing 4.0 and MacOOT 1.5). It is documented here for use with future shipping version of Turing.
DemonWasp




PostPosted: Thu Jun 10, 2010 1:21 pm   Post subject: RE:User Upload Image (browse for folder for image)

I seem to recall using that exact function in an earlier version of Turing (3.11) when I was in grade 9. I distinctly recall allowing users to choose which map to load using that method.
Tony




PostPosted: Thu Jun 10, 2010 1:24 pm   Post subject: RE:User Upload Image (browse for folder for image)

you could use Dir to construct a file browser, to let the user navigate their file system. Once you get the filename, you can load that with Pic.FileNew
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
s3ven




PostPosted: Thu Jun 10, 2010 2:41 pm   Post subject: RE:User Upload Image (browse for folder for image)

if possible can someone give me a example code; please and thanks - I am still kind of clueless because i a kind of new to programming and it for my final project.
DemonWasp




PostPosted: Thu Jun 10, 2010 3:07 pm   Post subject: RE:User Upload Image (browse for folder for image)

Then you should probably skip this part and move on to the core features of your program. This part will take some degree of programming knowledge, plus a fair bit of time and effort.

Instead, have your users enter a path manually, such as:

Turing:

var path : string
put "Enter path of file: "..
get path

% open path here
% do stuff with contents of file here...
Tony




PostPosted: Thu Jun 10, 2010 3:12 pm   Post subject: RE:User Upload Image (browse for folder for image)

I'm with DemonWasp on this one -- it's a nice UI feature, but it's not essential.

If you do find yourself with a working project and you want to add a bit of extra; my previous link should have been dirmodule
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 7 Posts ]
Jump to:   


Style:  
Search: