I am using Delphi 10 Starter Edition. I create a Tstringlist "Mylist:=tstringlist.create;"in my main form. I use it in a procedure in a unit that includes the main form in the "uses" list My main unit refers to the using unit in its "uses" clause. I do something like MyList.clear; in the procedure in the unit. The code auto completes fine, suggesting the stringlist is recognised. I run the project, and it hangs at the line that refers to the string list: "MyList.clear;". The error message is "Project xxx raised exception class $C0000005 with access violation at 0x0065c042: read of address 0x00000000". I have to use a local string list in the procedure, which means I cannot access it globally. This happens with every string list I declare in the main form, and try and use in another form. I have made sure the "uses" is correct. Any suggestions? If I have posted this in the wrong place, let me know where I should go and I'll try again. Thanks.
↧