|
|
| Next: Access data collection |
| Author |
Message |
mettá External

Since: Aug 23, 2009 Posts: 7
|
Posted: Sun Aug 23, 2009 3:10 pm Post subject: Showing numbers from a db with/without a gap Archived from groups: microsoft>public>frontpage>client (more info?) |
|
|
I have phone numbers stored in a db as xxxxx xxxxxx however I am starting to
set up a mobile/pda site and the numbers need to be xxxxxxxxxxx (no spaces)
I can edit the db to remove the spaces BUT would like then to display on the
fp site with a space. Anyone know a simple solution???
Thanks
M |
|
| Back to top |
|
 |
Trevor Lawrence External

Since: May 22, 2007 Posts: 74
|
Posted: Sun Aug 23, 2009 8:10 pm Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
"mettá" <metta RemoveThis @removethismetta.org.uk> wrote in message
news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
>I have phone numbers stored in a db as xxxxx xxxxxx however I am starting
>to set up a mobile/pda site and the numbers need to be xxxxxxxxxxx (no
>spaces)
>
> I can edit the db to remove the spaces BUT would like then to display on
> the fp site with a space. Anyone know a simple solution???
>
Are they stored as character?
If so, use a simple JavaScript substring
e.g.
<script type="text/javascript">
document.write(str.substring(0,4) + " " + str.substring(5));
</script>
where str contains the 11 character value extracted from the database
--
Trevor Lawrence
Canberra
Web Site http://trevorl.mvps.org |
|
| Back to top |
|
 |
Ronx External

Since: Dec 12, 2003 Posts: 5967
|
Posted: Mon Aug 24, 2009 3:10 am Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Use code to remove the spaces from the mobile pages, and leave as is for
non-mobile pages.
In classic asp (must be adapted to the script language you are using):
'get telephone from database and store in variable phoneNumber
'set mobilePage = true if page is for a mobile, otherwise set to false
if mobilePage then
replace(phoneNumber, " ", "")
end if
response.write(phoneNumber)
--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp
Reply only to group - emails will be deleted unread.
"mett" <metta.RemoveThis@removethismetta.org.uk> wrote in message
news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
> I have phone numbers stored in a db as xxxxx xxxxxx however I am starting
> to set up a mobile/pda site and the numbers need to be xxxxxxxxxxx (no
> spaces)
>
> I can edit the db to remove the spaces BUT would like then to display on
> the fp site with a space. Anyone know a simple solution???
>
> Thanks
> M
> |
|
| Back to top |
|
 |
mettá External

Since: Aug 23, 2009 Posts: 7
|
Posted: Fri Aug 28, 2009 3:10 pm Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Can you help me with the syntax to do this as I can't get it working...
<%
phonNum=FP_FieldVal(fp_rs,"tel")
replace(phonNum," ","")
response.write(phonNum)
%>
Thanks
M
"Ronx" <ronx917 RemoveThis @hotmail.com> wrote in message
news:uEGjtVIJKHA.1488@TK2MSFTNGP03.phx.gbl...
> Use code to remove the spaces from the mobile pages, and leave as is for
> non-mobile pages.
>
> In classic asp (must be adapted to the script language you are using):
>
> 'get telephone from database and store in variable phoneNumber
> 'set mobilePage = true if page is for a mobile, otherwise set to false
> if mobilePage then
> replace(phoneNumber, " ", "")
> end if
> response.write(phoneNumber)
>
>
> --
> Ron Symonds
> Microsoft MVP (Expression Web)
> http://www.rxs-enterprises.org/fp
>
> Reply only to group - emails will be deleted unread.
>
>
>
> "mett" <metta RemoveThis @removethismetta.org.uk> wrote in message
> news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
>> I have phone numbers stored in a db as xxxxx xxxxxx however I am starting
>> to set up a mobile/pda site and the numbers need to be xxxxxxxxxxx (no
>> spaces)
>>
>> I can edit the db to remove the spaces BUT would like then to display on
>> the fp site with a space. Anyone know a simple solution???
>>
>> Thanks
>> M
>> |
|
| Back to top |
|
 |
Ronx External

Since: Dec 12, 2003 Posts: 5967
|
Posted: Fri Aug 28, 2009 4:10 pm Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
I cannot see anything wrong with the syntax. Is this code segment within a
DBR region or outside it? If outside, the fp_rs value may have been set to
nothing, or not yet set to anything - what errors are you getting?
--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp
Reply only to group - emails will be deleted unread.
"mett" <metta RemoveThis @removethismetta.org.uk> wrote in message
news:OpffKlAKKHA.1376@TK2MSFTNGP02.phx.gbl...
> Can you help me with the syntax to do this as I can't get it working...
>
> <%
> phonNum=FP_FieldVal(fp_rs,"tel")
>
> replace(phonNum," ","")
>
> response.write(phonNum)
>
> %>
>
> Thanks
> M
>
>
>
> "Ronx" <ronx917 RemoveThis @hotmail.com> wrote in message
> news:uEGjtVIJKHA.1488@TK2MSFTNGP03.phx.gbl...
>> Use code to remove the spaces from the mobile pages, and leave as is for
>> non-mobile pages.
>>
>> In classic asp (must be adapted to the script language you are using):
>>
>> 'get telephone from database and store in variable phoneNumber
>> 'set mobilePage = true if page is for a mobile, otherwise set to false
>> if mobilePage then
>> replace(phoneNumber, " ", "")
>> end if
>> response.write(phoneNumber)
>>
>>
>> --
>> Ron Symonds
>> Microsoft MVP (Expression Web)
>> http://www.rxs-enterprises.org/fp
>>
>> Reply only to group - emails will be deleted unread.
>>
>>
>>
>> "mett" <metta RemoveThis @removethismetta.org.uk> wrote in message
>> news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
>>> I have phone numbers stored in a db as xxxxx xxxxxx however I am
>>> starting to set up a mobile/pda site and the numbers need to be
>>> xxxxxxxxxxx (no spaces)
>>>
>>> I can edit the db to remove the spaces BUT would like then to display on
>>> the fp site with a space. Anyone know a simple solution???
>>>
>>> Thanks
>>> M
>>>
>
> |
|
| Back to top |
|
 |
mettá External

Since: Aug 23, 2009 Posts: 7
|
Posted: Fri Aug 28, 2009 9:10 pm Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
The error is
Error Type:
Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
/SITE_Aug07/m/page2.asp, line 106, column 23
replace(phonNum," ","")
Any sugestions?
Thanks
M
"Ronx" <ronx917.DeleteThis@hotmail.com> wrote in message
news:OD3OVXBKKHA.4168@TK2MSFTNGP05.phx.gbl...
>I cannot see anything wrong with the syntax. Is this code segment within a
>DBR region or outside it? If outside, the fp_rs value may have been set to
>nothing, or not yet set to anything - what errors are you getting?
>
> --
> Ron Symonds
> Microsoft MVP (Expression Web)
> http://www.rxs-enterprises.org/fp
>
> Reply only to group - emails will be deleted unread.
>
>
>
> "mett" <metta.DeleteThis@removethismetta.org.uk> wrote in message
> news:OpffKlAKKHA.1376@TK2MSFTNGP02.phx.gbl...
>> Can you help me with the syntax to do this as I can't get it working...
>>
>> <%
>> phonNum=FP_FieldVal(fp_rs,"tel")
>>
>> replace(phonNum," ","")
>>
>> response.write(phonNum)
>>
>> %>
>>
>> Thanks
>> M
>>
>>
>>
>> "Ronx" <ronx917.DeleteThis@hotmail.com> wrote in message
>> news:uEGjtVIJKHA.1488@TK2MSFTNGP03.phx.gbl...
>>> Use code to remove the spaces from the mobile pages, and leave as is for
>>> non-mobile pages.
>>>
>>> In classic asp (must be adapted to the script language you are using):
>>>
>>> 'get telephone from database and store in variable phoneNumber
>>> 'set mobilePage = true if page is for a mobile, otherwise set to false
>>> if mobilePage then
>>> replace(phoneNumber, " ", "")
>>> end if
>>> response.write(phoneNumber)
>>>
>>>
>>> --
>>> Ron Symonds
>>> Microsoft MVP (Expression Web)
>>> http://www.rxs-enterprises.org/fp
>>>
>>> Reply only to group - emails will be deleted unread.
>>>
>>>
>>>
>>> "mett" <metta.DeleteThis@removethismetta.org.uk> wrote in message
>>> news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
>>>> I have phone numbers stored in a db as xxxxx xxxxxx however I am
>>>> starting to set up a mobile/pda site and the numbers need to be
>>>> xxxxxxxxxxx (no spaces)
>>>>
>>>> I can edit the db to remove the spaces BUT would like then to display
>>>> on the fp site with a space. Anyone know a simple solution???
>>>>
>>>> Thanks
>>>> M
>>>>
>>
>> |
|
| Back to top |
|
 |
Ronx External

Since: Dec 12, 2003 Posts: 5967
|
Posted: Sat Aug 29, 2009 4:10 am Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
It's more likely the error refers to the response.write statement - try this
without the brackets:
response.write phonNum
I use vb.NET - not the same as vbScript - which always requires brackets,
and examples at w3schools show the brackets as well, but from
http://codingforums.com/showthread.php?t=76925
<quote>
VBScript in Classic ASP is a little weird in that you only use parentheses
when calling functions (that return a result), not when calling subs (that
just do something, without returning a result).
</quote>
--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp
Reply only to group - emails will be deleted unread.
"mett" <metta DeleteThis @removethismetta.org.uk> wrote in message
news:eU0rGvDKKHA.4316@TK2MSFTNGP04.phx.gbl...
> The error is
>
> Error Type:
> Microsoft VBScript compilation (0x800A0414)
> Cannot use parentheses when calling a Sub
> /SITE_Aug07/m/page2.asp, line 106, column 23
> replace(phonNum," ","")
>
> Any sugestions?
> Thanks
>
> M
>
>
>
> "Ronx" <ronx917 DeleteThis @hotmail.com> wrote in message
> news:OD3OVXBKKHA.4168@TK2MSFTNGP05.phx.gbl...
>>I cannot see anything wrong with the syntax. Is this code segment within
>>a DBR region or outside it? If outside, the fp_rs value may have been set
>>to nothing, or not yet set to anything - what errors are you getting?
>>
>> --
>> Ron Symonds
>> Microsoft MVP (Expression Web)
>> http://www.rxs-enterprises.org/fp
>>
>> Reply only to group - emails will be deleted unread.
>>
>>
>>
>> "mett" <metta DeleteThis @removethismetta.org.uk> wrote in message
>> news:OpffKlAKKHA.1376@TK2MSFTNGP02.phx.gbl...
>>> Can you help me with the syntax to do this as I can't get it working...
>>>
>>> <%
>>> phonNum=FP_FieldVal(fp_rs,"tel")
>>>
>>> replace(phonNum," ","")
>>>
>>> response.write(phonNum)
>>>
>>> %>
>>>
>>> Thanks
>>> M
>>>
>>>
>>>
>>> "Ronx" <ronx917 DeleteThis @hotmail.com> wrote in message
>>> news:uEGjtVIJKHA.1488@TK2MSFTNGP03.phx.gbl...
>>>> Use code to remove the spaces from the mobile pages, and leave as is
>>>> for non-mobile pages.
>>>>
>>>> In classic asp (must be adapted to the script language you are using):
>>>>
>>>> 'get telephone from database and store in variable phoneNumber
>>>> 'set mobilePage = true if page is for a mobile, otherwise set to false
>>>> if mobilePage then
>>>> replace(phoneNumber, " ", "")
>>>> end if
>>>> response.write(phoneNumber)
>>>>
>>>>
>>>> --
>>>> Ron Symonds
>>>> Microsoft MVP (Expression Web)
>>>> http://www.rxs-enterprises.org/fp
>>>>
>>>> Reply only to group - emails will be deleted unread.
>>>>
>>>>
>>>>
>>>> "mett" <metta DeleteThis @removethismetta.org.uk> wrote in message
>>>> news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
>>>>> I have phone numbers stored in a db as xxxxx xxxxxx however I am
>>>>> starting to set up a mobile/pda site and the numbers need to be
>>>>> xxxxxxxxxxx (no spaces)
>>>>>
>>>>> I can edit the db to remove the spaces BUT would like then to display
>>>>> on the fp site with a space. Anyone know a simple solution???
>>>>>
>>>>> Thanks
>>>>> M
>>>>>
>>>
>>>
>
> |
|
| Back to top |
|
 |
Stefan B Rusynko External

Since: Oct 11, 2003 Posts: 11555
|
Posted: Sat Aug 29, 2009 6:10 am Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Should be
<%
phonNum=FP_FieldVal(fp_rs,"tel")
If len(phonNum)>0 then
phonNum=replace(phonNum," ","")
Else
phonNum="None"
End If
response.write(phonNum)
%>
--
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________
"mettá" <metta.DeleteThis@removethismetta.org.uk> wrote in message news:OpffKlAKKHA.1376@TK2MSFTNGP02.phx.gbl...
| Can you help me with the syntax to do this as I can't get it working...
|
| <%
| phonNum=FP_FieldVal(fp_rs,"tel")
|
| replace(phonNum," ","")
|
| response.write(phonNum)
|
| %>
|
| Thanks
| M
|
|
|
| "Ronx" <ronx917.DeleteThis@hotmail.com> wrote in message
| news:uEGjtVIJKHA.1488@TK2MSFTNGP03.phx.gbl...
| > Use code to remove the spaces from the mobile pages, and leave as is for
| > non-mobile pages.
| >
| > In classic asp (must be adapted to the script language you are using):
| >
| > 'get telephone from database and store in variable phoneNumber
| > 'set mobilePage = true if page is for a mobile, otherwise set to false
| > if mobilePage then
| > replace(phoneNumber, " ", "")
| > end if
| > response.write(phoneNumber)
| >
| >
| > --
| > Ron Symonds
| > Microsoft MVP (Expression Web)
| > http://www.rxs-enterprises.org/fp
| >
| > Reply only to group - emails will be deleted unread.
| >
| >
| >
| > "mett" <metta.DeleteThis@removethismetta.org.uk> wrote in message
| > news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
| >> I have phone numbers stored in a db as xxxxx xxxxxx however I am starting
| >> to set up a mobile/pda site and the numbers need to be xxxxxxxxxxx (no
| >> spaces)
| >>
| >> I can edit the db to remove the spaces BUT would like then to display on
| >> the fp site with a space. Anyone know a simple solution???
| >>
| >> Thanks
| >> M
| >>
|
| |
|
| Back to top |
|
 |
mettá External

Since: Aug 23, 2009 Posts: 7
|
Posted: Sat Aug 29, 2009 7:10 am Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Thanks for continuing to try and help but...
If I do this
<%
phonNum=FP_FieldVal(fp_rs,"tel")
replace(phonNum," ","")
response.write phonNum
%>
Then I get
Error Type:
Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
/SITE_Aug07/m/page2.asp, line 106, column 23
replace(phonNum," ","")
----------------------^
If I do this
<%
phonNum=FP_FieldVal(fp_rs,"tel")
replace phonNum," ",""
response.write phonNum
%>
It produces 1234 567891 so the replace " " does not work
What am I doing wrong?
M
"Ronx" <ronx917 DeleteThis @hotmail.com> wrote in message
news:OC9FbzHKKHA.1380@TK2MSFTNGP02.phx.gbl...
> It's more likely the error refers to the response.write statement - try
> this without the brackets:
>
> response.write phonNum
>
> I use vb.NET - not the same as vbScript - which always requires brackets,
> and examples at w3schools show the brackets as well, but from
> http://codingforums.com/showthread.php?t=76925
>
> <quote>
> VBScript in Classic ASP is a little weird in that you only use parentheses
> when calling functions (that return a result), not when calling subs (that
> just do something, without returning a result).
> </quote>
>
> --
> Ron Symonds
> Microsoft MVP (Expression Web)
> http://www.rxs-enterprises.org/fp
>
> Reply only to group - emails will be deleted unread.
>
>
>
> "mett" <metta DeleteThis @removethismetta.org.uk> wrote in message
> news:eU0rGvDKKHA.4316@TK2MSFTNGP04.phx.gbl...
>> The error is
>>
>> Error Type:
>> Microsoft VBScript compilation (0x800A0414)
>> Cannot use parentheses when calling a Sub
>> /SITE_Aug07/m/page2.asp, line 106, column 23
>> replace(phonNum," ","")
>>
>> Any sugestions?
>> Thanks
>>
>> M
>>
>>
>>
>> "Ronx" <ronx917 DeleteThis @hotmail.com> wrote in message
>> news:OD3OVXBKKHA.4168@TK2MSFTNGP05.phx.gbl...
>>>I cannot see anything wrong with the syntax. Is this code segment within
>>>a DBR region or outside it? If outside, the fp_rs value may have been set
>>>to nothing, or not yet set to anything - what errors are you getting?
>>>
>>> --
>>> Ron Symonds
>>> Microsoft MVP (Expression Web)
>>> http://www.rxs-enterprises.org/fp
>>>
>>> Reply only to group - emails will be deleted unread.
>>>
>>>
>>>
>>> "mett" <metta DeleteThis @removethismetta.org.uk> wrote in message
>>> news:OpffKlAKKHA.1376@TK2MSFTNGP02.phx.gbl...
>>>> Can you help me with the syntax to do this as I can't get it working...
>>>>
>>>> <%
>>>> phonNum=FP_FieldVal(fp_rs,"tel")
>>>>
>>>> replace(phonNum," ","")
>>>>
>>>> response.write(phonNum)
>>>>
>>>> %>
>>>>
>>>> Thanks
>>>> M
>>>>
>>>>
>>>>
>>>> "Ronx" <ronx917 DeleteThis @hotmail.com> wrote in message
>>>> news:uEGjtVIJKHA.1488@TK2MSFTNGP03.phx.gbl...
>>>>> Use code to remove the spaces from the mobile pages, and leave as is
>>>>> for non-mobile pages.
>>>>>
>>>>> In classic asp (must be adapted to the script language you are using):
>>>>>
>>>>> 'get telephone from database and store in variable phoneNumber
>>>>> 'set mobilePage = true if page is for a mobile, otherwise set to false
>>>>> if mobilePage then
>>>>> replace(phoneNumber, " ", "")
>>>>> end if
>>>>> response.write(phoneNumber)
>>>>>
>>>>>
>>>>> --
>>>>> Ron Symonds
>>>>> Microsoft MVP (Expression Web)
>>>>> http://www.rxs-enterprises.org/fp
>>>>>
>>>>> Reply only to group - emails will be deleted unread.
>>>>>
>>>>>
>>>>>
>>>>> "mett" <metta DeleteThis @removethismetta.org.uk> wrote in message
>>>>> news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
>>>>>> I have phone numbers stored in a db as xxxxx xxxxxx however I am
>>>>>> starting to set up a mobile/pda site and the numbers need to be
>>>>>> xxxxxxxxxxx (no spaces)
>>>>>>
>>>>>> I can edit the db to remove the spaces BUT would like then to display
>>>>>> on the fp site with a space. Anyone know a simple solution???
>>>>>>
>>>>>> Thanks
>>>>>> M
>>>>>>
>>>>
>>>>
>>
>> |
|
| Back to top |
|
 |
mettá External

Since: Aug 23, 2009 Posts: 7
|
Posted: Sat Aug 29, 2009 8:10 am Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Thank you, thanks you thank you Stefan
Works perfectly
M
"Stefan B Rusynko" <sbr_enjoy.TakeThisOut@hotmail.com> wrote in message
news:eITHCEJKKHA.4376@TK2MSFTNGP03.phx.gbl...
> Should be
>
> <%
> phonNum=FP_FieldVal(fp_rs,"tel")
> If len(phonNum)>0 then
> phonNum=replace(phonNum," ","")
> Else
> phonNum="None"
> End If
> response.write(phonNum)
> %>
>
>
> --
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> To find the best Newsgroup for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
> _____________________________________________
>
>
> "mettá" <metta.TakeThisOut@removethismetta.org.uk> wrote in message
> news:OpffKlAKKHA.1376@TK2MSFTNGP02.phx.gbl...
> | Can you help me with the syntax to do this as I can't get it working...
> |
> | <%
> | phonNum=FP_FieldVal(fp_rs,"tel")
> |
> | replace(phonNum," ","")
> |
> | response.write(phonNum)
> |
> | %>
> |
> | Thanks
> | M
> |
> |
> |
> | "Ronx" <ronx917.TakeThisOut@hotmail.com> wrote in message
> | news:uEGjtVIJKHA.1488@TK2MSFTNGP03.phx.gbl...
> | > Use code to remove the spaces from the mobile pages, and leave as is
> for
> | > non-mobile pages.
> | >
> | > In classic asp (must be adapted to the script language you are using):
> | >
> | > 'get telephone from database and store in variable phoneNumber
> | > 'set mobilePage = true if page is for a mobile, otherwise set to false
> | > if mobilePage then
> | > replace(phoneNumber, " ", "")
> | > end if
> | > response.write(phoneNumber)
> | >
> | >
> | > --
> | > Ron Symonds
> | > Microsoft MVP (Expression Web)
> | > http://www.rxs-enterprises.org/fp
> | >
> | > Reply only to group - emails will be deleted unread.
> | >
> | >
> | >
> | > "mett" <metta.TakeThisOut@removethismetta.org.uk> wrote in message
> | > news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
> | >> I have phone numbers stored in a db as xxxxx xxxxxx however I am
> starting
> | >> to set up a mobile/pda site and the numbers need to be xxxxxxxxxxx
> (no
> | >> spaces)
> | >>
> | >> I can edit the db to remove the spaces BUT would like then to display
> on
> | >> the fp site with a space. Anyone know a simple solution???
> | >>
> | >> Thanks
> | >> M
> | >>
> |
> |
>
> |
|
| Back to top |
|
 |
Ronx External

Since: Dec 12, 2003 Posts: 5967
|
Posted: Sat Aug 29, 2009 9:10 am Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Sometimes the obvious escapes us...
<%
phonNum=FP_FieldVal(fp_rs,"tel")
phonNum = replace(phonNum," ","")
response.write phonNum
%>
--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp
Reply only to group - emails will be deleted unread.
"mett" <metta DeleteThis @removethismetta.org.uk> wrote in message
news:O$vMfFJKKHA.1380@TK2MSFTNGP02.phx.gbl...
> Thanks for continuing to try and help but...
>
> If I do this
>
> <%
> phonNum=FP_FieldVal(fp_rs,"tel")
> replace(phonNum," ","")
> response.write phonNum
> %>
>
> Then I get
>
> Error Type:
> Microsoft VBScript compilation (0x800A0414)
> Cannot use parentheses when calling a Sub
> /SITE_Aug07/m/page2.asp, line 106, column 23
> replace(phonNum," ","")
> ----------------------^
>
> If I do this
>
> <%
> phonNum=FP_FieldVal(fp_rs,"tel")
> replace phonNum," ",""
> response.write phonNum
> %>
>
> It produces 1234 567891 so the replace " " does not work
>
> What am I doing wrong?
>
> M
>
>
>
>
> "Ronx" <ronx917 DeleteThis @hotmail.com> wrote in message
> news:OC9FbzHKKHA.1380@TK2MSFTNGP02.phx.gbl...
>> It's more likely the error refers to the response.write statement - try
>> this without the brackets:
>>
>> response.write phonNum
>>
>> I use vb.NET - not the same as vbScript - which always requires brackets,
>> and examples at w3schools show the brackets as well, but from
>> http://codingforums.com/showthread.php?t=76925
>>
>> <quote>
>> VBScript in Classic ASP is a little weird in that you only use
>> parentheses when calling functions (that return a result), not when
>> calling subs (that just do something, without returning a result).
>> </quote>
>>
>> --
>> Ron Symonds
>> Microsoft MVP (Expression Web)
>> http://www.rxs-enterprises.org/fp
>>
>> Reply only to group - emails will be deleted unread.
>>
>>
>>
>> "mett" <metta DeleteThis @removethismetta.org.uk> wrote in message
>> news:eU0rGvDKKHA.4316@TK2MSFTNGP04.phx.gbl...
>>> The error is
>>>
>>> Error Type:
>>> Microsoft VBScript compilation (0x800A0414)
>>> Cannot use parentheses when calling a Sub
>>> /SITE_Aug07/m/page2.asp, line 106, column 23
>>> replace(phonNum," ","")
>>>
>>> Any sugestions?
>>> Thanks
>>>
>>> M
>>>
>>>
>>>
>>> "Ronx" <ronx917 DeleteThis @hotmail.com> wrote in message
>>> news:OD3OVXBKKHA.4168@TK2MSFTNGP05.phx.gbl...
>>>>I cannot see anything wrong with the syntax. Is this code segment
>>>>within a DBR region or outside it? If outside, the fp_rs value may have
>>>>been set to nothing, or not yet set to anything - what errors are you
>>>>getting?
>>>>
>>>> --
>>>> Ron Symonds
>>>> Microsoft MVP (Expression Web)
>>>> http://www.rxs-enterprises.org/fp
>>>>
>>>> Reply only to group - emails will be deleted unread.
>>>>
>>>>
>>>>
>>>> "mett" <metta DeleteThis @removethismetta.org.uk> wrote in message
>>>> news:OpffKlAKKHA.1376@TK2MSFTNGP02.phx.gbl...
>>>>> Can you help me with the syntax to do this as I can't get it
>>>>> working...
>>>>>
>>>>> <%
>>>>> phonNum=FP_FieldVal(fp_rs,"tel")
>>>>>
>>>>> replace(phonNum," ","")
>>>>>
>>>>> response.write(phonNum)
>>>>>
>>>>> %>
>>>>>
>>>>> Thanks
>>>>> M
>>>>>
>>>>>
>>>>>
>>>>> "Ronx" <ronx917 DeleteThis @hotmail.com> wrote in message
>>>>> news:uEGjtVIJKHA.1488@TK2MSFTNGP03.phx.gbl...
>>>>>> Use code to remove the spaces from the mobile pages, and leave as is
>>>>>> for non-mobile pages.
>>>>>>
>>>>>> In classic asp (must be adapted to the script language you are
>>>>>> using):
>>>>>>
>>>>>> 'get telephone from database and store in variable phoneNumber
>>>>>> 'set mobilePage = true if page is for a mobile, otherwise set to
>>>>>> false
>>>>>> if mobilePage then
>>>>>> replace(phoneNumber, " ", "")
>>>>>> end if
>>>>>> response.write(phoneNumber)
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Ron Symonds
>>>>>> Microsoft MVP (Expression Web)
>>>>>> http://www.rxs-enterprises.org/fp
>>>>>>
>>>>>> Reply only to group - emails will be deleted unread.
>>>>>>
>>>>>>
>>>>>>
>>>>>> "mett" <metta DeleteThis @removethismetta.org.uk> wrote in message
>>>>>> news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
>>>>>>> I have phone numbers stored in a db as xxxxx xxxxxx however I am
>>>>>>> starting to set up a mobile/pda site and the numbers need to be
>>>>>>> xxxxxxxxxxx (no spaces)
>>>>>>>
>>>>>>> I can edit the db to remove the spaces BUT would like then to
>>>>>>> display on the fp site with a space. Anyone know a simple
>>>>>>> solution???
>>>>>>>
>>>>>>> Thanks
>>>>>>> M
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
> |
|
| Back to top |
|
 |
mettá External

Since: Aug 23, 2009 Posts: 7
|
Posted: Sat Aug 29, 2009 10:10 am Post subject: Re: Showing numbers from a db with/without a gap [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Thanks Ronx
It works too!
M
"Ronx" <ronx917 RemoveThis @hotmail.com> wrote in message
news:eXd2n7JKKHA.4136@TK2MSFTNGP04.phx.gbl...
> Sometimes the obvious escapes us...
>
> <%
> phonNum=FP_FieldVal(fp_rs,"tel")
> phonNum = replace(phonNum," ","")
> response.write phonNum
> %>
>
> --
> Ron Symonds
> Microsoft MVP (Expression Web)
> http://www.rxs-enterprises.org/fp
>
> Reply only to group - emails will be deleted unread.
>
>
>
> "mett" <metta RemoveThis @removethismetta.org.uk> wrote in message
> news:O$vMfFJKKHA.1380@TK2MSFTNGP02.phx.gbl...
>> Thanks for continuing to try and help but...
>>
>> If I do this
>>
>> <%
>> phonNum=FP_FieldVal(fp_rs,"tel")
>> replace(phonNum," ","")
>> response.write phonNum
>> %>
>>
>> Then I get
>>
>> Error Type:
>> Microsoft VBScript compilation (0x800A0414)
>> Cannot use parentheses when calling a Sub
>> /SITE_Aug07/m/page2.asp, line 106, column 23
>> replace(phonNum," ","")
>> ----------------------^
>>
>> If I do this
>>
>> <%
>> phonNum=FP_FieldVal(fp_rs,"tel")
>> replace phonNum," ",""
>> response.write phonNum
>> %>
>>
>> It produces 1234 567891 so the replace " " does not work
>>
>> What am I doing wrong?
>>
>> M
>>
>>
>>
>>
>> "Ronx" <ronx917 RemoveThis @hotmail.com> wrote in message
>> news:OC9FbzHKKHA.1380@TK2MSFTNGP02.phx.gbl...
>>> It's more likely the error refers to the response.write statement - try
>>> this without the brackets:
>>>
>>> response.write phonNum
>>>
>>> I use vb.NET - not the same as vbScript - which always requires
>>> brackets, and examples at w3schools show the brackets as well, but from
>>> http://codingforums.com/showthread.php?t=76925
>>>
>>> <quote>
>>> VBScript in Classic ASP is a little weird in that you only use
>>> parentheses when calling functions (that return a result), not when
>>> calling subs (that just do something, without returning a result).
>>> </quote>
>>>
>>> --
>>> Ron Symonds
>>> Microsoft MVP (Expression Web)
>>> http://www.rxs-enterprises.org/fp
>>>
>>> Reply only to group - emails will be deleted unread.
>>>
>>>
>>>
>>> "mett" <metta RemoveThis @removethismetta.org.uk> wrote in message
>>> news:eU0rGvDKKHA.4316@TK2MSFTNGP04.phx.gbl...
>>>> The error is
>>>>
>>>> Error Type:
>>>> Microsoft VBScript compilation (0x800A0414)
>>>> Cannot use parentheses when calling a Sub
>>>> /SITE_Aug07/m/page2.asp, line 106, column 23
>>>> replace(phonNum," ","")
>>>>
>>>> Any sugestions?
>>>> Thanks
>>>>
>>>> M
>>>>
>>>>
>>>>
>>>> "Ronx" <ronx917 RemoveThis @hotmail.com> wrote in message
>>>> news:OD3OVXBKKHA.4168@TK2MSFTNGP05.phx.gbl...
>>>>>I cannot see anything wrong with the syntax. Is this code segment
>>>>>within a DBR region or outside it? If outside, the fp_rs value may have
>>>>>been set to nothing, or not yet set to anything - what errors are you
>>>>>getting?
>>>>>
>>>>> --
>>>>> Ron Symonds
>>>>> Microsoft MVP (Expression Web)
>>>>> http://www.rxs-enterprises.org/fp
>>>>>
>>>>> Reply only to group - emails will be deleted unread.
>>>>>
>>>>>
>>>>>
>>>>> "mett" <metta RemoveThis @removethismetta.org.uk> wrote in message
>>>>> news:OpffKlAKKHA.1376@TK2MSFTNGP02.phx.gbl...
>>>>>> Can you help me with the syntax to do this as I can't get it
>>>>>> working...
>>>>>>
>>>>>> <%
>>>>>> phonNum=FP_FieldVal(fp_rs,"tel")
>>>>>>
>>>>>> replace(phonNum," ","")
>>>>>>
>>>>>> response.write(phonNum)
>>>>>>
>>>>>> %>
>>>>>>
>>>>>> Thanks
>>>>>> M
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Ronx" <ronx917 RemoveThis @hotmail.com> wrote in message
>>>>>> news:uEGjtVIJKHA.1488@TK2MSFTNGP03.phx.gbl...
>>>>>>> Use code to remove the spaces from the mobile pages, and leave as is
>>>>>>> for non-mobile pages.
>>>>>>>
>>>>>>> In classic asp (must be adapted to the script language you are
>>>>>>> using):
>>>>>>>
>>>>>>> 'get telephone from database and store in variable phoneNumber
>>>>>>> 'set mobilePage = true if page is for a mobile, otherwise set to
>>>>>>> false
>>>>>>> if mobilePage then
>>>>>>> replace(phoneNumber, " ", "")
>>>>>>> end if
>>>>>>> response.write(phoneNumber)
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Ron Symonds
>>>>>>> Microsoft MVP (Expression Web)
>>>>>>> http://www.rxs-enterprises.org/fp
>>>>>>>
>>>>>>> Reply only to group - emails will be deleted unread.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> "mett" <metta RemoveThis @removethismetta.org.uk> wrote in message
>>>>>>> news:ORm65GCJKHA.3708@TK2MSFTNGP02.phx.gbl...
>>>>>>>> I have phone numbers stored in a db as xxxxx xxxxxx however I am
>>>>>>>> starting to set up a mobile/pda site and the numbers need to be
>>>>>>>> xxxxxxxxxxx (no spaces)
>>>>>>>>
>>>>>>>> I can edit the db to remove the spaces BUT would like then to
>>>>>>>> display on the fp site with a space. Anyone know a simple
>>>>>>>> solution???
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> M
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>> |
|
| Back to top |
|
 |
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|