I am fairly new to programing and this may be an easy question. I was ondering if you can return an array or linked list from a procedure? If you can, Can you give me a quick example of how to do this. I have tried a few things and can't seem to get it to work. Here is a quick example of what I am tring to do.
Code: Select all
Procedure.s parseString(buffer$.s, parseCharacter.s)
NewList results.s()
buffer$ = "Data1,Data2,Data3,Data4,"
lEnd.l = FindString(buffer$, parseCharacter, 1)
Debug "The starting string is:"
Debug buffer$
Repeat
If lEnd > 0 ;If > 0 then we have a parseCharacter , in the buffer
i = 0
sData$ = Left(buffer$, lEnd - 1) ; sData will be all characters before lEnd
buffer$ = Mid(buffer$, lEnd + 1, Len(buffer$)) ; We want To delete the Data that we just
; got from the buffer including the ,
Debug sData$ ; Display the Data
lEnd = FindString(buffer$, parseCharacter, 1) ; Gets Starting position of the parseCharacter in the new buffer
i = i + 1
EndIf
Until lEnd
WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra