The problem with MEMO

This forum is for eXpress++ general support.
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

The problem with MEMO

#1 Post by Eugene Lutsenko »

I used a text field of type "C" in the database. Then it turned out that sometimes the length of the field in 255 characters is not enough, ie need more. Then I replaced "C" with "M" and the program stopped working. In the program I didn't change a thing. When you change back "M" to "C", the program starts working correctly again. Has anyone come across anything like this?

Maybe it doesn't work:

Code: Select all

REPLACE Filtr WITH IF(AT(aClust1[cl], ALLTRIM(NAMECLS_FU)) > 0, '#', '')
Are there any peculiarities in the handling of memo fields in comparison with text fields?

User avatar
rdonnay
Site Admin
Posts: 4772
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: The problem with MEMO

#2 Post by rdonnay »

What kind of information are you storing in the memo field?

How did you create the memo field?
Did you use dbCreate()?

There are 2 types of memo fields in FoxDbe:

{ 'MEMO', M, 10, 0 }

{ 'MEMO', M, 4, 0 }
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: The problem with MEMO

#3 Post by Eugene Lutsenko »

Code: Select all

aStructure := { { "Num_it"     , "N",  15, 0 }, ;     
                { "Num_pp"     , "N",  15, 0 }, ;     
                { "NameCls1"   , "C", 255, 0 }, ;     
                { "NameCls2"   , "C", 255, 0 }, ;     
                { "KodCl_old1" , "N",  15, 0 }, ; 
                { "KodCl_old2" , "N",  15, 0 }, ; 
                { "NameCls_Sh" , "C", 255, 0 }, ; 
                { "NameCls_Fu" , "M",  10, 0 }, ;   // Мемо-поле. Почему-то не работает "M", 10, 0
                { "Ur_sxod"    , "N",  15, 7 }, ; 
                { "Ur_razl"    , "N",  15, 7 }, ; 
                { "Ur_razlIsh" , "N",  15, 7 }, ; 
                { "Normalizat" , "C",  15, 0 }, ; 
                { "KodCl_new"  , "N",  15, 0 }, ;
                { "Hierarchy"  , "N",  15, 0 }, ;
                { "Filtr"      , "C",   1, 0 }, ;
                { "X_koord"    , "N",  15, 7 }, ;
                { "Y_koord"    , "N",  15, 7 }  }

 mNameTree = 'Tree-'+STRTRAN(STR(mNumMod,2),' ','0')
 DbCreate( mNameTree, aStructure )
But perhaps M should not be in quotes: "M"?
And what is the difference between these two types of memo fields?
I treat a memo field the same way as a text field, because it contains text.

User avatar
rdonnay
Site Admin
Posts: 4772
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: The problem with MEMO

#4 Post by rdonnay »

{ "NameCls_Fu" , "M", 10, 0 }, ; // Мемо-поле. Почему-то не работает "M", 10, 0
Try this:

{ "NameCls_Fu" , "M", 4, 0 }, ; // Мемо-поле. Почему-то не работает "M", 4, 0

This stores text as binary.
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: The problem with MEMO

#5 Post by Eugene Lutsenko »

Tried. The result is exactly the same as it was. When using a simple text field: { "NameCls_Fu" , "C", 255, 0 } everything works fine as long as its length is enough. The values in this field consist only of characters: (),0123456789, for example:
(((2,(3,(7,(11,13)))),(1,(29,(23,(17,19))))),((6,(21,(18,(9,27)))),(30,(10,(15,(5,25))))))

You can use a simple text file with lines of the following form, which can be written and read using the commands of the memo group:

MemoEdit()
MemoLine()
MemoRead()
MemoTran()
MemoWrit()

User avatar
rdonnay
Site Admin
Posts: 4772
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: The problem with MEMO

#6 Post by rdonnay »

Put this in your code:

WTF Namecls_fu, Len(Namecls_fu)

Compare the results to see if a different value is returned.
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: The problem with MEMO

#7 Post by Eugene Lutsenko »

The values in this field are correct:
Attachments
Безымянный.jpg
Безымянный.jpg (74.46 KiB) Viewed 16092 times

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: The problem with MEMO

#8 Post by Eugene Lutsenko »

This is necessary to remove the limit on the number of clusters in the mode:
http://aidos.byethost6.com/ClustClass/page_01.htm

User avatar
rdonnay
Site Admin
Posts: 4772
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: The problem with MEMO

#9 Post by rdonnay »

The values in this field are correct:
If the values are correct, then it should work.

I don't believe that the values are correct.
Your memo field may have a terminating character that you cannot see.
Sometimes this is a Chr(0) or a Chr(26) character.

This is why you should compare the LENGTH of each string (after the Alltrim()).
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1422
Joined: Wed Feb 24, 2010 3:44 pm

Re: The problem with MEMO

#10 Post by Auge_Ohr »

Eugene Lutsenko wrote:Then I replaced "C" with "M" and the program stopped working. In the program I didn't change a thing. When you change back "M" to "C", the program starts working correctly again.
how do you change Type "C" to "M" ?
create new DBF or using DBU etc ?

what Type of DBF are you using ? DBFNTX oder FOXCDX ?

how have you transfer old "C" Value into "M" Memo ?
greetings by OHR
Jimmy

Post Reply