Alpha Video Training
Results 1 to 10 of 10

Thread: Ignore Double Quotes In Xbasic Stritran

  1. #1
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,641

    Default Ignore Double Quotes In Xbasic Stritran

    I'm doing a string replacement in an Xbasic function and the string I need to replace contains double-quotes ie) Type="N"

    How do I escape or otherwise ignore the double quotes in the string so the stritran function doesn't complain? It does not like this:

    Code:
    newdata = stritran(data,"Type="N"","")

    stritran.jpg
    Alpha Anywhere v12.4.6.1.2 Build 6012-5338 IIS v8.5 on Windows Server 2012 in Hyper-V

  2. #2
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,607

    Default Re: Ignore Double Quotes In Xbasic Stritran

    Escape
    ..
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  3. #3
    "Certified" Alphaholic mikeallenbrown's Avatar
    Real Name
    Mike Brown
    Join Date
    Nov 2009
    Location
    United States
    Posts
    1,843

    Default Re: Ignore Double Quotes In Xbasic Stritran

    I think you add a single quote in front of the double quote you want to escape.

    Code:
    newdata = stritran(data,"Type='"N'"","")
    EDIT ...ooppss, that is definitely not it. What about adding another double quote?
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

  4. #4
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,641

    Default Re: Ignore Double Quotes In Xbasic Stritran

    Nope, extra double quotes won't work, and backslash won't work.
    Alpha Anywhere v12.4.6.1.2 Build 6012-5338 IIS v8.5 on Windows Server 2012 in Hyper-V

  5. #5
    "Certified" Alphaholic mikeallenbrown's Avatar
    Real Name
    Mike Brown
    Join Date
    Nov 2009
    Location
    United States
    Posts
    1,843

    Default Re: Ignore Double Quotes In Xbasic Stritran

    Here you go...

    Code:
    dim test as c = ""
    
    test = "Type=\"N\""
    
    ?test
    = Type="N"
    Credit goes to Sarah: https://www.alphasoftware.com/alphaf...-Quote-Problem
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

  6. #6
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,641

    Default Re: Ignore Double Quotes In Xbasic Stritran

    Quote Originally Posted by mikeallenbrown View Post
    Here you go...

    Code:
    dim test as c = ""
    
    test = "Type=\"N\""
    
    ?test
    = Type="N"
    Credit goes to Sarah: https://www.alphasoftware.com/alphaf...-Quote-Problem
    Perfect! Thanks Mike
    Alpha Anywhere v12.4.6.1.2 Build 6012-5338 IIS v8.5 on Windows Server 2012 in Hyper-V

  7. #7
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,607

    Default Re: Ignore Double Quotes In Xbasic Stritran

    Quote Originally Posted by iRadiate View Post
    Nope, extra double quotes won't work, and backslash won't work.
    What did you try with backslashes that didn't work. Curious minds...
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  8. #8
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,641

    Default Re: Ignore Double Quotes In Xbasic Stritran

    Quote Originally Posted by Al Buchholz View Post
    What did you try with backslashes that didn't work. Curious minds...
    Don't know now, I must have put them in the wrong spot I guess.
    Alpha Anywhere v12.4.6.1.2 Build 6012-5338 IIS v8.5 on Windows Server 2012 in Hyper-V

  9. #9
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,607

    Default Re: Ignore Double Quotes In Xbasic Stritran

    Quote Originally Posted by iRadiate View Post
    Don't know now, I must have put them in the wrong spot I guess.
    I hate it when that happens.....
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  10. #10
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,641

    Default Re: Ignore Double Quotes In Xbasic Stritran

    Syntax bites me more than I like!
    Alpha Anywhere v12.4.6.1.2 Build 6012-5338 IIS v8.5 on Windows Server 2012 in Hyper-V

Similar Threads

  1. Basic Xbasic question about double quotes
    By WindForce in forum Mobile & Browser Applications
    Replies: 4
    Last Post: 02-09-2017, 10:44 PM
  2. Update using stritran() in xbasic
    By Rbooz946 in forum Alpha Five Version 10 - Desktop Applications
    Replies: 4
    Last Post: 08-10-2011, 04:28 PM
  3. Select String with Double Quotes in MySQL
    By Steve Workings in forum Application Server Version 10 - Web/Browser Applications
    Replies: 10
    Last Post: 07-29-2010, 12:33 AM
  4. Double quotes in imported files
    By Carl Giffels in forum Alpha Five Version 5
    Replies: 0
    Last Post: 08-16-2005, 07:49 AM
  5. Can't type double quotes in fields.
    By Marcel Kollenaar in forum Alpha Five Version 5
    Replies: 6
    Last Post: 01-22-2004, 12:59 PM

Bookmarks

Posting Permissions

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