Author Topic: String to byte array  (Read 2097 times)

0 Members and 2 Guests are viewing this topic.

Aurel

  • Guest
String to byte array
« on: May 05, 2015, 10:25:23 PM »
In fact this is not problem than question...
what would be real purpose of this?
to record strings as variables ...
http://www.freebasic.net/forum/viewtopic.php?f=7&t=23527

Charles Pegge

  • Guest
Re: String to byte array
« Reply #1 on: May 05, 2015, 11:32:40 PM »

The purpose might be faster parsing. Reading bytes directly is faster than using asc() on each character.

Code: OxygenBasic
  1. string s="abcdefgh"
  2. byte b at strptr s
  3. 'b[1] == 97
  4. 'b[2] == 98
  5. '...
  6.  

Aurel

  • Guest
Re: String to byte array
« Reply #2 on: May 06, 2015, 01:43:01 AM »
Quote
The purpose might be faster parsing

aha ..i see ,i was thinking about something else