Line 01 MEMVAR _HMG_SYSDATA
Line 02
Line 03 #include "hmg.ch"
Line 04
Line 05 FUNCTION main()
Line 06
Line 07 LOCAL cLocalVar := ""
Line 08
Line 09 cLocalVar := GetCurrentFolder()
Line 10
Line 11 MSGSTOP( cLocalVar )
Line 12
Line 13 RETURN NIL
Line 14
Line 15 FUNCTION Other()
Line 16
Line 17 LOCAL cLocalVar
Line 18
Line 19 cLocalVar := GetCurrentFolder()
Line 20
Line 21 MSGSTOP( cLocalVar )
Line 22
Line 23 RETURN NIL
This is the message IF the source is compiled with warning level 3
hbmk2: Processing configuration: D:\HMG\MiniGui\harbour\bin\hbmk.cfg
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
hbwarntest.prg(15) Warning W0032 Variable 'CLOCALVAR' is assigned but not used in function 'MAIN(7)'
If I set warning level to zero no message displayed (of course)
As you can see, in one case raises the alert while the other not.
(without assigned value); only the first row give me warning
Any way many thanks.
Hi l3whmg
Is the normal Harbour behaviour of switch -w3
If you assign the "" to cLocalVar and later in the code assign another value then the first assignement is unused, but if you set LOCAL cLocalVar := "" and later use: cLocalVar += "something" then there is no warning.
If you assign the "" to cLocalVar and later in the code assign another value then the first assignement is unused, but if you set LOCAL cLocalVar := "" and later use: cLocalVar += "something" then there is no warning.
Nice explanation Carlos. Thanks.
East or West HMG is the Best. South or North HMG is worth.
...the possibilities are endless.
Hi Carlos, many thanks for you answer.
I had sensed this "behaviour" but I was hoping there was an alternative.
Any way, I will try to align the source code to this rule.
Many thanks