Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Improve Function Split
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Improve Function Split

 Post Reply Post Reply
Author
simoza View Drop Down
Groupie
Groupie
Avatar

Joined: 18 November 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote simoza Quote  Post ReplyReply Direct Link To This Post Topic: Improve Function Split
    Posted: 01 March 2005 at 1:43pm
I have created this function that works well:
Function DividiNomeDaWeb(NameLinkTo, PerCosa)


 Dim intSizNomeWeb, intSizNome, intSizWeb


intSizNomeWeb = split(NameLinkTo, PerCosa)

intSizNome = intSizNomeWeb(0)

intSizWeb = intSizNomeWeb(1)
 

DividiNomeDaWeb = "<a href=""http://www."& intSizWeb &""" class=""linksmalltext"">"&intSizNome&"</a>"


End Function
This function split a text in database after a variable "PerCosa".
An example:
In the database i have:siteweb,web.it
 so I call the function in this way:
" & DividiNomeDaWeb (" & DividiNomeDaWeb (objSizRs("Collaboration"), ",") & ", ",") & "

The function split my string in
siteweb and web.it.
 
In case that my objSizRs("Collaboration") is empty, split operation print an error!!!
 
So I would like to put an if that check if my variable is empty and in this case show a message.
 
Like:
Function DividiNomeDaWeb(NameLinkTo, PerCosa)


If NameLinkTo = "" Then

DividiNomeDaWeb = "testo...."

Else

Dim intSizNomeWeb, intSizNome, intSizWeb


intSizNomeWeb = split(NameLinkTo, PerCosa)

intSizNome = intSizNomeWeb(0)

intSizWeb = intSizNomeWeb(1)


DividiNomeDaWeb = "<a href=""http://www."& intSizWeb &""" class=""linksmalltext"">"&intSizNome&"</a>"

End If

End Function
But doesn't work well!!! Why? I don't know how use UBound metodDead
 
 


Edited by simoza - 01 March 2005 at 1:44pm
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2005 at 2:21pm
I'd use
if namelinkto = Nothing
because that is what it is. "" just represents and empty string but is more then nothing.
Back to Top
simoza View Drop Down
Groupie
Groupie
Avatar

Joined: 18 November 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote simoza Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2005 at 2:27pm
The error is:
variable object not set
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.