在PB中如何使⽤⼀个字符串给⼀个字符串数组赋值
如果使⽤直接赋值的⽅式,⽆论是
String ls_char
ls_char = " To assign a string value to a string type array "
String ls_array[]
ls_array = ls_char
还是
String ls_char
ls_char = " To assign a string value to a string type array "
String ls_array[]
ls_array[] = ls_char
都会有如下的错误提⽰:
(0004): Error  C0070: Mixing array and non-array in assignment statement
应当使⽤如下的⽅式进⾏赋值:
String ls_char //a variable whose type is string
数组全部赋值为1ls_char = "To assign a string value to a string type array"
String ls_array[] //an dynamic array whose type is string
Integer li_i,li_len
li_len = Len(ls_char)
FOR li_i = 1 TO li_len STEP 1
ls_array[li_i] = Mid(ls_char,li_i,1)
NEXT

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。