Oxygen Basic

Programming => Problems & Solutions => Topic started by: on October 09, 2018, 04:08:07 PM

Title: Pointer woes
Post by: on October 09, 2018, 04:08:07 PM
This code prints the entire string:

Code: [Select]
wchar w[11] = "1234567890"
print w[1]

How to print each individual character?
Title: Re: Pointer woes
Post by: JRS on October 09, 2018, 04:34:23 PM
It feels like you're sanitizing O2 syntax.  ;D
Title: Re: Pointer woes
Post by: Charles Pegge on October 09, 2018, 04:48:40 PM
You can overlay any string with a byte or word array. It is much more efficient than using asc or mid to get individual characters

Code: [Select]
byte b at strptr w
print b[1]