Word wrapping a string to arbitrary position?

Just starting out? Need help? Post your questions and find answers here.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4946
Joined: Sun Apr 12, 2009 6:27 am

Re: Word wrapping a string to arbitrary position?

Post by RASHAD »

Hi Fangles
Why bother yourself if windows can do the job for you
Final Text$ is your aim

Code: Select all

If OpenWindow(1, 40, 40, 400, 460, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   EditorGadget(1, 10, 40, 380, 200)
   EditorGadget(2, 10, 250, 380, 200)
   SendMessage_(GadgetID(1), #EM_SETTARGETDEVICE, #Null, 0)
   ButtonGadget(3,10,10, 80, 24, "Test Output")
   Text$ = "This is another long line of text to see if scrollbars come up automatically.This is another long line of text to see if scrollbars come up automatically.This is another long line of text to see if scrollbars come up automatically"
   
   width = 380
   RLL = 30

   SetGadgetText(1, Text$)
   For x = 1 To 100
    oldll = 0   
    For x = 0 To CountGadgetItems(1) - 1
       LLength = Len(GetGadgetItemText(1, x))
       If LLength > Oldll
          oldll = llength
       EndIf
    Next
    Debug oldll   
    If oldll > RLL -1 And (rll - oldll) <> 0
      width = width - (oldll - RLL)*2
      ClearGadgetItems(1)
      ResizeGadget(1,10,40,width,200)
      SetGadgetText(1, Text$)
    Else
      Break
    EndIf
   Next
   
  Repeat
     Event=WaitWindowEvent(1)
     Select Event
         Case #PB_Event_Gadget
            Select EventGadget()
              Case 3
                Text$ = GetGadgetItemText(1, 0)
                For x = 1 To CountGadgetItems(1) - 1
                   GetGadgetItemText(1, x)
                   Text$ =Text$+#CRLF$ + GetGadgetItemText(1, x)
                Next
                SetGadgetText(2, Text$)
               
            EndSelect
      EndSelect
   Until Event=#PB_Event_CloseWindow
   
EndIf
Edit :Now it is more accurate
Egypt my love
mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

Re: Word wrapping a string to arbitrary position?

Post by mestnyi »

Little John wrote:

Code: Select all

EnableExplicit

Procedure.s WordWrap (source$, width.i, delimList$="- "+Chr(9), nl$=#LF$)
   Protected.i posn, found, i
   Protected ret$=""
   
   If width <= 0
      ProcedureReturn source$
   EndIf
   
   posn = Len(source$)
   While posn > width
      For i = width To 1 Step -1
         found = FindString(delimList$, Mid(source$,i,1))
         If found > 0
            posn = i
            Break
         EndIf
      Next
      If found = 0
         For i = width+1 To posn
            found = FindString(delimList$, Mid(source$,i,1))
            If found > 0
               posn = i
               Break
            EndIf
         Next
      EndIf
      
      ret$ + RTrim(Left(source$, posn)) + nl$
      source$ = LTrim(Mid(source$, posn+1))
      posn = Len(source$)
   Wend
   
   ProcedureReturn ret$ + source$
EndProcedure


;-- Demo
Define source$, msg$

source$ = "Wrap me baby but don't hurt me, I'll be good like a long stringy should and would!"

msg$ = WordWrap(source$, 30)
MessageRequester("Word wrap demo", msg$)
msg$ = WordWrap(source$, 1)
MessageRequester("Word wrap demo", msg$)
This code can be accelerated by using a pointer to a character instead of Mid().
I know that this is an old post, but I still ask. :)
How can this be accelerated with an example?
User avatar
mk-soft
Always Here
Always Here
Posts: 6209
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Word wrapping a string to arbitrary position?

Post by mk-soft »

I have modified my DrawTextBox() for it.

Code: Select all

; -----------------------------------------------------------------------------------

; Kommentar     : DrawTextBox
; Author        : mk-soft
; Second Author :
; Orginal       : DrawTextBox.pbi
; Version       : 1.05
; Erstellt      : 20.04.2014
; Geändert      : 29.09.2018

; -----------------------------------------------------------------------------------

EnableExplicit

; -----------------------------------------------------------------------------------

EnumerationBinary TextBox
  #TEXT_Right
  #TEXT_HCenter
  #TEXT_VCenter
  #TEXT_Bottom
EndEnumeration

; -----------------------------------------------------------------------------------

Procedure DrawTextBox(x, y, dx, dy, text.s, flags = 0)
  
  Protected is_right, is_hcenter, is_vcenter, is_bottom
  Protected text_width, text_height, rows_height
  Protected text_x, text_y, break_y
  Protected text2.s, rows, row, row_text.s, row_text1.s, out_text.s, start, count
  
  ; Flags
  is_right = flags & #TEXT_Right
  is_hcenter = flags & #TEXT_HCenter
  is_vcenter = flags & #TEXT_VCenter
  is_bottom = flags & #TEXT_Bottom
  
  ; Übersetze Zeilenumbrüche
  text = ReplaceString(text, #LFCR$, #LF$)
  text = ReplaceString(text, #CRLF$, #LF$)
  text = ReplaceString(text, #CR$, #LF$)
  
  ; Erforderliche Zeilenumbrüche setzen
  rows = CountString(text, #LF$)
  For row = 1 To rows + 1
    text2 = StringField(text, row, #LF$)
    If text2 = ""
      out_text + #LF$
      Continue
    EndIf
    start = 1
    count = CountString(text2, " ") + 1
    Repeat
      row_text = StringField(text2, start, " ") + " "
      Repeat
        start + 1
        row_text1 = StringField(text2, start, " ")
        If TextWidth(row_text + row_text1) < dx - 12
          row_text + row_text1 + " "
        Else
          Break
        EndIf
      Until start > count
      out_text + RTrim(row_text) + #LF$
    Until start > count
  Next
  
  ; Berechne Y-Position
  text_height = TextHeight("X")
  rows = CountString(out_text, #LF$)
  If is_vcenter
    CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
      text_y = (dy / 2 - text_height / 2) - (text_height / 2 * (rows-1)) - 2
    CompilerElse
      text_y = (dy / 2 - text_height / 2) - (text_height / 2 * (rows-1))
    CompilerEndIf
  ElseIf is_bottom
    text_y = dy - (text_height * rows) - 2
  Else
    text_y = 2
  EndIf
  
  ; Korrigiere Y-Position
  While text_y < 2
    text_y = 2;+ text_height
  Wend
  
  break_y = dy - text_height / 2
  
  ; Text ausgeben
  For row = 1 To rows
    row_text = StringField(out_text, row, #LF$)
    If is_hcenter
      text_x = dx / 2 - TextWidth(row_text) / 2
    ElseIf is_right
      text_x = dx - TextWidth(row_text) - 4
    Else
      text_x = 4
    EndIf
    DrawText(x + text_x, y + text_y, row_text)
    text_y + text_height
    If text_y > break_y
      Break
    EndIf
  Next
  
  ProcedureReturn rows
  
EndProcedure

; -------------------------------------------------------------------------------------

Procedure.s WrapText(Width, text.s, FontID = 0)
  Protected text_width
  Protected text_x
  Protected text2.s, rows, row, row_text.s, row_text1.s, out_text.s, start, count
  Protected image = CreateImage(#PB_Any, 32, 32)
  
  ; Übersetze Zeilenumbrüche
  text = ReplaceString(text, #LFCR$, #LF$)
  text = ReplaceString(text, #CRLF$, #LF$)
  text = ReplaceString(text, #CR$, #LF$)
  
  If StartDrawing(ImageOutput(image))
    If FontID
      DrawingFont(FontID)
    EndIf
    ; Erforderliche Zeilenumbrüche setzen
    rows = CountString(text, #LF$)
    For row = 1 To rows + 1
      text2 = StringField(text, row, #LF$)
      If text2 = ""
        out_text + #LF$
        Continue
      EndIf
      start = 1
      count = CountString(text2, " ") + 1
      Repeat
        row_text = StringField(text2, start, " ") + " "
        Repeat
          start + 1
          row_text1 = StringField(text2, start, " ")
          If TextWidth(row_text + row_text1) < Width - 12
            row_text + row_text1 + " "
          Else
            Break
          EndIf
        Until start > count
        out_text + RTrim(row_text) + #LF$
      Until start > count
    Next
    out_text = RTrim(out_text, #LF$)
    StopDrawing()
  EndIf
  FreeImage(image)
  
  ProcedureReturn #LF$ + out_text
  
EndProcedure

; -------------------------------------------------------------------------------------

CompilerIf #PB_Compiler_IsMainFile
  
  
  Procedure.s GetDataSectionText(Addr)
    Protected result.s, temp.s
    While PeekC(Addr)
      temp = PeekS(Addr)
      Addr + StringByteLength(temp)  + SizeOf(Character)
      result + temp
    Wend
    ProcedureReturn result
  EndProcedure
  
  Define t1.s, t2.s
  
  t1 = GetDataSectionText(?Text1)
  
  t2 = WrapText(500, t1)
  Debug t2
  
  t2 = WrapText(300, t1)
  Debug t2
  
  t2 = WrapText(150, t1)
  Debug t2
  
  
  DataSection
    Text1:
    Data.s "PureBasic is a native 32-bit and 64-bit programming language based on established BASIC rules." 
    Data.s "The key features of PureBasic are portability (Windows, Linux And MacOS X are currently supported)," 
    Data.s "the production of very fast And highly optimized executables And, of course, the very simple BASIC syntax."
    Data.s "PureBasic has been created For the beginner And expert alike."
    Data.i 0
    Text2:
    Data.s "We have put a lot of effort into its realization To produce a fast, reliable system friendly language."
    Data.s "In spite of its beginner-friendly syntax, the possibilities are endless With PureBasic's advanced "
    Data.s "features such As pointers, structures, procedures, dynamically linked lists And much more."
    Data.s "Experienced coders will have no problem gaining access To any of the legal OS structures"
    Data.s "Or API objects And PureBasic even allows inline ASM."
    Data.i 0
  EndDataSection
  
CompilerEndIf
[/size]

P.S.
Ok, not faster, but variable character width
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

Re: Word wrapping a string to arbitrary position?

Post by mestnyi »

Your procedure does not work correctly.
The procedure Little John also did not work correctly, but after some changes it began to work like a charm. :)

Here is an example.

Code: Select all

LoadFont(0, "Courier", 14)
  
t2 = WrapText(132, t1б FontID(0))
Debug ReplaceString(t2, " ", "*")

DataSection
    Text1:
    Data.s "Vertical & Horizontal" + #LF$ + "   Centered   Text in   " + #LF$ + "Multiline StringGadget"
    Data.i 0
  EndDataSection
The result should be. :D
  • Vertical*&*
    Horizontal
    ***Centered***
    Text*in***
    Multiline*
    StringGadget
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4946
Joined: Sun Apr 12, 2009 6:27 am

Re: Word wrapping a string to arbitrary position?

Post by RASHAD »

Maybe too late but I just got informed

Code: Select all

Stringy$ = "Wrap me baby but don't hurt me, I'll be good like a long stringy should And would!"
;Stringy$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmneopqrstuvwxyz"
nc = 30
Fontsize = 14
LoadFont(0,"Consolas",Fontsize)

Global Dim text$(Len(Stringy$)/nc + 1)
Repeat
  t$ = Left(Stringy$,nc)
  text$(n) = t$
  n+1
  Stringy$ = RemoveString(Stringy$, t$)
Until Stringy$ = ""
For run = 0 To n
  nStringy$ = nStringy$ + text$(run) + #CRLF$
Next

If OpenWindow(1, 0, 0, 600, 400, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  TextGadget(0,0,0,0,0,Space(nc))
  SetGadgetFont(0,FontID(0))
  gw = GadgetWidth(0,#PB_Gadget_RequiredSize)
  FreeGadget(0)
  StringGadget(1, 10, 10, gw+Fontsize, 200, nStringy$,#ES_MULTILINE)
  SetGadgetFont(1,FontID(0))   

Repeat
  Event=WaitWindowEvent(1)

Until Event=#PB_Event_CloseWindow
   
EndIf
Egypt my love
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Word wrapping a string to arbitrary position?

Post by Little John »

mestnyi wrote:The procedure Little John also did not work correctly
Can you prove that statement?
User avatar
mk-soft
Always Here
Always Here
Posts: 6209
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Word wrapping a string to arbitrary position?

Post by mk-soft »

I drove well with the spaces as a character break.
In Microsoft Word you can also enter a protected space.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: Word wrapping a string to arbitrary position?

Post by Marc56us »

mk-soft wrote:In Microsoft Word you can also enter a protected space.
(added)
You can do it too everywhere with a 'non-breaking space' char

Code: Select all

; Non-breaking space ASCII (255) and Unicode ($A0 + $00)

For i = 1 To 10
    
    ; ASCII: Blank space = Chr(255)
    ; NoSplitText$ + "Hello" + Chr(255) + "World!"
    
    ; UTF16: Blank space = A0 + 00
    NoSplitText$ + "Hello" + Chr($A0) + Chr($00) + "World! "
    
Next i

Debug NoSplitText$
CopyDebugOutput()
RunProgram("notepad")
; send ctrl+v and try to reduce window: "Hello World!" will remain together.
(in HTML &nbsp;)

:wink:
mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

Re: Word wrapping a string to arbitrary position?

Post by mestnyi »

Little John wrote:
mestnyi wrote:The procedure Little John also did not work correctly
Can you prove that statement?

Code: Select all

EnableExplicit

XIncludeFile "WordWrapW.pbi"

LoadFont(0, "Courier", 14)

Procedure ShowWindow (title$, text$, softWrapWidth.i, hardWrapWidth.i=-1, delimList$=" "+Chr(9), nl$=#LF$, liStart$="")
  If OpenWindow(0, 0, 0, 450, 650, title$, #PB_Window_SystemMenu | #PB_Window_ScreenCentered) = 0
    MessageRequester("Fatal error", "Program terminated.")
    End
  EndIf
  
  TextGadget(0, 10, 10, 430, 330, "")
  If StartDrawing(WindowOutput(0))
    DrawingFont(FontID(0))
    Protected text1$ = WordWrapW(0, 0, text$, softWrapWidth-12, hardWrapWidth, delimList$, nl$, liStart$)
    StopDrawing()
  EndIf
  SetGadgetText(0, ReplaceString(text1$, " ", "*"))
  SetGadgetColor(0, #PB_Gadget_BackColor, $CCBFB4)
  SetGadgetFont(0,FontID(0) )
  
  EditorGadget(10, 10, 350, softWrapWidth, 200, #PB_Editor_WordWrap) 
  SetGadgetText(10, text$)
  SetGadgetFont(10,FontID(0) )
  
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
  CloseWindow(0)
EndProcedure


Define line$, text$

line$ = "Vertical & Horizontal" + #LF$ + "   Centered   Text in   " + #LF$ + "Multiline StringGadget"

ShowWindow("Word wrap demo", line$, 104)
Here is a remake of me.
http://forums.purebasic.com/english/vie ... 3d#p527759
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Word wrapping a string to arbitrary position?

Post by Little John »

That code is not executable at all.

Get serious!
Post complete executable code that contains my code of which you claimed that it does not work correctly, and tell me why it is incorrect in your opinion.
mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

Re: Word wrapping a string to arbitrary position?

Post by mestnyi »

Little John wrote:That code is not executable at all.

Get serious!
Post complete executable code that contains my code of which you claimed that it does not work correctly, and tell me why it is incorrect in your opinion.
Here is a complete example.

Code: Select all

; v1.01, tested with PB 5.10 on Windows XP x86 (should be cross-platform, though)

Procedure.i GetTextWidth (window.i, gadget.i, text$)
   ; in : window: window number
   ;      gadget: gadget number
   ;      text$ : This function does not require that the text is
   ;              actually shown in the gadget.
   ; out: width of text$ in pixels
   Protected width.i=-1

   If StartDrawing(WindowOutput(window))
      DrawingFont(GetGadgetFont(gadget))
      width = TextWidth(text$)
      StopDrawing()
   EndIf

   ProcedureReturn width  ; -1 on error
EndProcedure

Procedure.i GetTextLen (window.i, gadget.i, text$, width.i)
   ; in : window: window number
   ;      gadget: gadget number
   ;      width : available width in pixels
   ;      text$ : This function does not require that the text is
   ;              actually shown in the gadget.
   ; out: maximum number of characters of text$ (counted from the left)
   ;      which fit into the available width
   Protected length.i=-1

   If StartDrawing(WindowOutput(window))
      DrawingFont(GetGadgetFont(gadget))
      length = Len(text$)
      While length > 0 And TextWidth(Left(text$, length)) > width
         length - 1
      Wend
      StopDrawing()
   EndIf

   ProcedureReturn length  ; -1 on error
EndProcedure


Procedure.s LineWrapW (window.i, gadget.i, line$, softWrapWidth.i, hardWrapWidth.i=-1, delimList$=" "+Chr(9), nl$=#LF$, indent$="")
   ; -- Word wrap in *one line* in a window (can have a variable-width font)
   ; in: line$  : line which is to be wrapped
   ;     indent$: "" or a string consisting of blanks, used for indenting lines of list items
   ;
   ;     For the meaning of the other parameters see function WordWrapW().
   Protected.i posn, found, i, softWrapPosn, hardWrapPosn, firstChar=Len(indent$)+1
   Protected ret$=""

   softWrapPosn = GetTextLen(window, gadget, line$, softWrapWidth)
   If softWrapPosn < firstChar
      ProcedureReturn line$
   EndIf

   posn = Len(line$)
   While posn > softWrapPosn
      ; search for rightmost delimiter <= softWrapPosn:
      For i = softWrapPosn To firstChar Step -1
         found = FindString(delimList$, Mid(line$,i,1))
         If found
            posn = i
            Break
         EndIf
      Next

      If found = 0    ; if there is no delimiter <= softWrapPosn
         If hardWrapWidth < 0
            ; insert hard wrap at position of soft wrap:
            posn = softWrapPosn
         Else
            ; search for leftmost delimiter > softWrapPosn:
            For i = softWrapPosn+1 To posn
               found = FindString(delimList$, Mid(line$,i,1))
               If found
                  posn = i
                  Break
               EndIf
            Next
            If hardWrapWidth > 0
               hardWrapPosn = GetTextLen(window, gadget, line$, hardWrapWidth)
               If hardWrapPosn < posn
                  ; insert hard wrap at given position:
                  posn = hardWrapPosn
               EndIf
            EndIf
         EndIf
      EndIf

      ret$ + RTrim(Left(line$, posn)) + nl$
      line$ = LTrim(Mid(line$, posn+1))
      If line$ <> ""
         line$ = indent$ + line$
      EndIf

      softWrapPosn = GetTextLen(window, gadget, line$, softWrapWidth)
      posn = Len(line$)
   Wend

   ProcedureReturn ret$ + line$
EndProcedure


Procedure.s WordWrapW (window.i, gadget.i, text$, softWrapWidth.i, hardWrapWidth.i=-1, delimList$=" "+Chr(9), nl$=#LF$, liStart$="")
   ; ## Main function ##
   ; -- Word wrap in *one or more lines* in a window (can have a variable-width font)
   ; in : window       : window number
   ;      gadget       : gadget number
   ;      text$        : text which is to be wrapped;
   ;                     may contain #CRLF$ (Windows), or #LF$ (Linux and modern Mac systems) as line breaks
   ;      softWrapWidth: the desired maximum width (pixels) of each resulting line
   ;                     if a delimiter was found (not counting the length of the inserted nl$);
   ;                     if no delimiter was found at a position <= softWrapWidth, a line might
   ;                     still be longer if hardWrapWidth = 0 or > softWrapWidth
   ;      hardWrapWidth: guaranteed maximum width (pixels) of each resulting line
   ;                     (not counting the length of the inserted nl$);
   ;                     if hardWrapWidth <> 0, each line will be wrapped at the latest at
   ;                     hardWrapWidth, even if it doesn't contain a delimiter;
   ;                     default setting: hardWrapWidth = softWrapWidth
   ;      delimList$   : list of characters which are used as delimiters;
   ;                     any delimiter in line$ denotes a position where a soft wrap is allowed
   ;      nl$          : string to be used as line break (normally #CRLF$ or #LF$)
   ;      liStart$     : string at the beginning of each list item
   ;                     (providing this information makes proper indentation possible)
   ;
   ; out: return value : text$ with given nl$ inserted at appropriate positions
   ;
   ; <http://www.purebasic.fr/english/viewtopic.php?f=12&t=53800>
   Protected.i numLines, i, indentPixels, indentLen=-1
   Protected line$, indent$, ret$=""

   numLines = CountString(text$, #LF$) + 1
   For i = 1 To numLines
      line$ = RTrim(StringField(text$, i, #LF$), #CR$)

      If FindString(line$, liStart$) = 1
         If indentLen = -1
            indentPixels = GetTextWidth(window, gadget, liStart$)
            indentLen = GetTextLen(window, gadget, Space(Len(text$)), indentPixels)
         EndIf
         indent$ = Space(indentLen)
      Else
         indent$ = ""
      EndIf

      ret$ + LineWrapW(window, gadget, line$, softWrapWidth, hardWrapWidth, delimList$, nl$, indent$)
      If i < numLines
         ret$ + nl$
      EndIf
   Next

   ProcedureReturn ret$
EndProcedure


EnableExplicit

;XIncludeFile "WordWrapW.pbi"

LoadFont(0, "Courier", 14)

Procedure ShowWindow (title$, text$, softWrapWidth.i, hardWrapWidth.i=-1, delimList$=" "+Chr(9), nl$=#LF$, liStart$="")
  If OpenWindow(0, 0, 0, 450, 650, title$, #PB_Window_SystemMenu | #PB_Window_ScreenCentered) = 0
    MessageRequester("Fatal error", "Program terminated.")
    End
  EndIf
  
  TextGadget(0, 10, 10, 430, 330, "")
  Protected text1$ = WordWrapW(0, 0, text$, softWrapWidth-12, hardWrapWidth, delimList$, nl$, liStart$)
  SetGadgetText(0, ReplaceString(text1$, " ", "*"))
  SetGadgetColor(0, #PB_Gadget_BackColor, $CCBFB4)
  SetGadgetFont(0,FontID(0) )
  
  EditorGadget(10, 10, 350, softWrapWidth, 200, #PB_Editor_WordWrap) 
  SetGadgetText(10, text$)
  SetGadgetFont(10,FontID(0) )
  
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
  CloseWindow(0)
EndProcedure


Define line$, text$

line$ = "Vertical & Horizontal" + #LF$ + "   Centered   Text in   " + #LF$ + "Multiline StringGadget"

ShowWindow("Word wrap demo", line$, 104)
The result should be.
Vertical*&*
Horizontal
***Centered***
Text*in***
Multiline*
StringGadget

and your result looks like this
1) deletes spaces at the end of a line
2) the transfer width does not match (editor gadget)
Vertical*&
Horizontal
***Centered
Text*in***
Multiline
StringGadget

it was so obvious to me that I didn’t think okay excuse me that I wasted your time in vain. :oops:
Last edited by mestnyi on Thu Oct 04, 2018 5:28 am, edited 1 time in total.
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Word wrapping a string to arbitrary position?

Post by Little John »

mestnyi wrote:
Little John wrote:That code is not executable at all.

Get serious!
Post complete executable code that contains my code of which you claimed that it does not work correctly, and tell me why it is incorrect in your opinion.
Replace the following procedures and everything will work. I do not like to often cause start drawing. :D
Still no executable code, and no English text that explains where you believe to see code of mine that does not work correctly.
Very bad style :!:

Anyway, my life time is limited, and I don't have any more time to play with you.
Post Reply