Hi
this function like Web site Send SMS input UI.
Redefine GET ... ON CHNAGE....
I need show how many space can input in GET Object.
The problem is ON CHANGE can't Refresh other Object of FWH.
Source code:
***********************************
nLEFT1:=LEN(PAY->RMK1)-LEN(TRIM(PAY->RMK1))
nLEFT2:=LEN(PAY->RMK2)-LEN(TRIM(PAY->RMK2))
REDEFINE GET PAY->RMK1 ID 21 OF oDlg ;
ON CHANGE LEFT_SHOW(1) ;
UPDATE
REDEFINE GET PAY->RMK2 ID 23 OF oDlg ;
ON CHANGE LEFT_SHOW(2) ;
UPDATE
REDEFINE SAY oLEFT1 PROMPT nLEFT1 PICTURE "99" ID 12 OF oDlg ;
UPDATE
REDEFINE SAY oLEFT2 PROMPT nLEFT2 PICTURE "99" ID 14 OF oDlg ;
UPDATE
....
************************
STATIC FUNCTION LEFT_SHOW(nLINE)
DO CASE
CASE nLINE=1
nLEFT1:=LEN(PAY->RMK1)-LEN(TRIM(PAY->RMK1))
oLEFT1:REFRESH() ==> NOT WORK
CASE nLINE=2
nLEFT2:=LEN(PAY->RMK2)-LEN(TRIM(PAY->RMK2))
oLEFT2:REFRESH() ==> NOT WORK
ENDCASE
RETURN NIL
**************************************
How to count input word in TGet?
- richard-service
- Posts: 583
- Joined: Tue Oct 16, 2007 8:57 am
- Location: New Taipei City, Taiwan
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- richard-service
- Posts: 583
- Joined: Tue Oct 16, 2007 8:57 am
- Location: New Taipei City, Taiwan
- Contact:
- kokookao2007
- Posts: 59
- Joined: Thu May 17, 2007 8:27 am
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Please try this code. You can use the same logic to achieve what you want.
Whenever the user enters a character in the get, the say displays the remaining number of characters he can enter.
Code: Select all
FUNCTION Main()
LOCAL oDlg,oFont
LOCAL nLen := 20
LOCAL nRem := 20
LOCAL cVar := SPACE(20)
LOCAL oSay, oGet
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
DEFINE DIALOG oDlg SIZE 300,200 PIXEL
@ 10,10 GET oGet VAR cVar SIZE 100,12 PIXEL OF oDlg ON CHANGE oSay:Refresh()
@ 10,120 SAY oSay PROMPT STR( 20 - LEN(TRIM(oGet:cText)), 3, 0 ) SIZE 20,10 PIXEL OF oDlg COLOR CLR_BLACK,CLR_WHITE
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
RETURN NIL
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- kokookao2007
- Posts: 59
- Joined: Thu May 17, 2007 8:27 am
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact: