Well, I got the networking commands into SBasic for 2.0. So far, only the necessities:
@OpenNetworkConnection(serverName as string, port as int) as int // returns the netID
CloseNetworkConnection(netID as int)
NetworkWrite(netID as int, str as string)
@NetworkRead(netID as int, lengthLimit as int) as string
For example, here is the SBasic code needed to read my web page, using the HTTP protocol:
var net_id as int
var str as string
net_id = @OpenNetworkConnection("www.HammerVE.com", 80)
if(net_id > -1)
{
NetworkWrite(net_id, "GET /index.html HTTP/1.0")
NetworkWrite(net_id, @NewLine())
NetworkWrite(net_id, @NewLine())
str = @NetworkRead(net_id, 10000)
writeln(str)
CloseNetworkConnection(net_id)
}
This could be used to read/write any of the internet protocols (HTTP, FTP, NNTP, SMTP, POP, IMAP, etc...). A really clever programmer could even use this to turn a SBasic program into a Sesame client.