Why is the Compiler warning that variable may not be initialized?

后端 未结 3 1141
误落风尘
误落风尘 2020-12-21 03:26

I am getting a compiler warning I don\'t understand:

procedure Test;
var
  Var1: Integer;
begin
    while True do
    begin
        try
            if System         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-21 04:09

    It is a farily good warning. What it tells that you do not assign any value to the variable which may be used somewhere else in your code. Warning also tells that if it's used then the value assigned to it may be not what you expect.

提交回复
热议问题