プレイ日記
V360 TheV360
WHAT IS GOING ON ANYMORE Seriously, what happened to A%? It's supposed to be an array, but it's not? DEF STR_TO_ARR S$ OUT A%[] WHILE LEN(S$)!=LEN(A%) PUSH A%,ASC(S$[LEN(A%)-1]) WEND S$="" END
1そうだね
プレイ済み
返信[1]
親投稿
Keem☆ MogamiAmpharos
I haven't used variable types much... but if A% is a number variable/array, you might need to use VAL() to convert the $tring to a number or integer.
0そうだね
プレイ済み
返信[2]
親投稿
V360 TheV360
ASC converts the string into a character code, which is an integer.
0そうだね
プレイ済み
返信[3]
親投稿
Oscar PwnageBlock
Maybe it suddenly turned into a multidimensional array?
0そうだね
プレイ済み
返信[4]
親投稿
Hanzo rzsense
Could you refer to the following program? DEF STR2ARR S$,A% VAR D WHILE LEN(A%)>0:D=POP(A%):WEND WHILE LEN(S$)>LEN(A%) PUSH A%,ASC(S$[LEN(A%)]) WEND END DIM C%[100] STR2ARR "SMILEBASIC",C% FOR I=0 TO LEN(C%)-1:?C%[I]:NEXT I
0そうだね
未プレイ
返信[5]
親投稿
V360 TheV360
Still get an error. Here's all the code. (You can still get the length of a 2D array however, so I don't know why it would error on that line.)
0そうだね
プレイ済み
返信[6]
親投稿
Oscar PwnageBlock
I'd suggest using... DEF FUNCNAME PARAM RETURN RETVAL ...rather than... DEF FUNCNAME PARAM OUT RETVAL ...for functions with a single return value. It's a lot more straightforward in terms of the return value's initialization and the value returned itself.
0そうだね
プレイ済み
返信[7]
親投稿
Hanzo rzsense
You should not use neither OUT nor RETURN for a reference of an array. I recommend you to modify your program as follows. DEF STR_TO_ARR S$ OUT A%[] -> DEF STR_TO_ARR S$,A%[]
2そうだね
未プレイ
返信[8]
親投稿
V360 TheV360
Thanks, Hanzo! I fixed the bug!… mostly…
1そうだね
プレイ済み