Home > Archive > Programming with dBASE > November 2005 > Number of lines on a editor









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Number of lines on a editor
evilaro

2005-11-22, 8:23 pm

To all:


I wonder how could I find out the ammount of lines
that a edito (not linked to a memofield) has.

this
--------------
1
3

4
5

7

------------------

should give 8

thanks

Emilio


Martin

2005-11-23, 7:23 am

Try this :

nCount = 0
vstr = form.ed.value

do while at( chr(13), vstr ) <> 0
ncount++
vstr = substr( vstr, at( chr(13), vstr ) + 1 )
enddo
msgbox( ""+ nCount )

Martin


"evilaro" <buzon@evil.es> wrote in message
news:aNAKkP77FHA.1232@news-server...
> To all:
>
>
> I wonder how could I find out the ammount of lines
> that a edito (not linked to a memofield) has.
>
> this
> --------------
> 1
> 3
>
> 4
> 5
>
> 7
>
> ------------------
>
> should give 8
>
> thanks
>
> Emilio
>
>



Jean-Pierre Martel

2005-11-23, 11:23 am

In article <aNAKkP77FHA.1232@news-server>, buzon@evil.es says...
>
> I wonder how could I find out the ammount of lines
> that a edito (not linked to a memofield) has.


You could use the code below.

Jean-Pierre Martel, editor
The dBASE Developers Bulletin
Blue Star dBASE Plus Core Concepts Graduate

P.S.- Looking at my log files, it seems you had trouble downloading my
new screen saver? Finally did you succeeded?

=========== Beginning of the code ==========

** END HEADER -- do not remove this line
//
// Generated on 23/11/05
//
parameter bModal
local f
f = new EvilaroForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif

class EvilaroForm of FORM
with (this)
metric = 6 // Pixels
height = 247.0
left = 371.0
top = 0.0
width = 280.0
text = ""
endwith

this.EDITOR1 = new EDITOR(this)
with (this.EDITOR1)
height = 186.0
left = 32.0
top = 40.0
width = 217.0
value = ""
fontSize = 8.0
endwith

this.PUSHBUTTON1 = new PUSHBUTTON(this)
with (this.PUSHBUTTON1)
onClick = class::PUSHBUTTON1_O
NCLICK
height = 21.0
left = 33.0
top = 15.0
width = 149.0
text = "Count lines in editor"
fontSize = 8.0
endwith


function PUSHBUTTON1_onClick
local n, oldColNo, oldRowNo
oldColNo = Form.editor1.ColumnNo
oldRowNo = Form.editor1.LineNo
form.editor1.keyboard("{Ctrl-End}")
msgBox("There are " + form.editor1.LineNo + ;
" lines in the editor ")
Form.editor1.LineNo = oldRowNo
Form.editor1.ColumnNo = oldColNo
Form.editor1.setFocus()
return

endclass
=========== End of the code ==========
evilaro

2005-11-23, 11:23 am

Martin:

If the wrap is false it works fine ..
but with the wrap on it does not
do what I want.

Thanks

Emilio



"Martin" <martin@programa.co.id> escribió en el mensaje
news:urOvsw97FHA.1520@news-server...
> Try this :
>
> nCount = 0
> vstr = form.ed.value
>
> do while at( chr(13), vstr ) <> 0
> ncount++
> vstr = substr( vstr, at( chr(13), vstr ) + 1 )
> enddo
> msgbox( ""+ nCount )
>
> Martin
>
>



evilaro

2005-11-23, 11:23 am



> You could use the code below.


grrrrrrrrrrrrrrrr yes I will use it...
but the only reason I will use it ... is because it works ...... ;)



> P.S.- Looking at my log files, it seems you had trouble downloading my
> new screen saver? Finally did you succeeded?


Today I got it.

Beautiful shots and presentation,,,
Congratulations.

Emilio




Jean-Pierre Martel

2005-11-23, 8:23 pm

In article <iEy6SHF8FHA.1228@news-server>, buzon@evil.es says...
>
>
> but the only reason I will use it ...
> is because it works ...... ;)


That's a very good reason. It's enough to convince me too. ;-)

> Today I got it.
> Beautiful shots and presentation,,,
> Congratulations.


You're welcome.

Jean-Pierre Martel, editor
The dBASE Developers Bulletin
Blue Star dBASE Plus Core Concepts Graduate
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com