DCMULTILINE characters left

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

DCMULTILINE characters left

#1 Post by jdsoft »

Hello

How i can keep track of the number of availeble characters in DCMULTILINE?

Code: Select all

@ nLine  , 1            DCMULTILINE oConsulten:Omschrijving   SIZE 100,8   NOHORIZSCROLL  MAXCHARS 950 
On every keystroke i want to show: nnn characters left.
Regards,
Jack Duijf

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCMULTILINE characters left

#2 Post by rdonnay »

Here you go, Jack. This works for me.

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL GetList[0], oBody, cBody, oSay

TEXT INTO cBody WRAP
This is
a test
of the memo
system showing remaining
characters.

ENDTEXT

@ 4,0 DCMULTILINE cBody SIZE 40,10 OBJECT oBody MAXCHARS 300 ;
    EVAL {|o|o:keyboard := DC_MergeBlocks(o:keyboard,{||DC_GetRefresh(oSay)})}

@ 15,0 DCSAY {||IIF(Valtype(oBody)=='O',oBody:maxChars-Len(oBody:editBuffer()),'')} SIZE 30 ;
       SAYOBJECT oSay FONT '16.Lucida Console'

DCREAD GUI FIT TITLE 'Memo Test' ;
   EVAL {||SetAppFocus(oBody), ;
           GoToBottom(oBody)}

RETURN nil

PROC appsys ; return
The eXpress train is coming - and it has more cars.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: DCMULTILINE characters left

#3 Post by jdsoft »

Thank you verry much,
Regards,
Jack Duijf

Post Reply