Oxygen Basic

Programming => Problems & Solutions => Topic started by: Aurel on May 05, 2015, 10:25:23 PM

Title: String to byte array
Post by: Aurel 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
Title: Re: String to byte array
Post by: Charles Pegge 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.  
Title: Re: String to byte array
Post by: Aurel on May 06, 2015, 01:43:01 AM
Quote
The purpose might be faster parsing

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