Hi All I am a beginner and I am learning Objectscript and I would appreciate a steer regarding a problem I am solving.
The issue I have spent some time on resolving without success is that I have the stream listed below and as you can see it has some gaps in it.
Stream
das
is
wp
dsa
nmkHere is the import method
IF ##class(%File).Exists(dir) '=1 {
write !, "Unable to Open: "_dir
QUIT
} ELSE {
write "File: "_dir_" is open"
}
// instantiate a new class called file
set file = ##class(%Stream.FileCharacter).%New()
// create a new variable called sc
set sc = file.LinkToFile(dir)
set count=1
WHILE ('file.AtEnd) {
set delim=" "
set line = file.ReadLine()
set i=1
write !, "Loop started"
write *32
if (line '="") {
write !, "Read started"
write *32
set ^answers(count)=$LISTFROMSTRING(line, delim)
write *32
set ^attempt(count)=^attempt(count)_$ZHEX(($ASCII($LIST(^answers(count)))))
write "Attempt:", ^attempt(count) ,!
set countdown=$LENGTH(line,delim)
set i=$INCREMENT(i)
set count=$INCREMENT(count)
}
}

.png)


