Page 1 of 1
Web apps
Posted: Sun Dec 06, 2009 6:19 pm
by DukeUK
I'm just trying out Revolution to see if I can get the hang of it.
I'm not a programmer and don't really have any real experience, although I have spent a few months recently trying to develop some software with Realbasic, with a bit of success (success defined as the bits I have done do at least work, although the coding ain't pretty). After saying that I've really struggled every step of the way trying to understand the overall concepts of Realbasic.
After a couple of hours with Revolution, I managed to do something that I've never been able to do with Realbasic despite my best efforts, so I'm thinking well maybe this is worth investing some time in. I dare say its not as good in other areas, but I was impressed with this bit.
The main thing for me is to be able to develop software that is cross platform. Being able to deploy it on the web would be a huge advantage and it seams very easy to do this.
So my first question is with the web apps. I have done a simple programme and put it on my sever and it works a treat. But if I save the web page locally, I can still run it. Ideally I wouldn't want this to be possible. Can this be prevented?
Re: Web apps
Posted: Mon Dec 07, 2009 9:36 am
by ale870
I didn't make tests with Web version of RunRev, but you could try to use the commands "directory". It returns current working directory. You could then try to check if the working directory return a local path (it means the user is running the page from a locally saved!). See the documentation.
Cheers
Re: Web apps
Posted: Wed Dec 09, 2009 10:15 am
by DukeUK
Thanks, yes I can see how that could do the trick.
Funny thing, I tried the same thing on 2 other computers and it doesn't run, it just says file not found.
Maybe it only ran before because the revlet file was on my computer ?
This would make some sense as when you save the html file locally, that wouldn't be any use without the revlet.
Re: Web apps
Posted: Wed Dec 09, 2009 10:23 am
by ale870
Generally speaking, browser plugins have some restrictions caused by security police (to protect the final user).
So it could be possible the command "directory" return a not reliable result because, in web-browser, you cannot access to local files. If so, you could use this "behavior" to check if you are running locally or via web.
Cheers!
Re: Web apps
Posted: Wed Dec 09, 2009 11:16 am
by Dixie
Don't know if this will help but I use the following in an openStack handler
Code: Select all
on openStack
/*on the desktop */
if environment() = "development" OR environment() = "standalone" then
/* do something */
end if
/* on the server */
if environment() = "browser" then
/* do something else */
end if
end openStack
be well
Dixie
Re: Web apps
Posted: Wed Dec 09, 2009 11:32 am
by ale870
Hello @Dixie, your solution is great, but I red the documentation (dictionary) and the return value "browser" does not exist. Are you sure it works (sometimes the dictionary does not contain some details

)
Thank you!
Re: Web apps
Posted: Wed Dec 09, 2009 11:58 am
by Dixie
After reading your post, I just had one of those moments of self doubt... so I quickly but a field and a button on a stack
Code: Select all
on mouseUp
put environment() into fld 1
end mouseUp
in the IDE it returns 'development', as a standalone it returns 'standalone application' ( I was sure it just used to return 'standalone') and running as a revlet returns 'browser'.
be well
Dixie
Re: Web apps
Posted: Wed Dec 09, 2009 12:00 pm
by ale870
It means the documentation is not updated! (it is not the first time I find this problem!).
Thank you for your test!
Re: Web apps
Posted: Thu Dec 10, 2009 12:00 pm
by DukeUK
Thanks for the tip Dixie, this looks quite promising.
If I put a file on the server with a password in it and put in the code to read and check the password when the programme is opened in a browser, then if the file is run locally the file and password won't be there and it could be programmed to close down ?
I'll give it go and see what happens.
Re: Web apps
Posted: Thu Dec 10, 2009 1:15 pm
by Dixie
Hi Duke...
This very basic script works... if your stack is running on the desktop then 'no questions asked!'
Code: Select all
on preOpenStack
put environment() into fld 1
end preOpenStack
on openStack
if environment() = "browser" then
ask password clear "Who are you ?" titled "Security"
if it = "Harry Jones" then put " I think I'll let you in..." into fld 2
end if
end openStack
Be well
Dixie
Re: Web apps
Posted: Thu Dec 10, 2009 2:25 pm
by ale870
Hello @Dixie,
your code is clear and very useful. Can I put it inside my site, for "tips & tricks" area (Site is:
http://runrevwidgets.com/wiki)? If you want, I can supply your name, or email, etc...
Cheers!
Re: Web apps
Posted: Thu Dec 10, 2009 4:51 pm
by Dixie
You may... if you send me your email address , I'll throw a script together that is a little more functional and descriptive for you.
john@ihouse.on-rev.com
be well
Dixie