compile time type checking

compile time type checking

Postby BrandelH » Thu Nov 15, 2012 9: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: Select all  Expand view

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  Expand view
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 ?
BrandelH
 
Posts: 7
Joined: Mon Nov 12, 2012 10:20 am

Re: compile time type checking

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

Re: compile time type checking

Postby BrandelH » Mon Nov 19, 2012 4: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 ;-)
BrandelH
 
Posts: 7
Joined: Mon Nov 12, 2012 10:20 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 127 guests