Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5827

The VB split command wrong

$
0
0

@fengyee_zju wrote:

hi everyone, could any one help me.
i want to: when input a full path file name, the function could get the file name without path. codes shows below:
Option Explicit

Call Main()
Sub Main()
	Dim a, filename
	a = "C:\abcd.txt" 
	filename = fGetLast(a) 
End Sub

Function fGetLast(ByVal originalString)
	Dim tmps()
	Dim delimeter
	delimeter = "\" 
	tmps = Split(originalString, delimeter)
	fGetLast = tmps(UBound(tmps))
	
End Function

but codes could not run, seems Rhino could not understand the VB command "Split", could any one help me on this? thank you very much.

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 5827

Trending Articles