Questions of 7 jul 02

Chipp Walters chipp at chipp.com
Mon Jul 8 23:04:00 EDT 2002


>
> 1) accept command returns a connectionID. How and where is it returned?

Peter, It's returned with the message.
here's part of a script from my stack cross-platform file transfer utility
"Sendreiver" with source code located at:
http://www.altuit.com/webs/altuit2/RunRev/Sendreiver.htm

moreData is the message sent
s is the connectionID sent
m is the data sent

actually, it's a bit easier to just download the stack and look in the stack
script. Sorry it's not too pretty, but it is easy to read.

on moreData s,m
  global gDATA
  #doMsg m
  put m after gDATA
  if last line of gData = "</altend>" then
    #doMsg "got last line"
    delete last line of gData
    hide img "spin"
    set the repeatcount of img "spin" to 0

    put line 1 of gDATA into f1Name
    delete line 1 of gDATA

    put fld "default_folder" &"/"& f1Name into fName
    domsg "fName:" & fName

    put base64decode(gDATA) into gDATA

    open file fName for binary write
    write gDATA to file fName
    close file fName
    doMsg "File Transfered: " & f1Name

    closeConnection s

  else
    doMsg "still reading"
    read from socket s with message "moreData"

  end if

end moreData
>
> 2) import command creates an image. how to reference that image? what is
> its ID?
>
> 3) import snapshot creates an image. how to reference that image? what is
> its ID?
>

As Sara points out, use "last image"

> 4) how to work with the image library? how to accumulate images to be used
> as icons?
> (I found that an image placed on a card appears in the image library and
> can be used as an icon (really great), but how put an image into
> the library
> without showing it on a card first)
>

FWIW, I'm not too crazy about the image library. You'll need to copy the
images from the library to your stack before creating an executable (unless
you include the image library stack) and when you copy the images, they all
get new image ID's which screws up your icons on your buttons. I've found it
better to just copy the images I want to a blank card on my stack, then
reference them from there.

Perhaps I just don't 'get it'

best,

Chipp




More information about the use-livecode mailing list