compile time type checking

Post Reply
BrandelH
Posts: 7
Joined: Mon Nov 12, 2012 10:20 am

compile time type checking

Post by BrandelH »

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: Select all

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: Select all

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 ?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: compile time type checking

Post by Antonio Linares »

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/?fromgr ... bour-devel

thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
BrandelH
Posts: 7
Joined: Mon Nov 12, 2012 10:20 am

Re: compile time type checking

Post by BrandelH »

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