PDA

View Full Version : Memo - load text file


gpic
06-20-2009, 01:47 PM
Hi.
I'm put on the form a button and Memo. To clicked LBM on the button and wrote next code:
Edit_LoadFromFile(MyMemo$, AppPath$ + "ansi.txt");

MyMemo$ -the name of Memo component.

Run this example on the windows and click on the button,but text not loaded=( In ansi.txt wrote only word Hi
I'm try also erase AppPath$ from code...
Help me=)

p.s. I'm to use ppl 1.53.
p.p.s. Sorry for my bad English.

Nicknack
06-20-2009, 03:08 PM
there is a mistake in swapi.ppl, it isn't up to date in Edit_LoadFromList which is used by your Edit_LoadFromFile.
replace the line ListToStr(slist$, "\n", "", s$); in Edit_LoadFromList to s$=ListToStr(slist$, "\n", "", "");. now your code should work correctly, at least if your input lines (in ansi.txt) are longer than one character ;)
you find swapi.ppl in PPL\RUNTIME\LIB folder.

gpic
06-21-2009, 03:00 PM
Nicknack
Thank you for the tip! It's works :)

kornalius
06-22-2009, 03:31 PM
Hi,

You would need a RichText memo to be able to change selected text font or color. PPL only use a regular memo text field.

gpic
06-23-2009, 12:38 AM
Hi,

You would need a RichText memo to be able to change selected text font or color. PPL only use a regular memo text field.

Thank you Alain.
Have you any example use of RichText ?

p.s. you wrote a little in another thread :)