use of memoedit doesn't work correctly

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

use of memoedit doesn't work correctly

#1 Post by obelix »

Hi everybody,
I'm using the following code:

m_baustein:="example"
cmemo:=MemoRead(m_baustein)
//cmemo is "" instead of "example"
cmemo:=DC_GuiMemoEdit(cmemo,7,3,tiefe,weite+3)
// cmemo is the edited text
ok=MemoWrit(m_baustein,cmemo)
// of ist false, m_baustein is "example" instead of the text edited in memoedit()

1. What's wrong with my code?
2. Is it possible to change the font used in the DC_GuiMemoEdit()-Window?
quiet old but still young and unskilled in express++

User avatar
Tom
Posts: 1179
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: use of memoedit doesn't work correctly

#2 Post by Tom »

MemoRead expects a filename and returns it's contens. Is there a file named "example" (without extension)? I assume you're trying to edit the contens of "m_baustein" instead of the contens of a file called "example". Right?

DC_GuiMemoEdit works with "8.Courier" as the fixed editing font. You may just take the code for "DC_GuiMemoEdit" from _DCMEMOE.PRG (..\Source\DCLIPX), add it to your code, rename the function and replace font settings (search&replace "8.Courier").
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
Tom
Posts: 1179
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: use of memoedit doesn't work correctly

#3 Post by Tom »

Code: Select all

m_baustein:="example"
cmemo:=DC_GuiMemoEdit(m_baustein,7,3,tiefe,weite+3)
* cMemo is the edited text, m_baustein is still "example"
* write to disk:
MemoWrit("c:\test\example.txt",cMemo)
Instead of using "DC_GuiMemoEdit", you may create your own short dialog with DCMULTILINE:

Code: Select all

FUNCTION EditText(c)
LOCAL lOk := .F., cTextBackup := c
@ 0,0 DCMULTINE c SIZE 120,20 COMPATIBLE FONT "10.Arial" 
DCREAD GUI ADDBUTTONS TO lOk TITLE 'Edit'
IF !lOk
  c := cTextBackup
ENDIF
RETURN c
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

Re: use of memoedit doesn't work correctly

#4 Post by obelix »

Thank you Tom,
again and again it's you to give me the decisive advice.
DCMULTILINE is even more flexible and convenient to my problem.

Peter
quiet old but still young and unskilled in express++

User avatar
Tom
Posts: 1179
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: use of memoedit doesn't work correctly

#5 Post by Tom »

:)
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply