hello everyone,
I'm using KRC4 and kss 8.3.8
I would like to read some data from data.txt file into array via KRL. I know that I can open file with cread, but how to parse the data then? Example of data.txt:
1
2
3
4
So what I need to get after reading is data[1]=1, data[2]=2 , etc.
I need to use cwrite If I understood that correctly, so I tried this:
DEF reading( )
decl char testchar
;FOLD INI;%{PE}
;FOLD BASISTECH INI
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
;ENDFOLD (BASISTECH INI)
;FOLD USER INI
;Make your modifications here
;ENDFOLD (USER INI)
;ENDFOLD (INI)
testchar=0
CWRITE($FCT_CALL,STAT,MODE,"krl_fopen","test.txt",testchar, HANDLE)
CWRITE($FCT_CALL,STAT,MODE,"krl_fclose",HANDLE)
END
But my testchar is empty all the time.
Here is my text.txt:
1