I can't find the caption of the hash. I mean that I want the
PROMPT "Offerte'" .... // hard coded
tobe
PROMPT hApi["OFFERTE"]:caption // or :key or
I can't find the correct METHOD to find the titel OFFERTE
@ nPos,20 CHECKBOX oCheckbox[1] VAR hApi["OFFERTE"] PROMPT "Offertes" SIZE 80,15 PIXEL OF oDlg
Finding the caption of a Hash
- Marc Venken
- Posts: 1485
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Finding the caption of a Hash
Hi Marc,
I think hApi["OFFERTE"] gets the logical value of the checkbox object and the caption should be oCheckbox[1]:cCaption.
Regards, Detlef
I think hApi["OFFERTE"] gets the logical value of the checkbox object and the caption should be oCheckbox[1]:cCaption.
Regards, Detlef
- Marc Venken
- Posts: 1485
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Finding the caption of a Hash
The caption will be the value I put afther the PROMPT, but that way the value is not the label of the HASH
I know that the keys are searchable with
cZoek = "OFFERTE"
if hb_HHasKey( hData, cZoek )
hApi["OFFERTE"]:cCaption is also giving the error.
Normaly I put a Xbrowser as debugger, but also Xbrowse is only giving : Key and Value
I suppose now that there are no more methos in the Hash. HB_Hash is harbour, so not a source of FW.
I know that the keys are searchable with
cZoek = "OFFERTE"
if hb_HHasKey( hData, cZoek )
hApi["OFFERTE"]:cCaption is also giving the error.
Normaly I put a Xbrowser as debugger, but also Xbrowse is only giving : Key and Value
I suppose now that there are no more methos in the Hash. HB_Hash is harbour, so not a source of FW.
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
Re: Finding the caption of a Hash
I use this function
//-------------------------------------------------------------------------------------------
Function HB_HasTrovato(hVars,xKey,lValore,lUpper)
Local lReturn := .f.
DEFAULT lValore := .f.
DEFAULT lUpper := .t.
IF lUpper
xKey := upper(xKey)
endif
IF HB_ISHASH(hVars) .and. HHasKey( hVars , xKey )
IF lValore
IF VALTYPE(hVars[xKey]) == 'N' .AND. hVars[xKey] > 0
lReturn := .t.
ELSEIF VALTYPE(hVars[xKey]) == 'C' .and. ! empty(hVars[xKey])
lReturn := .t.
ELSEIF VALTYPE(hVars[xKey]) == 'D'
ELSEIF VALTYPE(hVars[xKey]) == 'L'
ENDIF
ELSE
lReturn := .t.
ENDIF
ENDIF
Return lReturn
//-------------------------------------------------------------------------------------------
Function HB_HasTrovato(hVars,xKey,lValore,lUpper)
Local lReturn := .f.
DEFAULT lValore := .f.
DEFAULT lUpper := .t.
IF lUpper
xKey := upper(xKey)
endif
IF HB_ISHASH(hVars) .and. HHasKey( hVars , xKey )
IF lValore
IF VALTYPE(hVars[xKey]) == 'N' .AND. hVars[xKey] > 0
lReturn := .t.
ELSEIF VALTYPE(hVars[xKey]) == 'C' .and. ! empty(hVars[xKey])
lReturn := .t.
ELSEIF VALTYPE(hVars[xKey]) == 'D'
ELSEIF VALTYPE(hVars[xKey]) == 'L'
ENDIF
ELSE
lReturn := .t.
ENDIF
ENDIF
Return lReturn
- Otto
- Posts: 6414
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 29 times
- Been thanked: 2 times
- Contact:
Re: Finding the caption of a Hash
Marc,
A hash table is built from key/value pairs.
Here is a link to the manual: https://harbour.github.io/doc/
Bookmark:
https://winhotel.space/modharbour/modharbouronline.prg

Best regard,
Otto
A hash table is built from key/value pairs.
Here is a link to the manual: https://harbour.github.io/doc/
Bookmark:
https://winhotel.space/modharbour/modharbouronline.prg

Best regard,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Otto
- Posts: 6414
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 29 times
- Been thanked: 2 times
- Contact:
Re: Finding the caption of a Hash
Hello Marc,
testing Checkbox I noticed that on Change is not evaluated when you create the checkbox.
You have to evaluate from ON INIT of the ACTIVATE WINDOW.
Best regards,
Otto
PS: Editing with AUTOCODE

testing Checkbox I noticed that on Change is not evaluated when you create the checkbox.
You have to evaluate from ON INIT of the ACTIVATE WINDOW.
Best regards,
Otto
Code: Select all | Expand
// A simple test with a checkbox
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------------------//
function Main()
local lValue := .t., oChk
DEFINE WINDOW oWnd TITLE "Testing CheckBox ON CHANGE clause"
@ 3,3 ;
CHECKBOX oChk ;
VAR lValue ;
PROMPT "&ClickMe" ;
SIZE 100, 20 ;
OF oWnd ;
COLOR "W+/B" ;
ON CHANGE ( iif( oChk:lchecked=.T.,oChk:SetText( "New Text" ), oChk:SetText( "&ClickMe" ) ) )
ACTIVATE WINDOW oWnd ON INIT ( iif( oChk:lchecked=.T.,oChk:SetText( "New Text" ), oChk:SetText( "&ClickMe" ) ) )
return nil
//----------------------------------------------------------------------------//
PS: Editing with AUTOCODE

********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Marc Venken
- Posts: 1485
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Finding the caption of a Hash
Looking at the functions this code is working
@ nPos,20 CHECKBOX oCheckbox[1] VAR hApi["OFFERTE"] PROMPT hb_HKeyAt( hApi, hb_HPos( hApi, "OFFERTE" ) ) SIZE 80,15 PIXEL OF oDlg
Now I can change the hardcode text with random fields.
Thanks
@ nPos,20 CHECKBOX oCheckbox[1] VAR hApi["OFFERTE"] PROMPT hb_HKeyAt( hApi, hb_HPos( hApi, "OFFERTE" ) ) SIZE 80,15 PIXEL OF oDlg
Now I can change the hardcode text with random fields.
Thanks
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour