I have 9 button
when I press a button return allway 9
nRow:=30
For n= 1 to 9
@ nRow,2 BTNBMP aBtnCalc[n] PROMPT ltrim(str(n+1)) FLAT SIZE 20,30 PIXEL of oDlg ;
ACTION AddItems(oInvoice,aItems,GenBlock_(n),@nRowItems,fromdate,Todate)
nRow+=32
NEXt
fUNCTION GenBlock_(n)
RETURN n
and I Wish insert on GenBlock_(n) a right number (n)
genblock
- Silvio.Falconi
- Posts: 7134
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
genblock
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Re: genblock
dear Silvio,
search the forum for detached locals.
Or have a look here http://forums.fivetechsupport.com/viewt ... ched+local
Regards, Detlef
search the forum for detached locals.
Or have a look here http://forums.fivetechsupport.com/viewt ... ched+local
Regards, Detlef
Re: genblock
Because ACTION clause generates an "internal" codeblock, so run ok:
Code: Select all | Expand
nRow:=30
For n= 1 to 9
#Define PARAMS1_ oDlg, aBtnCalc, nRow, n, oInvoice, aItems, @nRowItems, fromdate, Todate
#Define PARAMS2_ oDlg, aBtnCalc, nRow, n, oInvoice, aItems, nRowItems, fromdate, Todate
GenButton(PARAMS1_)
nRow+=32
NEXt
fUNCTION GenButton(PARAMS2_)
@ nRow,2 BTNBMP aBtnCalc[n] PROMPT ltrim(str(n+1)) FLAT SIZE 20,30 PIXEL of oDlg ;
ACTION AddItems(oInvoice,aItems,n,@nRowItems,fromdate,Todate)
RETURN NIL
- Silvio.Falconi
- Posts: 7134
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: genblock
Sorry I explain
I making a multiple invoice for beach management
in managing the beach, in addition to individual customers, there are associations or hotels that can book an x number of umbrellas, instead of placing an order for each umbrella at the hotel, I thought of making a multiple order and assigning XXXX n umbrellas to the hotel.
look this picture
![Image](https://i.postimg.cc/t45XNtbr/ser.png)
to assign the umbrellas the operator presses one of the numerical buttons that are on the left and then selects a button that is inside the first scrollable panel
on First Scroll Panel If I select one button it return allways 04
on source on a for next cicle I create the buttons into scrollpanel and the assign an action for each button
aBtnEle[n]:bAction :={ || (Elemento:= nProduct ,msginfo(nProduct))}
nProduct id the code of an array
nProduct:= aElements[n][1]
but perhaps n is allways 4
How I can resolve ?
I making a multiple invoice for beach management
in managing the beach, in addition to individual customers, there are associations or hotels that can book an x number of umbrellas, instead of placing an order for each umbrella at the hotel, I thought of making a multiple order and assigning XXXX n umbrellas to the hotel.
look this picture
![Image](https://i.postimg.cc/t45XNtbr/ser.png)
to assign the umbrellas the operator presses one of the numerical buttons that are on the left and then selects a button that is inside the first scrollable panel
on First Scroll Panel If I select one button it return allways 04
on source on a for next cicle I create the buttons into scrollpanel and the assign an action for each button
aBtnEle[n]:bAction :={ || (Elemento:= nProduct ,msginfo(nProduct))}
nProduct id the code of an array
nProduct:= aElements[n][1]
but perhaps n is allways 4
How I can resolve ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Re: genblock
hi Silvo,
as Detlef say : detached Locals
when build in a "Loop" and use "Counter" you must call a Function to build a String for Codeblock
so your "Counter" Number will be a STR() in a String
---
about "04" : on right side of Button you have some Listbox ... how many Element have 1st Listbox ?
as Detlef say : detached Locals
when build in a "Loop" and use "Counter" you must call a Function to build a String for Codeblock
so your "Counter" Number will be a STR() in a String
Code: Select all | Expand
FOR ii := 1 TO 26 // A-Z
@ 40, ( ii - 1 ) * ( ( nBB * 2 ) + 2 ) BTNBMP oBtn SIZE nBB * 2, nBB PIXEL OF oMain ;
PROMPT cDrive LEFT ;
RESNAME cBitmap ;
FONT oFontDefault COLOR BFcolor, BGcolor
bBlock := DetachBlock(ii)
oBtn:bAction := bBlock
Code: Select all | Expand
FUNCTION DetachBlock( ii )
LOCAL cBlock := "{|| msgInfo(" + STR( ii ) + ")}"
LOCAL bBlock
bBlock := &cBlock
RETURN bBlock
about "04" : on right side of Button you have some Listbox ... how many Element have 1st Listbox ?
greeting,
Jimmy
Jimmy
- Silvio.Falconi
- Posts: 7134
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: genblock
I resolved with cargo
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com