Russian version
English version
| | | | SILICON TAIGA | ISDEF | CD | | | | | | | |
 

 
 
IT-
 
 
 
RSS-

MS Access

, MSA . ...

, , .

'
MsgBox FndSmb(".","main.html")
'
Public Function FndSmb(smb As String, stroka As String) As Long
Dim a As Long
Dim b As Long
a = 1
While a > 0
b = a
a = InStr(a + 1, stroka, smb)
Wend
FndSmb = b
End Function

, - . , , . , , Eval . .
P.S. 2000 MSA replace(). .

'
MsgBox str_replace(",",".","9,9*10,17")
'
Public Function str_replace(s1 As String, s2 As String, s As String) As String
Dim n1 As Long
Dim n2 As Long
Dim v1 As String
Dim v2 As String
Dim v3 As String

v3 = s
n2 = 1
n1 = InStr(n2, s, s1)

If n1 > 0 Then
Do
v1 = Mid(v3, 1, n1 - 1)
v2 = Mid(v3, n1 + Len(s1), Len(v3) - n1)
v3 = v1 & s2 & v2
n2 = n1 + Len(s2)
n1 = InStr(n2, v3, s1)
Loop Until n1 < 1
End If

str_replace = v3
End Function

. , , .
(split), MSA .

'
MsgBox ExpandStr("Waw;2347859;dfskgdkf",";",2) '2347859
'
Public Function ExpandStr(stroka As String, Razdel As String, numpos As Long)
Dim n1 As Long
Dim s1 As String
Dim v1 As String
Dim v2 As String
Dim v3 As String
Dim i As Long

v3 = stroka
s1 = Razdel
n1 = InStr(1, v3, s1)
i = 0

If n1 > 0 Then
Do
v1 = Mid(v3, 1, n1 - 1) '
v2 = Mid(v3, n1 + Len(s1), Len(v3) - n1) '
v3 = v2 '
n1 = InStr(1, v3, s1) '
i = i + 1
Loop Until n1 < 1 Or i >= numpos ' ,
End If
If n1 < 1 And i < numpos Then
ExpandStr = v2
Else
ExpandStr = v1
End If
End Function


     
 
 
  : 04.09.2006  

| | | | SILICON TAIGA | ISDEF | CD | | | | | | | |

: Silicon Taiga    
Rambler's Top100 Rambler's Top100