diff --git a/components/codetools/codecompletiontool.pas b/components/codetools/codecompletiontool.pas index 451541448a..bf3a846f67 100644 --- a/components/codetools/codecompletiontool.pas +++ b/components/codetools/codecompletiontool.pas @@ -6085,7 +6085,7 @@ begin case ExprType.Desc of xtContext: begin - // ToDo: sets, ranges, records, objects, pointer, class, class of, interface + // ToDo: ranges, records, objects, pointer, class, class of, interface Node:=ExprType.Context.Node; Tool:=ExprType.Context.Tool; case Node.Desc of @@ -6130,6 +6130,11 @@ begin xtUnicodeString: AddAssignment(''''''); xtPChar: begin AddAssignment('nil'); AddAssignment('#0'); end; xtPointer: AddAssignment('nil'); + xtConstOrdInteger: AddAssignment('0'); + xtConstString: AddAssignment(''''''); + xtConstReal: AddAssignment('0.0'); + xtConstSet: AddAssignment('[]'); + xtConstBoolean: begin AddAssignment('False'); AddAssignment('True'); end; xtLongint, xtLongWord, xtWord, diff --git a/components/codetools/examples/scanexamples/initvars1.pas b/components/codetools/examples/scanexamples/initvars1.pas index 1a087de3d0..098eafbcf4 100644 --- a/components/codetools/examples/scanexamples/initvars1.pas +++ b/components/codetools/examples/scanexamples/initvars1.pas @@ -22,7 +22,8 @@ begin end; procedure TestLots({%H-}s: string; {%H-}c: char; {%H-}p: pointer; - {%H-}SignalState: TSignalState; {%H-}ShiftState: TShiftState); + {%H-}SignalState: TSignalState; {%H-}ShiftState: TShiftState; + {%H-}HelpCtx: THelpContext); begin end; @@ -34,8 +35,9 @@ var p: Pointer; SignalState: TSignalState; ShiftState: TShiftState; + HelpCtx: THelpContext; begin - TestLots(s,c,p,SignalState,ShiftState); + TestLots(s,c,p,SignalState,ShiftState,HelpCtx); end; end.