[Gambas-user] Array 2 String or different approach on what im trying to do.

Fabien Bodard gambas.fr at ...626...
Tue Jan 8 21:10:46 CET 2008


Le Tuesday 08 January 2008 19:43:09 lozza1978, vous avez écrit :
> Hi All.
>
> Im after a little help again (Sorry for lack of knowledge guys)
>
> I have a textbox and a browse button, you click browse, select a file and
> the file path, including filename gets added inside the textbox.
>
> what im after is the directory of the file selected, so this is what I have
>
>
> DIM Elt AS String[]
> DIM Sb AS String
> DIM Sdir AS String
> DIM sstri AS String[]
>
>   Dialog.Title = "Select A Movie File to convert 2 DVD:"
>   IF Dialog.OpenFile() THEN RETURN
>    Textbox1.Text = Dialog.Path
>

there is a box for directory
Nevertheless all your code is for that :


FileDirectory = File.Dir(TextBox1.text)


Look the doc !
http://gambasdoc.org/help/comp/gb/file



>
> Elt = Split(Textbox1.Text, "/") <--Split the path
>
> Sdir = Elt.Length - 1 <--here Im finding out how many elements in the array
> Elt.Remove(Elt.Length - 1) <-- here removing the filename, so that I have
> the directory where the file is located
>
>
> FOR EACH Sb IN Elt
>
>   PRINT sb; "/";
>
> NEXT
> PRINT
> END
>
>
> the code above works and the foreach prints the correct directory path, But
> i some how need to get the output of the foreach into a string so I can
> call the directory path using a string/variable
>
> im just confusing myself now, hope someone can understand what im trying to
> do and help me, thanks again for reading.






More information about the User mailing list