socket programming

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

Post Reply
ivaho
Posts: 37
Joined: Tue Feb 14, 2012 2:19 pm

socket programming

Post by ivaho » Thu Mar 15, 2012 8:21 pm

I'am trying to write a small program that plays movies files on my server.

On the server in command line I can type in {play 1 amb} and than movie amb is being played

In live code I can create a button. That plays that file.
{write "play 1 amb " & format("\r\n") to socket "localhost:5250"} (thanks Sturgis )

Now I have a small piece of script that puts files from a dir into a scrolling list field.

What i'am now looking for is a way to play the file that is select in my scrolling list field on my server

Should be something like
write "play 1
  • " & format("\r\n") to socket "localhost:5250"

    How to get the tekst from the scrolling list field into that code??

    Kind regards
    Ivo

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: socket programming

Post by Klaus » Thu Mar 15, 2012 9:17 pm

Hi Ivo,

try something like this in the script of that scrolling list field with teh files:

Code: Select all

on mouseup
  put the selectedtext of me into tFile
  put "play 1" && tFile && "format("\r\n") into tSocketString
  write tSocketString to socket "localhost:5250"
end mouseup
Not tested but should work.. (Famous last words :D )


Best

Klaus

ivaho
Posts: 37
Joined: Tue Feb 14, 2012 2:19 pm

Re: socket programming

Post by ivaho » Tue Mar 20, 2012 9:56 pm

Thanks,

It worked.

Another question, what if i would like to add some tekst to tFile later on.
tFile contains my selected text and i want to add the word 'twice'

So tFile would than contain the selected movie
Match
And the added word
Twice

Kind regards and many thanks for your help

Post Reply