Jimmy
|
| Posted: 09/27/2005, 12:03 PM |
|
Hi all, need to get the following code to work, am not to clued up on this, so any help appriciated.
Code:
'Custom Code @44-73254650
' -------------------------
if not IsNull(adminbook.isbn.Value) then
adminbook.picture.Value = "./images/books/" & adminbook.isbn.Value & ".jpg"
end if
if not IsNull(adminbook.title.Value) then
adminbook.title2.Value =adminbook.title.Value
end if
adminbook.title2.Value = replace(adminbook.title2.Value, "'", "/'")
' -------------------------
'End Custom Code
The purpose of the code is
1. To set the value of the "picture" field with the pathing, this works.
2. to set the "title2" field to be equal to that of the "title" field - does not work.
3. to replace any " ' " with " /' " within the "title2" field - does not work.
Any help for me please ?
RGDS
|
|
|
 |
DonB
|
| Posted: 09/27/2005, 12:32 PM |
|
Never liked IsNull, seems to be a problem most of the time. I suspect the
value is Empty or '' not Null.
Depending on where this code is, it might not retrieve the value anyway.
Try temporarily inserting:
print "<br>Value = " & adminbook.picture2.Value
or
print "<br>null = " & IsNull(adminbook.idbn.Value)
etc., to see what;s going on.
You might not see the output unless you follow the last print statement
with:
Response.End
to kill the script (and avoid a page reload that might erase the print
values).
--
DonB
http://www.gotodon.com/ccbth
"Jimmy" <Jimmy@forum.codecharge> wrote in message
news:64339978ade78b@news.codecharge.com...
> Hi all, need to get the following code to work, am not to clued up on
this, so
> any help appriciated.
>
> Code:
>
> 'Custom Code @44-73254650
> ' -------------------------
> if not IsNull(adminbook.isbn.Value) then
> adminbook.picture.Value = "./images/books/" & adminbook.isbn.Value &
".jpg"
> end if
> if not IsNull(adminbook.title.Value) then
> adminbook.title2.Value =adminbook.title.Value
> end if
> adminbook.title2.Value = replace(adminbook.title2.Value, "'", "/'")
> ' -------------------------
> 'End Custom Code
>
> The purpose of the code is
> 1. To set the value of the "picture" field with the pathing, this works.
> 2. to set the "title2" field to be equal to that of the "title" field -
does
> not work.
> 3. to replace any " ' " with " /' " within the "title2" field - does not
> work.
>
> Any help for me please ?
>
> RGDS
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|