Error in a class : default variable

Error in a class : default variable

Postby Silvio » Fri Jan 27, 2006 2:27 am

in xharbour or habour in a class there is this line :

Code: Select all  Expand view
Default nWidth  = 25, ;
           nHeight = 25


but when i compiled make an error
Code: Select all  Expand view
Error E0030  Syntax error: "parse error at 'NWIDTH'"


How ca I resolve it

Regards,
silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby StefanHaupt » Fri Jan 27, 2006 8:27 am

Silvio,

you missed the double point, this is correct:

Code: Select all  Expand view
DEFAULT nWidth := 25 ,;
                       nHeight :=25


Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Postby R.F. » Fri Jan 27, 2006 5:02 pm

Please notice that "DEFAULT" is a command written in the FIVEWIN.CH header file.

If you don't include the FIVEWIN.CH file in you programm you will not have the DEFAULT command available, so the compiling process will fail.

Anyway if you are not using FIVEWIN with your class, you can write the command yourself in the source code or include it in any other header file:

Code: Select all  Expand view
#xcommand DEFAULT <uVar1> := <uVal1> ;
               [, <uVarN> := <uValN> ] => ;
                  <uVar1> := If( <uVar1> == nil, <uVal1>, <uVar1> ) ;;
                [ <uVarN> := If( <uVarN> == nil, <uValN>, <uVarN> ); ]
Saludos
R.F.
R.F.
 
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Postby Silvio » Fri Jan 27, 2006 11:54 pm

thank to all
this class printer is modified by klm but in xharbout not runned : now run ok
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 89 guests