FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour compile time type checking
Posts: 7
Joined: Mon Nov 12, 2012 10:20 AM
compile time type checking
Posted: Thu Nov 15, 2012 09:45 AM
Hi,

I red about the feature from harbour to check the type of a variable at compile time.
So I tried it, but I do not get any warnings at compile time.

Here is the code of t.prg :
Code (fw): Select all Collapse
function main()
   local sTxt  := "Hallo äöü ß @ € "
   local nZahl := 5
   cls
   ?
   ? sTxt,nZahl
   ? MyFunc()
   ? "Ergebnis: ", sTxt * nZahl
   wait
return 0

function MyFunc()
   local sTxt as CHARACTER
   local nZahl as numeric

   sTxt  := "Hallo äöü ß @ € "
   nZahl := 5

return sTxt + nZahl

this ist the screen from compiler (I did delete the *.OBJ and *.EXE before):

Code (fw): Select all Collapse
C:\TEMP\test>hbmk2 t /W3
Harbour 3.2.0dev (Rev. 17516)
Copyright (c) 1999-2012, http://harbour-project.org/
Compiling 't.prg'...
Lines 21, Functions/Procedures 2
Generating C source output to 'c:\temp\hbmk_6silnj.dir\t.c'... Done.
c:\temp\hbmk_6silnj.dir\t.c:
Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
C:\TEMP\test>


hbmk2 t /W3 <= this line should report the num + string type error at compiletime or ?
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: compile time type checking
Posted: Thu Nov 15, 2012 11:34 AM
Hubert,

I have tested your example and I get your same results.

Better comment it at the Harbour developers list:
https://groups.google.com/forum/?fromgroups#!forum/harbour-devel

thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7
Joined: Mon Nov 12, 2012 10:20 AM
Re: compile time type checking
Posted: Mon Nov 19, 2012 04:09 PM

Thanks for the LINK, I posted there 4 days ago, 15 reads, no answer.
It looks like they are busy at the moment ;-)

Continue the discussion