Having trouble with http & ftp

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
TooManyNotes
Posts: 10
Joined: Fri Nov 16, 2018 2:01 am

Having trouble with http & ftp

Post by TooManyNotes » Fri Nov 16, 2018 3:31 am

Newbie, coming from Director 12 to LC9. Some of the constructs are very similar, some are not. For example, http & ftp are quite different. I’m using the following code in LC9 and nothing happens: (dummy url) set the text of field “capture” to URL “(url)/test.txt” I have a field named “capture.” So I guess I’m missing something. I’ve tested the url in a browser and it works fine. Is there a sample script online I can examine?
As for ftp, I’m in the dark. I’ve tried the samples in the dictionary, but nothing happens. Where to turn?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2792
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Having trouble with http & ftp

Post by richmond62 » Fri Nov 16, 2018 9:10 am

Well . . .

You can do this:

Code: Select all

on mouseUp
   get URL "https://forums.livecode.com/viewtopic.php?f=7&t=31774"
   put it into fld "ff"
end mouseUp
although ALL you end up with is RAW HTML.

This does rather better:

Code: Select all

on mouseUp
   get URL "https://forums.livecode.com/viewtopic.php?f=7&t=31774"
   set the HTMLText of fld "ff" to it
end mouseUp

Klaus
Posts: 10486
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Having trouble with http & ftp

Post by Klaus » Fri Nov 16, 2018 10:04 am

Hi TooManyNotes (I do not believe in this! :D ),

welcome to the forum!

I would like to see your script! In principle it is OK, but maybe the syntax is not correct.
Do you get any error?

Anyway, try this:

Code: Select all

...
put url("http:// your /url/here/test.txt") into fld "capture"
## Now check for possible errors:
## THE RESULT is usually EMPTY on success and may give a hint if not
if the result <> EMPTY then
  answer "Problem:" && the result
end if
...
@Richmond
TooManyNotes wants to put a file named "test.txt" into his field, so HTMLTEXT is NOT the right choice! Shall I call you Richard? That was mean, I know... 8)


Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2792
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Having trouble with http & ftp

Post by richmond62 » Fri Nov 16, 2018 12:13 pm

@Claus

I was writing that while giving 4 kids a dictation in an English class.

Best, Richard

P.S. I'd always favour

Code: Select all

set the text of fld "f1" to
8)

Klaus
Posts: 10486
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Having trouble with http & ftp

Post by Klaus » Fri Nov 16, 2018 12:30 pm

richmond62 wrote:
Fri Nov 16, 2018 12:13 pm
I was writing that while giving 4 kids a dictation in an English class.
So what?

TooManyNotes
Posts: 10
Joined: Fri Nov 16, 2018 2:01 am

Re: Having trouble with http & ftp

Post by TooManyNotes » Fri Nov 16, 2018 2:34 pm

All the scripts worked! Thanks to all for the guidance. Now, onto more issues in another post.
—TooManyNotes

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”