Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get line no text selection start and end postion
Message
De
22/11/1999 07:04:52
 
 
À
21/11/1999 10:52:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00293435
Message ID:
00293840
Vues:
37
Thanks a lot it is great help to me

cheers
Taufeeq


>I don't think that you should use memo+editbox. Look at VFP import wizard, you can write your own similar interface, i.e. firstly you get file into one-field (memo) cursor and show it in grid. Then user may define number and format of columns interactively, and next grid will get next cursor (memo field parsed to separate fields) accordingly. If number of lines in ASCII is too big you can compromise by sample processing, i.e. show/process e.g. first 10 lines of ASCII file, and when it's finished, process whole file.
>
>>Ed and David,
>>Your ideas are great.
>>The problem is that I am writing a import engine which will map the ASCII data file to field of a table and instead of giving the user to manually enter the postion of each field I want the users to just visuall select the data against each field name. Also can you suggest me any other control which can give me both Scroll so that I can pick the starting and end position of a text visually no matter what would be the length of ASCII Data.
>>
>>Have a nice day.
>>
>>cheers
>>
>>Taufeeq
>>
>>>Ed,
>>>
>>>FWIW, there's little chance that the code will work. The SET MEMOWIDTH affects memlines and neither one have anything to do with the font properties of the editbox which will control the percieved line breaks inside the control.
>>>
>>>>>Can anyone has an idea how can we get start and end position of selection relative to line in multi line edit box. I have used selstart and sellength but it always give me the postion from the first line of editbox text.
>>>>>
>>>>>Thanks
>>>>
>>>>You can count length of eac line in memo, and calculate the needed position:
>>>>
>>>>function getrelativeselstart
>>>>lparameter nSelstart   && this is editbox.selstart property
>>>>nLines=memlines(memofield)
>>>>nLength=0
>>>>For n=1 to nLines
>>>> if nLength+len(mline(memofield,n))+2>nSelstart
>>>>   return nSelstart-nLength
>>>> endif
>>>> nLength=nLength+len(mline(memofield,n))+2  && allow 2 for chr(13)+chr(10)
>>>>Endfor
>>>>
>>>>
>>>>This is the idea. I did not test this code so check it carefully when implementing.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform