Page 1 of 1
Complete Newbie: Retrieving text inside non-local text files
Posted: Fri Dec 10, 2010 11:16 pm
by Malteser
Hi there,
Almost completely new to RunRev, but liking it so far. However, I've been scrolling through the tutorials and there doesn't seem to be one that relates to my issue.
I have a .txt file hosted at "
http://dl.dropbox.com/u/15530379/newspost.txt" and would like to retrieve the text inside it and place it in a scrolling field (or, alternatively, into a Label).
I assumed something like this would suffice, but as I'm a -complete- novice, I'm probably way off.
on mouseUp
set the contents of lbltest to URL "
http://dl.dropbox.com/u/15530379/newspost.txt"
end mouseUp
Re: Complete Newbie: Retrieving text inside non-local text files
Posted: Sat Dec 11, 2010 12:27 am
by bn
Hi Malteser,
welcome to the Forum.
try:
Code: Select all
on mouseUp
put URL "http://dl.dropbox.com/u/15530379/Uprising/Launcher/newspost.txt" into field "NameOfMyField"
end mouseUp
Kind regards
Bernd
Re: Complete Newbie: Retrieving text inside non-local text files
Posted: Sat Dec 11, 2010 12:34 am
by Malteser
Just realised I posted two different links. I'm sure that helped.
Thanks a lot for that, managed to edit it to work for the other labels and fields too.

Re: Complete Newbie: Retrieving text inside non-local text files
Posted: Sat Dec 11, 2010 8:47 am
by Malteser
Hi again,
The code works perfectly when running from a MouseDown event on a test button, but when moving it to the Startup event for the main card (and the only card that isn't used for icon/image/video storage) it seems to cease functioning. I thought it was an issue with the entire script, but it seems like the OS print works fine. It's not exactly the most complicated script in the world which just confuses me further, because there's not a whole lot to go wrong (unless I'm mistaking how the on startup event works for cards)?
Code: Select all
on startup
/*
+Get newspost.txt and output to newspost field
+Get latestver.txt and output to latestver field
-Get currentver.txt from $curfolder$, output to currentver field
*/
put URL "http://dl.dropbox.com/u/15530379/Uprising/Launcher/newspost.txt" into field "newspost"
put URL "http://dl.dropbox.com/u/15530397/Uprising/Launcher/latestver.txt" into field "latestver"
/* put _ into field "currentver"*/
set the loc of this stack to the screenLoc
/* Check OS and output to Label for installer reference folders, just in case installer check fails.*/
if the platform is "MacOS"\
then put "Macintosh" into field "ostype"
else if the platform is "Win32"\
then put "Windows" into field "ostype"
else if the platform is "Linux"\
then put "Linux" into field "ostype"
end startup
Re: Complete Newbie: Retrieving text inside non-local text files
Posted: Sat Dec 11, 2010 12:01 pm
by bn
Hi Malteser,
try to put your code into a on openstack handler and provide a full path to the fields. Like "put something into field "newsPost" of card "news"
StartUp might be a little early in the chain of events.
regards
Bernd