That one was easy and I was already for it. Numlin returns the number of lines (carriage returns +1) in the a string

Jacques Paris     [EMAIL PROTECTED]  

Paris PC Consult (mainly MapInfo app.)
     www.total.net/~rparis/gisproducts.htm

declare function numlin(byval a as string) as smallint

function numlin(byval a as string) as smallint

dim pos, pos1, k as smallint

numlin=1

k=1

pos=1

boucle:

pos1=instr(pos,a,chr$(10))

if pos1=0 then exit function end if

k=k+1

numlin=k

pos=pos1+1

goto boucle

end function

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Dany Bouchard
Sent: June 29, 2000 10:21 AM
To: [EMAIL PROTECTED]
Subject: MI Mapbasic - Reading if text object has carriage returns

This has to be simple !
I am just trying to figure out if a text object textstring (returned by ObjectInfo(obj, OBJ_INFO_TEXTSTRING) has carriage returns.
Is there an easy way aside from looping through all characters and checking for carriage returns by converting each character using ASC() ?
 
Thanks in advance !
 
Salutations.
 
Dany Bouchard
DBx Geomatics
38 de l'Orbite
Hull, Québec
Canada
J9A 3C7
Téléphone/Telephone: 819.743.3870
Télécopieur/Fax: 819.775.3264
Courrier électronique/Email: [EMAIL PROTECTED]
Page Web/Web site: http://www.dbxgeomatics.com/home.asp
Vitrine technologique SVG / SVG Technology Preview: http://www.dbxgeomatics.com/svg.asp

Reply via email to