I am trying to take an integer and put it into a file to then be used later in my program.
In the Personal addition I can't write an integer to a file, I have tried the myriad of options that I have discovered through material.
My current partial solution is to create a string and save in a file. I can then open the file and read the string and using toTerm create integers. Great!
What I actually need to do is save each element in the integer list to a different variable InAttribute1.. I can't use count as it gets set to 1 each time the process is called and an internally will get reset every time the procedure is called which does not allow me control.
If I could save as an integer and open and store as an integer this would be a lot easier.
Code: Select all
foreach S in StrList do
processStrList(S, Count)
end foreach,
class predicates
processStrList : (string Data, integer Count).
clauses
processStrList(ABC, Count) :-
IntA = toTerm(integer, ABC),
if Count = 1 then
InAttribute = IntA,
stdio::write("Attribute1 is ", InAttribute)
end if,
fail.
processStrList(_I, _S).
Code: Select all
Attribute1 = StrList[1],
Does anyone have any suggestions on how to achieve placing each integer into a different variable