2013/8/23 paulwheeler
>
>Very interesting that g3 treats a web address the same as a file name.
>Definitely easier than my code, and something to remember! Thanks
> Fabien!
>paul
>
> It's not the fact of Gambas ... But a web address look like a file address
on unix.
http://folder/fl
Very interesting that g3 treats a web address the same as a file name.
Definitely easier than my code, and something to remember! Thanks Fabien!
paul
On 08/22/2013 01:14 PM, Fabien Bodard wrote:
:-)
StrName = File.Name([1]"http://www.link1.com/folder1/picture1.png";)
[2]http://gamb
Here is the code to do the extraction:
Dim intSlash As Integer
Dim strPictureName As String
Dim strLinkAddress As String =
[1]"http://www.link1.com/folder1/folder1/picture1.png";
'' Find location of last slash in address:
intSlash = RInStr(strLinkAddress, "/")
Oh yes, that is best way to do that!
Jussi
On Thu, Aug 22, 2013 at 11:14 PM, Fabien Bodard wrote:
> :-)
>
> StrName = File.Name("http://www.link1.com/folder1/picture1.png";)
>
> http://gambasdoc.org/help/comp/gb/file/name?v3
>
>
> 2013/8/22 abbat81
>
> > Jussi Lahtinen wrote
> > > You can use
Thank you very much
It was helpfull + Array.Count:
Dim s As String = "http://www.link1.com/folder1/folder1/picture1.png";
Dim ss As String[]
ss = Split(s, "/")
Print ss[ss.count - 1]
--
View this message in context:
http://gambas.8142.n7.nabble.com/How-to-get-all-string
:-)
StrName = File.Name("http://www.link1.com/folder1/picture1.png";)
http://gambasdoc.org/help/comp/gb/file/name?v3
2013/8/22 abbat81
> Jussi Lahtinen wrote
> > You can use InStr() to find "png" and count back to "/".
>
> Ok, how to count back to last "/" in string if we have:
>
> Dim s As S
Jussi Lahtinen wrote
> You can use InStr() to find "png" and count back to "/".
Ok, how to count back to last "/" in string if we have:
Dim s As String = "http://www.link1.com/folder1/folder1/picture1.png";
Print InStr(s, ".png")
=> 46
--
View this message in context:
http://gambas.8142.n
You can use InStr() to find "png" and count back to "/".
Jussi
On Thu, Aug 22, 2013 at 10:22 PM, abbat81 wrote:
> Ru Vuott wrote
> > Hello Abbat81,
> > Dim s As String = "http://www.link1.com/folder1/picture1.png";
> >
> >Print ss[4]
> >
> > End
>
> But link can contain a different count
In this way you can extract the file name of a given route (from the last "
/").
What I do is a countdown until you find the character "/":
Public Sub extraedesdebarra(ruta As String) As String
Dim a As Integer
Dim letra As String
Dim cadena As String
For a = Len(ruta) To 1 Step -1
Ru Vuott wrote
> Hello Abbat81,
> Dim s As String = "http://www.link1.com/folder1/picture1.png";
>
>Print ss[4]
>
> End
But link can contain a different count of "/"
example:
http://www.link1.com/folder1/picture1.png
http://www.link2.com/folder2/folder3/picture2_adv.png
--
Hello Abbat81,
...by using Split() function:
Public Sub Form_Open()
Dim s As String = "http://www.link1.com/folder1/picture1.png";
Dim ss As String[]
ss = Split(s, "/")
Print ss[4]
End
Gio 22/8/13, abbat81 ha scritto:
Oggetto: [
11 matches
Mail list logo