1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
-
|
|
|
|
!
-
|
|
|
|
|
|
|
|
|
|
|
!
| #module
#defcfunc IsByte int p1
return ((p1>=129)&(p1<=159) )|( (p1>=224)&(p1<=252))
#global
#module mdl_sep_ff_ts
#deffunc init_at_mdl_sep_ff_ts int p_is_dbg
is_init=1
is_dbg=p_is_dbg
return
#deffunc set_is_2byte_at_mdl_sep_ff_ts array ar_is_2byte,var source_source_source
l_tmp_sc=strlen(source_source_source)
i=0
ii=l_tmp_sc-1
while i <= ii
cmp=peek(source_source_source,i)
tmp=IsByte(cmp)
if tmp!=0{tmp=1}
if tmp=1{
ar_is_2byte.i=1
i++
ar_is_2byte.i=1
i++
}else{ i++ }
wend
ar_is_2byte.l_tmp_sc=-1
return
#deffunc set_is_ff_ts_at_mdl_sep_ff_ts array is_ts,array is_2byte,var source_source
set_is_2byte_at_mdl_sep_ff_ts is_2byte,source_source
l_tmp_sc=strlen(source_source)
css=" "
cs=peek(css,0)
ctt="\t"
ct=peek(ctt,0)
flag=0
i=0
ii=l_tmp_sc-1
while i <= ii
if is_2byte.i==1:_break
cmp=peek(source_source,i)
flag=((cmp==cs)|(cmp==ct))
if flag!=0{is_ts.i=1:i++}
else{_break}
wend
i=ii
while i>=0
if is_2byte.i==1:_break
cmp=peek(source_source,i)
flag=(cmp==cs)|(cmp==ct)
if flag!=0{is_ts.i=1:i--}
else{_break}
wend
is_ts.l_tmp_sc=-1
return
#deffunc sep_ff_ts var result,var source
ls=strlen(source)
ls++
dim ts,ls
dim two_byte,ls
set_is_ff_ts_at_mdl_sep_ff_ts ts,two_byte,source
l_tmp_sc=strlen(source)
i=0
repeat l_tmp_sc
if ts.cnt==1{i++}
else{break}
loop
tmp=strmid(source,-1,(l_tmp_sc-i))
l_tmp=strlen(tmp)
ii=l_tmp_sc-1
iii=0
repeat ii
if ts(ii-cnt)==1{iii++}
else{break}
loop
l_tmp-=iii
result=strmid(tmp,0,l_tmp)
if is_dbg!=0{
logmes source
s=""
repeat ls
s+=two_byte.cnt
loop
logmes s
ss=""
repeat ls
ss+=ts.cnt
loop
logmes ss
}
return
#global
|