Page 1 of 1

Error in a class : default variable

PostPosted: Fri Jan 27, 2006 2:27 am
by Silvio
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

PostPosted: Fri Jan 27, 2006 8:27 am
by StefanHaupt
Silvio,

you missed the double point, this is correct:

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


Stefan

PostPosted: Fri Jan 27, 2006 5:02 pm
by R.F.
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> ); ]

PostPosted: Fri Jan 27, 2006 11:54 pm
by Silvio
thank to all
this class printer is modified by klm but in xharbout not runned : now run ok