New build of AfterGRASP is up for download:

http://www.aftergrasp.com/download/agsetup_20060317.exe

----------------------------------------------------------------------------
Fri, 17 Mar 2006

New function HTTPQUERYS, returns an array of all HTTPQUERY results.

  RESULTARRAY = HTTPQUERY()
  RESULTARRAY = HTTPQUERY(URL)

Runable example:

        drawclear white
        color black
        url = "http://www.aftergrasp.com/test.htm";
        fullstring = "URL = "[EMAIL PROTECTED]@[EMAIL PROTECTED]
        http getvar @url test
        query = httpquerys()
        filedelete httpresults.txt
        fileputvariables httpresults.txt query
        filesendln httpresults.txt @@test
        appshell open httpresults.txt
        wait 100
        exitnow

Results look like this:

query[ACCEPT_RANGES] = bytes
query[CONTENT_LENGTH] = 217
query[CONTENT_TYPE] = text/html
query[DATE] = "Tue, 14 Mar 2006 18:49:57 GMT"
query[ETAG] = """514c113-d9-440f023b"""
query[LAST_MODIFIED] = "Wed, 08 Mar 2006 16:11:39 GMT"
query[RAW_HEADERS] = "HTTP/1.1 200 OK"
query[RAW_HEADERS_CRLF] = "HTTP/1.1 200 OK
Date: Tue, 14 Mar 2006 18:49:57 GMT
Server: Apache
Last-Modified: Wed, 08 Mar 2006 16:11:39 GMT
ETag: ""514c113-d9-440f023b""
Accept-Ranges: bytes
Content-Length: 217
Content-Type: text/html

"
query[REQUEST_METHOD] = GET
query[SERVER] = Apache
query[STATUS_CODE] = 200
query[STATUS_TEXT] = OK
query[VERSION] = HTTP/1.1





Close to finalized syntax for new NET commands for direct TCP/IP networking,
not working yet (partially written):

Three new WHEN types, NETSERVE, NETREADREADY and NETCLOSED. The
The first parameter passed to the trigger subroutine for all three
of these new WHEN types is the handle for TCP/IP connection.


NETSERVE is triggered for each incoming connection on the given TCP/IP
port.

  WHEN NETSERVE PORT
    DECLARE HANDLE
    ...
  ENDWHEN


NETREADREADY is triggered when N number of bytes are ready to be read
from the given TCP/IP connection associated with HANDLE. If the
COUNT option is given, it's the number of bytes to wait for until
triggering the WHEN. If not given, a count of 1 is assumed.

  WHEN NETREADREADY HANDLE
    DECLARE HANDLE
    ...
  ENDWHEN

  WHEN NETREADREADY HANDLE COUNT
    DECLARE HANDLE
    ...
  ENDWHEN


NETCLOSED is triggered when a TCP/IP connection is closed.

  WHEN NETCLOSED HANDLE  ; First parameter passed to subroutine is HANDLE
    DECLARE HANDLE
    ...
  ENDWHEN


Keep in mind that since an array index can be any type of value, you can
use a TCP/IP connection handle as an array index to store connection
specific information. For example:

  when servesub netserve 80
    declare handle

    when [EMAIL PROTECTED] netclosed @handle
      free [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]
    endwhen

    global [EMAIL PROTECTED] netreadline(@handle)

    when [EMAIL PROTECTED] netreadready @handle
      declare handle
      filesend @[EMAIL PROTECTED] netread(@handle)
    endwhen

  endwhen

All file oriented commands support direct network I/O, just prepend
the prefix "NET:" and the ":PORTNUM" after the address.

  HANDLE = FILECREATE("NET:ADDRESS:PORTNUM")
  HANDLE = FILEOPEN("NET:ADDRESS:PORTNUM")
  HANDLE = FILEAPPEND("NET:ADDRESS:PORTNUM")

  FILECLOSE HANDLE

  HANDLE = NETOPEN(ADDRESS,PORTNUM)         ; Opens outgoing
connection for read/write

  BYTECOUNT = NETREADCOUNT(HANDLE)

  ADDRESS = NETADDRESS(HANDLE)
  HANDLE->ACTIVE


  NETREAD HANDLE BUFFERADDRESS COUNT
  BYTECOUNT = NETWRITECOUNT(HANDLE)

  WAITNET HANDLE
  WAITNET HANDLE TIMEOUT
  WAITNETCLOSE HANDLE
  WAITNETCLOSE HANDLE TIMEOUT



----------------------------------------------------------------------------

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"aftergrasp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/aftergrasp
-~----------~----~----~----~------~----~------~--~---

Reply via email to