This is the documentation of HB_Decode(...) function:
- Code: Select all Expand view
- HB_Decode( <xInitVal>, <xCase1>, <xRet1> , ;
[<xCaseN>, <xRetN>], ;
[<xDefault>] ) --> xReturn
or
HB_Decode( <xInitVal>, <hHash>, [<xDefault>] ) --> xReturn
But even the sample given in the documentations fails and results in runtime error:
- Code: Select all Expand view
- #include 'fivewin.ch'
PROCEDURE Main
LOCAL nChoice, hHash := {=>}
hHash := { 0 => "Yesterday", ;
1 => "Today" , ;
2 => "Tomorrow" }
nChoice := 0
? HB_Decode( nChoice, hHash, "Never" ) // result: Yesterday
nChoice := 3
? HB_Decode( nChoice, hHash, "Never" ) // result: Never
RETURN
Error:
- Code: Select all Expand view
- Application
===========
Path and name: C:\tests\fwh905\Bin\dcodtest.Exe (32 bits)
Size: 1,541,632 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 09/22/10, 10:57:34
Error description: Error BASE/1070 Argument error: ==
Args:
[ 1] = H {=>}
[ 2] = N 0
Stack Calls
===========
Called from: source\rtl\decode.prg => (b)HB_DECODE(214)
Called from: => ASCAN(0)
Called from: source\rtl\decode.prg => HB_DECODE(214)
Called from: Source\dcodtest.prg => MAIN(13)