Very Confused!

BlitzMax Forums/BlitzMax Beginners Area/Very Confused!

Andy UK(Posted 2008) [#1]
Take this code,

Strict

' one udp
Local Udp:tSocket = CreateUDPSocket()
' to recieve
BindSocket (Udp, 49000)
' to send
ConnectSocket (Udp, HostIp ("62.12.76.136"), 49000)

' Send some data
Local b:Byte [] = [Byte(9), Byte(7), Byte(5), Byte(3), Byte(1)]
Udp.send (Varptr b[0], b.length)

' create a loop which waits for some data
While True

	If SocketReadAvail (Udp)
		' a bank to store the input
		Local tmpBank:TBank = CreateBank (1024)
		' size of data-package
		Local length:Int = Udp.recv (BankBuf (tmpBank), tmpBank.size() )
		
		' print data
		For Local i:Int = 0 To length - 1
			Print tmpBank.PeekByte(i)
		Next
		
		' exit this loop 
		Exit
	End If

Wend

CloseSocket (Udp)
End


I know how the code works but how do i know where to find the command "Udp.send" ?? could not find it under sockets. Is it a command?


GfK(Posted 2008) [#2]
Welcome to the crazy world of Blitzmax documentation. This is precisely why I don't understand how anybody can tolerate using an object-oriented language with an IDE that doesn't have intellisense.

I generally search the forums more than I use the documentation, although you can find a list of methods for tSocket by clicking on a function name in the Sockets - doesn't matter which, then click on the "Source" function at the top of the page.


plash(Posted 2008) [#3]
It is a method. If it is not documented, your best bet to understand it is by poking around the source of the module.


Andy UK(Posted 2008) [#4]
Thanks guy's. Does BLide make this kind of thing easier?


GfK(Posted 2008) [#5]
Yes, although personally I prefer Project Studio.


plash(Posted 2008) [#6]
YES! It definitely does.


Brucey(Posted 2008) [#7]
Is it documented in Blide? Cool.


jkrankie(Posted 2008) [#8]
Blide is awesome!

Cheers
Charlie


tonyg(Posted 2008) [#9]
Also have a look for HotDocs.


plash(Posted 2008) [#10]
Is it documented in Blide? Cool.
No, but it does give full intellisense, so you can see all the parameters for a method/function for each object/type.


Andy UK(Posted 2008) [#11]
Just purchased Blide Plus :)


MGE(Posted 2008) [#12]
Good call Andy. You will not regret it. ;)


markcw(Posted 2008) [#13]
Type TSocket
Method Send( buf:Byte Ptr,count,flags=0 )