2013/8/23 paulwheeler paulwhee...@cox.net
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.
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 abbat...@mail.ru ha scritto:
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
--
View this
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
You can use InStr() to find png and count back to /.
Jussi
On Thu, Aug 22, 2013 at 10:22 PM, abbat81 abbat...@mail.ru 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 of
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:
:-)
StrName = File.Name(http://www.link1.com/folder1/picture1.png;)
http://gambasdoc.org/help/comp/gb/file/name?v3
2013/8/22 abbat81 abbat...@mail.ru
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
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:
Oh yes, that is best way to do that!
Jussi
On Thu, Aug 22, 2013 at 11:14 PM, Fabien Bodard gambas...@gmail.com wrote:
:-)
StrName = File.Name(http://www.link1.com/folder1/picture1.png;)
http://gambasdoc.org/help/comp/gb/file/name?v3
2013/8/22 abbat81 abbat...@mail.ru
Jussi Lahtinen
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, /)
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;)
11 matches
Mail list logo