Hello. I have 3 questions about B+ and server and gadget features
1)CAn I make a label gadget, then take the text that is entered and store it in a string???
2)THen, i want to take that string and send it to a premade server made with B+ on any port, for now lets say 225.
And 3)On the server, take the info sent to it by the client and save that into a string
Thanks alot,
Paul B
SetBuffer(DesktopBuffer()) ;USED so that stringwidth() won't error
mainwin = CreateWindow("Paul B",0,0,400,400)
labstrn$ = "Text Entry:"
thelab = CreateLabel(labstrn$,0,0,StringWidth(labstrn$),40,mainwin)
thefield = CreateTextField(StringWidth(labstrn$),0,200,StringHeight(labstrn$)+5,mainwin)
but = CreateButton("press",0,40,40,40,mainwin)
If False Then
;;;;server code
myServer = CreateTCPServer(225)
Repeat
strStream=AcceptTCPStream(myServer)
If strStream Then
takenString$ = ReadString$(strStream)
Print takenString$
EndIf
Select WaitEvent(100)
Case $803
End
End Select
Forever
;;;;
EndIf
Repeat
Select WaitEvent()
Case $401
Select EventSource()
Case but
inString$ = TextFieldText(thefield)
Print "'"+inString$+"'"
upstream = OpenTCPStream("127.0.0.1",225) ;or ip of the server
If upstream Then
WriteLine upstream,inString$
CloseTCPStream upstream
EndIf
End Select
Case $803
End
End Select
Forever
i am too newb, somebody plz tell me the way to put code into forum posts
Rck there is an FAQ here on the web .. somewhere, basically type open square bracket code closed square bracket then add your code then open square bracket backslash code closed square bracket. Hope that makes sense. Also try the same thing but with codebox instead of code for a scrolling codebox with green text. Btw you have just "hijacked" this topic which not everyone likes, but I don't mind.
What are the forum codes?BTW, I got the link to that page simply by typing [faq 2[
(except the second bracket is backwards of course...)