Page 1 of 1

Having trouble with http & ftp

Posted: Fri Nov 16, 2018 3:31 am
by TooManyNotes
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?

Re: Having trouble with http & ftp

Posted: Fri Nov 16, 2018 9:10 am
by richmond62
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

Re: Having trouble with http & ftp

Posted: Fri Nov 16, 2018 10:04 am
by Klaus
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

Re: Having trouble with http & ftp

Posted: Fri Nov 16, 2018 12:13 pm
by richmond62
@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)

Re: Having trouble with http & ftp

Posted: Fri Nov 16, 2018 12:30 pm
by Klaus
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?

Re: Having trouble with http & ftp

Posted: Fri Nov 16, 2018 2:34 pm
by TooManyNotes
All the scripts worked! Thanks to all for the guidance. Now, onto more issues in another post.
—TooManyNotes