The problem with MEMO

This forum is for eXpress++ general support.
Message
Author
User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: The problem with MEMO

#31 Post by Auge_Ohr »

Eugene we try to help you as much as possible but to revise your code to look for FUNCTION F4_2_2_3() i have no time

my Tip to create a small App to check your FUNCTION F4_2_2_3() is for you !
if you have made a small App than you can upload it and ask other User to check it if they have time.

---

about Array : as i say you can store hole Array binarie to Memo Type "V" like in Project "Delone Triangulation"

Code: Select all

   REPLACE TRIMEMO->POINTS    WITH Var2Bin(aPoints)
   REPLACE TRIMEMO->TRIANGLE  WITH Var2Bin(aTriangles)
and back from Memo

Code: Select all

   ::points    := Bin2Var(TRIMEMO->POINTS  )
   ::Triangles := Bin2Var(TRIMEMO->TRIANGLE)
as i use same DBE Settings like Express++ default (?)

Code: Select all

FUNCTION DC_LoadRdds
...
  DbeInfo( COMPONENT_DATA, FOXDBE_CREATE_2X, .T. )
  DbeInfo( COMPONENT_DATA, FOXDBE_LOCKMODE , FOXDBE_LOCKMODE_2X )
  DbeInfo( COMPONENT_ORDER, CDXDBE_MODE , CDXDBE_FOXPRO2X )
that is FoxPro 2.x compatible so this Code to create Database/Memo must work with Express++ default

Code: Select all

FUNCTION CRE_TRIPLEMEMO(datei,alias,id)
  LOCAL p,field_list:={}
  IF VALTYPE(datei)!="C"
    datei := "TRIMEMO.DBF"
  ENDIF
  IF VALTYPE(alias)!="C"
    p := AT(".",datei)
    alias := IF(p>0,SUBSTR(datei,1,p-1),datei)
  ENDIF
  IF VALTYPE(id)!="N"
    id := 0
  ENDIF
  SELECT (id)
  IF !FILE(datei)
    AADD(field_list,{"NUM"     ,"N",  5,0})
    AADD(field_list,{"DESC"    ,"C",100,0})
    AADD(field_list,{"POINTS"  ,"V",  8,0})
    AADD(field_list,{"RIBS"    ,"V",  8,0})
    AADD(field_list,{"TRIANGLE","V",  8,0})
    DBCREATE(datei,field_list,"FOXCDX")
  ENDIF
RETURN(.t.)
greetings by OHR
Jimmy

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

#32 Post by Eugene Lutsenko »

Hello, Auge_Ohr!

I just thought you might be interested. Maybe you also use tree clustering somewhere in Your home. Sorry. I am very grateful to you for your help. I don't have anyone else to talk to but you. You help me a lot. I think I'm going to solve this problem with the memoir by simply abandoning it. I myself have no problem realizing that I wanted to do with memo. In the meantime, everything works well with simple text fields.

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: The problem with MEMO

#33 Post by Victorio »

Eugene,
Maybe this is off topic, but can you use several C fields instead of memo field ?
Memo files in our office often disturbed, often after power failure or failure server disks.

I use to store text in dbf in several fields C 255 and in program link it to one string. but with index can be problem because limit of length index key.
Better way will be use sql database...

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

#34 Post by Eugene Lutsenko »

Victorio!

Combining "C" several fields programmatically is not a bad idea. And simply realized

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: The problem with MEMO

#35 Post by Victorio »

only for example source for read text file to dbf :

nHandle:=DC_TxtOpen(infuvi)

* cyklus pre načítanie riadkov súboru
do while !DC_TxtEof(nHandle)
* načítanie riadku z txt súboru
cLine:=DC_TxtLine(nHandle)
* pridanie prázdneho riadku do databázy
IF 1->(DC_AddRec(5))
* zápis riadku do databázy

* kontrola na dĺžku riadku ak dlhší, rozdelí do dvoch
if len(cLine)<=254
replace riadok1 with cLine

elseif len(cLine)>1*254 .and. len(cLine)<=2*254
replace riadok1 with substr(cLine,1,254)
replace riadok2 with substr(cLine,(1*254)+1,254)

elseif len(cLine)>2*254 .and. len(cLine)<=3*254
replace riadok1 with substr(cLine,1,254)
replace riadok2 with substr(cLine,(2*254)+1,254)
replace riadok3 with substr(cLine,(3*254)+1,254)

elseif len(cLine)>3*254 .and. len(cLine)<=4*254
replace riadok1 with substr(cLine,1,254)
replace riadok2 with substr(cLine,(1*254)+1,254)
replace riadok3 with substr(cLine,(2*254)+1,254)
replace riadok4 with substr(cLine,(3*254)+1,254)

elseif len(cLine)>4*254 .and. len(cLine)<=5*254
replace riadok1 with substr(cLine,1,254)
replace riadok2 with substr(cLine,(1*254)+1,254)
replace riadok3 with substr(cLine,(2*254)+1,254)
replace riadok4 with substr(cLine,(3*254)+1,254)
replace riadok5 with substr(cLine,(4*254)+1,254)

endif
* odomknutie záznamu
1->(dbRUnlock())
ENDIF
DC_TxtSkip(nHandle,1)
enddo
* zatvorenie text.súboru
DC_TxtClose(nHandle)

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

#36 Post by Eugene Lutsenko »

Thanks, Victorio!

Now the memo fields are not needed at all, especially since they still do not work

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

#37 Post by Eugene Lutsenko »

Thanks to your fresh ideas, I solved this issue in an elementary and radical way.

Instead of REPLACE use StrFile. Instead of the field value, I use the value of the variable to which the text and the file are assigned. Then I delete temporary TXT files. Maybe not very elegant. But it works well and is not difficult to alter the program

Code: Select all

           REPLACE NameCls_Fu  WITH mNameClustFu

           StrFile(ALLTRIM(mNameClustFu),  M_PathAppl+"\ClsClustTree\NameClsF"+"-"+STRTRAN(STR(mNumMod,2)," ","0")+"-"+STRTRAN(STR(KODCL_NEW,5)," ","0")+".txt")     // Запись     текстового файла NameClsF-##-#####.txt, где ##-номер модели, #####-KODCL_NEW

*          mNameClustFu = FileStr(M_PathAppl+"\ClsClustTree\NameClsF"+"-"+STRTRAN(STR(mNumMod,2)," ","0")+"-"+STRTRAN(STR(KODCL_NEW,5)," ","0")+".txt")              // Считывание текстового файла NameClsF-##-#####.txt, где ##-номер модели, #####-KODCL_NEW
[/size]

Note the cluster nesting formula at the bottom (indicated by an arrow). Now there are no restrictions on the length of this formula. So I can draw up to 100 clusters on a graphical form. If you use just text boxes, you can handle no more than 50 clusters correctly
Attachments
ClustClass-04.jpg
ClustClass-04.jpg (1013 KiB) Viewed 11446 times
IntClustDist-04.jpg
IntClustDist-04.jpg (822.51 KiB) Viewed 11446 times

Post Reply