2006-09-20 14:15 UTC+0100 Ryszard Glab <rglab//imid.med.pl>
* include/hbpcode.h
+ added new pcode HB_P_VFRAME
* include/hbapi.h
+ added USHORT paramdeclcnt to asSymbol structure
* include/hbstack.h
* source/vm/estack.c
+ added hb_stackLocalVariable() to acces local variables
* source/compiler/genc.c
* source/compiler/gencc.c
* source/compiler/harbour.c
* source/compiler/harbour.l
* source/compiler/harbour.y
* source/compiler/hbdead.c
* source/compiler/hbfix.c
* source/compiler/hblbl.c
* source/compiler/hbpcode.c
* source/compiler/hbstripl.c
* source/vm/hvm.c
+ added support for variable number of parameters in
functions/procedures
+ tests/varparam.prg
* example usage of new syntax for variable number of
parameters
* source/vm/arrayshb.c
* changed HB_APARAMS() to use current stack frame if no
arguments are passed ( HB_APARAMS() == HB_APARAMS(0) )
SYNTAX for variable number of parameters
1) [FUNCTION|PROCEDURE] name( ... )
or
2) [FUNCTION|PROCEDURE] name( var1, var2, varN, ... )
To access passed parameters use the following:
PCOUNT() - returns number of passed parameters
HB_PVALUE( iParamNum ) - returns <iParamNum> parameter
HB_APARAMS() - returns array with all passed parameters
or usual name of parameter variable in case of syntax 2)
This commit is contained in:
@@ -220,8 +220,8 @@ typedef enum
|
||||
HB_P_MACROSEND, /* 146 send operator with macrlist params */
|
||||
HB_P_PUSHOVARREF, /* 147 pushes reference to object variable */
|
||||
HB_P_ARRAYPUSHREF, /* 148 pushes reference to array element */
|
||||
/* NOTE: This have to be the last definition */
|
||||
HB_P_LAST_PCODE /* 149 this defines the number of defined pcodes */
|
||||
HB_P_VFRAME, /* 149 frame with variable number of parameters */
|
||||
HB_P_LAST_PCODE /* 150 this defines the number of defined pcodes */
|
||||
} HB_PCODE;
|
||||
|
||||
#endif /* HB_PCODE_H_ */
|
||||
|
||||
Reference in New Issue
Block a user