BASIC

Author Topic: idea for another data handling for the net command bytes (send/receive)  (Read 2436 times)

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
Hmm maybe iam wrong but ...

At this time the Send and Received Data  are  stored in a String .
If you need a singel Byte from the String  you must write

rv% = SOCK_RECV(sock, msg$, 1024)
t= asc(mid$(msg$,2,1))

my idea is what you can store the data to an array  such like

dim msg[1024) as byte ???
rv% = SOCK_RECV(sock, msg[], 1024)
t= msg[2]

what do you think about ?


 




MrTAToad

  • Guest
Personally, I would go for an allocated area of memory, but then Peek/Poke of various types would be needed :)

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
yea !
the need  peekbyte,peekint,peekword  ,peekbla  and peekblub !
i like the idea much more as mine


Offline Moebius

  • Dr. Type
  • ****
  • Posts: 315
    • View Profile
is there some simple way to get the address of the string data (for a DGStr) in INLINE code?
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1543
    • View Profile
Currently to send an array it is usually constructed with delimiter for splitstr. Is there a faster way to instantly copy (prob inline or like MEM2SPRITE) an array list to string (i guess as hex) as that is what can only be sent?

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10709
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Is the asc() versio too slow? It should be really fast. Din't use mid$!! The asc-function has an additional 2nd parameter.