Hi,
I have textArea then if I want to use Declare function for count num of line in TextArea1.text
I write code
Declare Function GetDiskFreeSpaceExW Lib “Kernel32” (dirname As WString, ByRef freeBytesAvailable As UInt64, _
ByRef totalbytes As UInt64, ByRef totalFreeBytes As UInt64) As Integer
I would recommend you only use declares when absolutely necessary.
Using the built-in Xojo functions, such as “CountFields”, make it much easier to compile your application for all the supported platforms (e.g. Windows, OS X and Linux).
[quote=137425:@Dave S]
Dim LineNumber as integer = me.LineNumAtCharPos(me.len)
won’t move the selection area or cursor[/quote]
DOH! Much better. Not sure why I didn’t think of that.
I didn’t either until a couple of weeks ago. I am trying to develop what is basically a VT-100 terminal emulator of sorts (since none of the existing projects out there work or are supported any longer). I needed to be able to determine what line I am on in a text area. So I spent some time digging around looking at the methods of a text area and found a number of useful things. Get the line number a particular character position is at, get the first character at a particular line number, etc. There’s a lot of things buried in the text area’s capabilities.