Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
shawnblc
- VIP Livecode Opensource Backer

- Posts: 342
- Joined: Fri Jun 01, 2012 11:11 pm
Post
by shawnblc » Mon Jan 19, 2015 12:06 am
Trying to do something like this and not having much luck, even locked LC up for a bit. When I do this I get the correct code, back in the message box, but when I try and call the handler nothing happens.
Code: Select all
on myCode
put line 1 to 20 of URL "http://mydomain/myfile.txt" into tLcCode
put tLcCode
end myCode
Last edited by
shawnblc on Mon Jan 19, 2015 12:16 am, edited 1 time in total.
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Mon Jan 19, 2015 12:09 am
How quickly does Thai URL return in a browser?
-
shawnblc
- VIP Livecode Opensource Backer

- Posts: 342
- Joined: Fri Jun 01, 2012 11:11 pm
Post
by shawnblc » Mon Jan 19, 2015 12:12 am
FourthWorld wrote:How quickly does Thai URL return in a browser?
Pretty dog-gone quick, it's a text file. I'll try wait.
Update: no luck, tried moving it to the preOpenStack too. No luck.
-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Mon Jan 19, 2015 12:14 am
Code: Select all
put line 1 to 20 of URL "http://mydomain/.txt" into tLcCode
Just a typo or do you really have a .txt file with no name?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
shawnblc
- VIP Livecode Opensource Backer

- Posts: 342
- Joined: Fri Jun 01, 2012 11:11 pm
Post
by shawnblc » Mon Jan 19, 2015 12:16 am
Simon wrote:Code: Select all
put line 1 to 20 of URL "http://mydomain/.txt" into tLcCode
Just a typo or do you really have a .txt file with no name?
Simon
It's a typo.
-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Mon Jan 19, 2015 12:19 am
It's working here on my site.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
shawnblc
- VIP Livecode Opensource Backer

- Posts: 342
- Joined: Fri Jun 01, 2012 11:11 pm
Post
by shawnblc » Mon Jan 19, 2015 12:32 am
Simon wrote:It's working here on my site.
Let me double check everything in the txt file and make sure I didn't make an error there. Hmmmm. Update in a few minutes.
Update: I can take exactly what I have in the txt file and paste in the handler and it works, when I get the code from the txt file though it just pops up in the message box. Nothing else happens as it should.
Last edited by
shawnblc on Mon Jan 19, 2015 12:44 am, edited 1 time in total.
-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Mon Jan 19, 2015 12:39 am
U get my pm?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
shawnblc
- VIP Livecode Opensource Backer

- Posts: 342
- Joined: Fri Jun 01, 2012 11:11 pm
Post
by shawnblc » Mon Jan 19, 2015 12:48 am
Simon wrote:U get my pm?
Just responded to your PM. Doesn't work for me either. I'm using LC 7.0.2 rc 1 build 10024. Does exactly like mine does and just pops up in the message box.
-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Mon Jan 19, 2015 1:11 am
I just tested with LC 7.0.2 rc 1 build 10024 commercial and it is working.
Maybe I'm misunderstanding the question?
is it;
If you put all the code in a button it works but if you put "on myCode" into the card or stack script it doesn't work?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Mon Jan 19, 2015 1:20 am
Does exactly like mine does and just pops up in the message box.
Wait a sec... that is what it is supposed to do.
Where did you want the 20 lines to show up?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
shawnblc
- VIP Livecode Opensource Backer

- Posts: 342
- Joined: Fri Jun 01, 2012 11:11 pm
Post
by shawnblc » Mon Jan 19, 2015 1:22 am
Simon wrote:I just tested with LC 7.0.2 rc 1 build 10024 commercial and it is working.
Maybe I'm misunderstanding the question?
is it;
If you put all the code in a button it works but if you put "on myCode" into the card or stack script it doesn't work?
Simon
Example: On my button script I have this:
On the stack script I'd have this on, say open stack
Code: Select all
on openStack
mLcCode
end openStack
in my text file I'd have this:
-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Mon Jan 19, 2015 1:25 am
shawnblc wrote:
...
in my text file I'd have this:
Getting weirder...
You want to download a text file and run it as a script?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
shawnblc
- VIP Livecode Opensource Backer

- Posts: 342
- Joined: Fri Jun 01, 2012 11:11 pm
Post
by shawnblc » Mon Jan 19, 2015 1:29 am
Yup. Just experimenting. Copied from another one, seems like it should work. Not working either, but I'm sure it's me.
Code: Select all
on closeStack
mYahoo
end closeStack
Code: Select all
on mYahoo
put URL "http://domain.com/launch.txt" into tURL
put tURL
end mYahoo
Text file contains:
-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Mon Jan 19, 2015 1:35 am
OOOOHHHHHH!
OK
Haven't tested it but
Add a new button (could be anything)
in your text file have this
on mouseUp
launch URL "
http://www.livecode.com"
end mouseUp
Then download all three lines and
Code: Select all
set the script of the last button to tLcCode
send mouseUp to the last button
???
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!