Skip to content

Commit

Permalink
Попытка ускорить работу функции за счет замены обычной конкатенации н…
Browse files Browse the repository at this point in the history
…а textmerge
  • Loading branch information
s-s-a committed Jan 19, 2019
1 parent 00ebf1c commit a5cd65f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rtf_report/w_report.PRG
Expand Up @@ -2304,14 +2304,14 @@ FUNCTION ENCODE_SYMBOLS &&
LPARAMETERS rus_text LPARAMETERS rus_text
LOCAL i,kus_text,out_hex LOCAL i,kus_text,out_hex
out_hex='' out_hex=''
FOR i=1 TO LEN(m.rus_text) Set Textmerge On
kus_text=SUBSTR(m.rus_text, m.i, 1) Set Textmerge To Memvar out_hex Additive Noshow
IF ASC(m.kus_text)<127 For I=1 To Len(m.rus_text)
out_hex=m.out_hex+m.kus_text kus_text=Substr(m.rus_text, m.I, 1)
ELSE \<<Iif(ASC(m.kus_text)<127, m.kus_text, LOWER("\'"+RIGHT(TRANSFORM(ASC(m.kus_text),'@0'),2)))>>
out_hex=m.out_hex+ LOWER("\'"+RIGHT(TRANSFORM(ASC(m.kus_text),'@0'),2)) Next
ENDIF Set Textmerge Off
ENDFOR Set Textmerge To
RETURN m.out_hex RETURN m.out_hex
*############################################################################################ *############################################################################################
*############################################################################################ *############################################################################################
Expand Down

1 comment on commit a5cd65f

@s-s-a
Copy link
Owner Author

@s-s-a s-s-a commented on a5cd65f Jan 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Данная реализации работает в 6-8 раз быстрее оригинального варианта, особенно на текстах с кириллицей.

Please sign in to comment.