You are not logged in.

Yuyu

Beginner

  • "Yuyu" started this thread

Posts: 8

Date of registration: May 14th 2011

  • Send private message

1

Wednesday, June 15th 2011, 12:43am

vbCr, vbCrLf and CHR(10) on server

Greetings

I raise small server program.

The question might function computer CHR (10) or vbCr, vbCrLf works well but when you upload web server does not make line breaks.

Various tests but know you are doing wrong.

Thanks.

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

2

Wednesday, June 15th 2011, 1:16pm

Could you put your question in other words or post code + screenshot to illustrate your problem?
I don't understand what's wrong. Sorry!

Greetings

A1880

Yuyu

Beginner

  • "Yuyu" started this thread

Posts: 8

Date of registration: May 14th 2011

  • Send private message

3

Wednesday, June 15th 2011, 3:52pm

vbCr, vbCrLf and CHR(10) on server

Greetings

Sorry if I did not explain well.

1st question.

At design time the label (x) respecting the design.



In losing runtime established format.



2nd question.

I try different methods of concatenation of characters and personal computer function properly.

Label11.Caption = DatosJugador.Nombre & vbCrLf & DatosJugador.Profesion
or
Label11.Caption = DatosJugador.Nombre & vbCr & DatosJugador.Profesion
or
Label11.Caption = DatosJugador.Nombre & chr(10) & DatosJugador.Profesion



The problem occurs when uploading web server program where you can lose formatting.




I hope to explain better this time.

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

4

Wednesday, June 15th 2011, 6:19pm

In Java Swing applets you can make use of the fact that JLabel actually supports HTML.

To my surprise, the following works:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Option Explicit

Public Sub Applet_Initialize()
   Const nl = "<P>"   

   Dim txt As String = _
            "<html><body>" _
          & "<div align=center>" _
     & nl & "&nbsp;" _
     & nl & "Now is the time" _
     & nl & "for all brave men" _
     & nl & "to come to the aid" _
     & nl & "of their party!" _
          & "</div>" _
          & "</body></html>"
     
   With Label1
      .BackStyle = vbSolid   
      .BackColor = RGB(0, 0, 255)
      .ForeColor = RGB(255, 255, 255)
      .FontSize = 12
      .FontBold = True 
      .Caption = txt
   End With
End Sub





Greetings

A1880

Yuyu

Beginner

  • "Yuyu" started this thread

Posts: 8

Date of registration: May 14th 2011

  • Send private message

5

Wednesday, June 15th 2011, 10:06pm

vbCr, vbCrLf and CHR(10) on server

Thanks for your reply.

This solution does not stop being valid on the server side, you could see this link:

http://yuyusub.xp3.biz/

"<div center> align =" not executed.

when I include the code of my program and upload to the server by label (x) not be executed.

Option Explicit
'
Const nl = "<P>"

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim txt As String = nl & _ DatosJugador.Nombre
& Nl & DatosJugador.Profesion

Label11.Caption = txt


QUESTIONS me a solution with Unicode characters.

Greetings.

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

6

Wednesday, June 15th 2011, 10:35pm

In Java and thus in Jabaco all characters are encoded as Unicode characters internally.
I've tried my sample with German characters "äöüÄÖÜß". They are displayed correctly.

There might be some Swing properties which influence the character encoding.
You might want to Google for "java swing unicode" to get hints.

I've found a hint about how to set the default file encoding to Unicode.
It seems to be (non Unicode) Cp1252 by default on Windows systems.

Greetings

A1880

This post has been edited 2 times, last edit by "A1880" (Jun 15th 2011, 11:12pm)


Yuyu

Beginner

  • "Yuyu" started this thread

Posts: 8

Date of registration: May 14th 2011

  • Send private message

7

Thursday, June 16th 2011, 1:12am

vbCr, vbCrLf and CHR(10) on server

I do not understand very well be happening.

Reviewing the code to achieve this:

Dim txt As String = _
"<html><body>" _
& "<div align = left>" _
& Chr(10) & DatosJugador.Nombre _
& Chr(10) & DatosJugador.Profesion _
& "</div>" _
& "</body></html>"
Label11.Caption = txt


Now on my home computer do not line break but to my surprise the web server host if it works.

Not to understand that to be happening but this code works.

"<div align = center>" This sentence does not run correctly.

Greeting.

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

8

Thursday, June 16th 2011, 9:05am

Try to leave out the spaces around "=" and write "<div align=center>" rather than "<div align = center>".

Greetings

A1880

Rate this thread
WoltLab Burning Board