You are not logged in.

A1880

Intermediate

  • "A1880" is male
  • "A1880" started this thread

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

1

Saturday, September 5th 2009, 11:03pm

Quote characters in Strings

Hi,
in VB6 I can use double quotes inside a String.

Example:

Source code

1
  Msgbox "He said ""hello, sailor!"" to me ..."


In Jabaco, I have to use Chr(34) instead?

Source code

1
  Msgbox "He said " & Chr(34) & "hello, sailor!" & Chr(34) & " to me ..."


I have tried "\"", but this does'nt work either.

Am I missing something?

Cheers!

A1880

  • "StefanSchnell" is male

Posts: 102

Date of registration: Mar 13th 2009

Location: Oberirsen - Germany

Occupation: Senior Software Engineer

Hobbies: Programming aund Photography

  • Send private message

2

Sunday, September 13th 2009, 6:39pm

Hello A1880,
no solution for your problem, but a small hint how to use escape sequences with Jabaco. Look here for a great collection of Java components. Here a small example how to use the unescape function in the Lang component:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'-Begin-----------------------------------------------------------------

  Function unesc(myString As String) As String
    Dim strWriter As java#io#StringWriter
    If Len(myString) > 0 Then
      strWriter = New java#io#StringWriter(Len(myString))
      org#apache#commons#lang#StringEscapeUtils.unescapeJava(strWriter, myString)
      unesc = strWriter.toString()
    End If
  End Function  

  Public Sub main(ByJava args() As String)

    Dim myArgs() As String
    myArgs = args
    
    MsgBox unesc("Dies ist \nein Test")

  End Sub

'-End-------------------------------------------------------------------


But the \" does not work - it is a pity.

Cheers
Stefan
Visit my personal or commercial site
If you have questions or suggestions, write me an eMail or
meet me here

Rate this thread
WoltLab Burning Board