Another Replace question :-)...

Results 1 to 2 of 2

Thread: Another Replace question :-)...

  1. #1
    Join Date
    Dec 1969

    Default Another Replace question :-)...

    Hi,<BR><BR>I have this function:<BR>---------<BR>function fixDelimiter( theString )<BR>fixDelimiter = REPLACE( theString, ".", "," )<BR>end function<BR>---------<BR><BR>I use it for changing the decimals delimiter for currency field.<BR><BR>I extract the records from the Access database and I apply this function: &#060;%=fixDelimiter(rs("Price"))%&#062;<BR>So, now it replace the "." found in the price field with ",".<BR><BR>But if that field is null I get an error because of the Replace function.<BR><BR>How can I detect if "theString" in the function is null and exit function?<BR><BR>I know I can code this for each record but maybe is another way to code it only once in the function.<BR><BR>Thanks,<BR>Mircea

  2. #2
    Join Date
    Dec 1969

    Default RE: Another Replace question :-)...

    &#060;%If rs("Price") &#060;&#062; "" Then%&#062;<BR> &#060;%=fixDelimiter(rs("Price"))%&#062;<BR>&#060; %End If%&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts