Files
harbour-core/harbour/include/hbexprb.c
Przemyslaw Czerpak bb86055fe6 2010-03-01 00:50 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbpcode.h
  * harbour/include/hbxvm.h
  * harbour/src/compiler/hbfix.c
  * harbour/src/compiler/hbpcode.c
  * harbour/src/compiler/hbdead.c
  * harbour/src/compiler/genc.c
  * harbour/src/compiler/hbopt.c
  * harbour/src/compiler/gencc.c
  * harbour/src/compiler/hblbl.c
  * harbour/src/compiler/hbstripl.c
  * harbour/src/vm/hvm.c
    + added new PCODE HB_P_PUSHAPARAMS and -gc3 function with corresponding
      action hb_xvmPushAParams

  * harbour/include/hbexprb.c
  * harbour/src/common/expropt1.c
  * harbour/src/vm/hvm.c
    + added support for special PRG function:
         HB_ARRAYTOPARAMS( <aValue> ) -> <aValue>[ 1 ] [, <aValue>[ N ] ]
      It can be used in the same context as multivalue macros
      or ... operator and converts array to list of parameters, i.e.:
         proc main
            local aValue, aIndexes

            aValue := { 1, { 2, 3, "abcde" } }
            aIndexes := { 2, 3 }
            ? "array:",    hb_valToExp( aValue )
            ? "indexes:",  hb_arrayToParams( aIndexes )

            ? "array[", hb_arrayToParams( aIndexes ), "] =>", ;
               aValue[ hb_arrayToParams( aIndexes ) ]
            aValue[ hb_arrayToParams( aIndexes ) ] += ":add"
            ? "array:",    hb_valToExp( aValue )

            aValue := { "test", aValue }
            aIndexes := { 2, hb_arrayToParams( aIndexes ) }
            ? "array:",    hb_valToExp( aValue )
            ? "indexes:",  hb_arrayToParams( aIndexes )
            ? "array[", hb_arrayToParams( aIndexes ), "] =>", ;
               aValue[ hb_arrayToParams( aIndexes ) ]
         return
2010-02-28 23:52:05 +00:00

174 KiB