vbCRLF does not display on iPhone


#1

I am storing and retrieving data containing carriage returns from an SQLite database on the device. Works just fine on Android and BlackBerry but the carriage returns have no effect on the iPhone. The text all runs together with no line breaks.
I tried this:
dim sNote, backslash
backslash = Chr(92)
sNote = record["Note"]
sNote=Replace(sNote,vbCRLF,backslash & "n")
I also tried:
sNote=Replace(sNote,vbCRLF,"\n")

StackOverflow says to put a “\n” in place of the carriage return\Line Feed but what I am doing does not work.
Any help would be greatly appreciated.

Thanks
JamesF


#2

Since the ultimate output is HTML, try using < br > (no spaces).


#3

Thanks Eric.

But, no, I am not using HTML. It is straight ASCII text being inserted into a Boostrap textarea.

JamesF


#4

I know you’re not “using” HTML per se, but in the end that’s all a web app is. I could be completely off base, but did you actually try using the < br > tag in place of the vbcrlf (which, incidentally, is basically a \r\n anyway)?


#5

I gave it a try, just in case. You never know! J

It just does what I expected though. I end up with a
strings inserted into the text.

I save customer-typed text to a database and I then retrieve it and display it for editing in a textarea. It is not saved as rich text/HTML nor is it edited as rich text/HTML. Straight, unformatted ASCII text.

Thanks for your input.


#6

Unfortunately I don’t have any way to test anything at the moment and I don’t want to give you any more potential ideas that I can’t vet out myself. Good luck, and if you figure it out before someone here provides the answer, please post what you found out.


#7

Thanks Eric.

Will do.

JamesF


#8

James -

sNote=Replace(sNote,vbCRLF,backslash & “n”)

I would think you are looking to replace the chr(13)+chr(10) which are the ascii equivalents for the carriage return and line feed respectively?

Per the nsbasic wiki vbCRLF and ‘\n’ are equivalents.

Robb


#9

I just tried this on an iPhone - it worked fine:

   Textarea1.value = "George" & vbCRLF  & "Henne"

As did this

    newline = Chr(13)
    Textarea1.value = "George" & newline  & "Henne"