Unable to convert from 'Int' to 'Int()' ?????
BlitzMax Forums/BlitzMax Programming/Unable to convert from 'Int' to 'Int()' ????? Count is a method, not a field.
CheckCount = MyList.Count()
That's just a typo (Note: Typo is fixed in edit). The error still occurs with the "()" there.
That worked, thank you
I don't see why the code as written above wouldn't work. You should be able to assign the result of a method to a variable. So either you have:
A. A bug with BlitzMAX which needs to be hunted down and fixed
B. A problem with your program elsewhere, which still hasn't been fixed and will create weird bugs later on.
In all probability, I'd say it is B. Are you running Superstrict? That will catch a lot of bugs you might otherwise miss.
Of course, there is still the possibility that:
C. I don't really understand methods like I thought I did and you really can't assign the result to a variable.
A. A bug with BlitzMAX which needs to be hunted down and fixed
B. A problem with your program elsewhere, which still hasn't been fixed and will create weird bugs later on.
In all probability, I'd say it is B. Are you running Superstrict? That will catch a lot of bugs you might otherwise miss.
Of course, there is still the possibility that:
C. I don't really understand methods like I thought I did and you really can't assign the result to a variable.
That first code works for me...
The actual error message matches what Gabriel posted so, maybe, Wilkua missed something before editing the original post?
Function AddToMyList(Txt$) Local CheckCount:Int MyList.AddLast(Txt$) CheckCount = MyList.Count() If CheckCount > 2 Then MyList.RemoveFirst() EndIf Print "Start" For Local all:String=EachIn mylist Print all Next Print "end" EndFunction Global mylist:TList=CreateList() For Local num:Int= 0 To 3 addtomylist(String(num)) Next
The actual error message matches what Gabriel posted so, maybe, Wilkua missed something before editing the original post?