Skip to main content

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba

By default, a text box holds a single line of text. you can enable support for multi-line text boxes. The last parameter of the textbox
function contains a variable to set the textbox style.


code snippet 1:


Const ES_MULTILINE = &h0004&

Sub Main
 
 Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
   TextBox 16,20, 80, 40, .Edit1, ES_MULTILINE
 End Dialog
 Dim Dialog_1Var As Dialog_1
 Dialog_1.Edit1 = "You text will wrap to the next line if single line is not enough"

 Dialog Dialog_1Var
End Sub

Depending on your needs you could use  a ListBox to Display your data. The items  can be stored in an array and therefore easy to access:


Code snippet 2:


Sub main
   Dim ListBox1() as String
   ReDim ListBox1(10)
  
       ListBox1(0)= " "
       ListBox1(1)= "MultiLine"
       ListBox1(2)= "with "
       ListBox1(3)= "Listbox"
       ListBox1(4)= "Why not ?"

 

   Begin Dialog UserDialog 133 , 66 , 171 , 100 , "LIST BOX"
   
      Text  3, 3, 34, 9, "INFO:", .Text2
      ListBox  3, 14, 83, 80, ListBox1(), .ListBox2

      OKButton  105, 6, 54, 14
      CancelButton  105, 26, 54, 14
   End Dialog
   Dim mydialog as UserDialog
   On Error Resume Next
   Dialog mydialog
   If Err=102 then
      MsgBox "Dialog box canceled."
   End If
End Sub


I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba

Thank you Andre for the Multiline option. The List Box doesnt work because I cannot select multiple items at the same time to copy the information from.

I did some further research and found other possible options but unsure if and how they can work in pairs with each other or individually as the finding didnt provide much support around them.

Const ES_LEFT           = &h0000&

Const ES_CENTER         = &h0001&

Const ES_RIGHT          = &h0002&

Const ES_MULTILINE      = &h0004&

Const ES_UPPERCASE      = &h0008&

Const ES_LOWERCASE      = &h0010&

Const ES_PASSWORD       = &h0020&

Const ES_AUTOVSCROLL    = &h0040&

Const ES_AUTOHSCROLL    = &h0080&

Const ES_NOHIDESEL      = &h0100&

Const ES_OEMCONVERT     = &h0400&

Const ES_READONLY       = &h0800&

Const ES_WANTRETURN     = &h1000&

Const ES_NUMBER         = &h2000&

Are there any resources you might have or documentation within RUMBA that can elude to these characteristics?


I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba

Hi,

you can use the below Format and Combine the options

TextBox 16,20, 80, 40, .Edit1, ES_MULTILINE Or ES_AUTOVSCROLL Or ES_WANTRETURN

check msdn.microsoft.com/.../bb775464(v=vs.85).aspx

for further Explanation.


I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba

Thank you for all your help Andre


I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba

Thanks for your explanation @ndre.

I noticed this ES_MULTILINE  is also woking on Text control (the label). But how do I put the value of a variable into a text element?

My code is only showing the Text which is hard coded

Const ES_MULTILINE = &h0004&

Const ES_WANTRETURN  = &h1000&

Sub Main

Dim stringvar As String

stringvar = "This is a very large string "

  Begin Dialog DialogName1 60 , 60 , 450 ,450 , "Hello"

  Text 16,20, 60, 200, "this is a very large string", ES_WANTRETURN  

  Text 16,200, 60, 200,.stringvar, ES_WANTRETURN    

    OKButton 29,404,40,12

     CancelButton 82,404,40,12

  End Dialog

  Dim Dlg1 As DialogName1  

  Dlg1.stringvar = "test"

  Button = Dialog (Dlg1)

  if button = 0 Then MsgBox "You clicked Cancel!"

  if button = -1 Then MsgBox "You clicked OK!"

End Sub


I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
Hi Jacco,

when using Rumba Script Dialogs, unfortunately it's not possible to programmatically change the text on the Labels.

Sorry,
Tom

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
Thanks for the quick reply!
Okay, I guess I have to find another way.

I need to read the screen from a TN3270 session (EMReadScreen ScreenText,1920,1, 1) and present it in a Dialog (other then the Rumba screen itself) and run some conversions/decisions visually so the users understands the steps taken. One option is to parse it to a Textbox (TextBox 16,40, 300, 300, .Edit1, ES_MULTILINE) but ES_MULTILINE in combination with ES_READONLY doens't seem to work (only first line is shown ( TextBox 16,40, 300, 300, .Edit1, ES_READONLY, ES_MULTILINE )), I hoped there was a better solution.

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
Hi Jacco,

There is a better solution !! With the release of Rumba 9.5 (last Tuesday), we now offer a VBA AddOn. This add an instance of the VBA Editor and a COM API to allow one to automate navigation and screen scraping using the Rumba Session object.

Using VBA forms would allow you to accomplish your goal, as the VBA Label control does allow you to set the caption on the fly.

If you need to stick with what you have (i.e. no VBA AddOn) you could use Excel's VBA to pop the dialog and either use EHLLAPI to scrape the screen and write back to it, or shell a couple of Rumba Scripts to read and write to the terminal.

Tom

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
TomFitz, I'm at 9.4.0 SP0 Patch0..... and at a large bank. We have just upgraded Rumba from version 7 to 9.4, so there will be no upgrades in the near future (unless there is a severe security issue).
As this is a pretty contained environment (just a windows session with Rumba, so no excel for example) I would like to use a minimum set of extra tools.
I'm sorry for pushing you towards a minimalist/sub-optimal solution ;)

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
New line btw works if you add & Chr(13) Chr(10)

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
Hi Jacco,

sounds like you are in somewhat of a bind. Maybe this approach might work for you?

Const ES_MULTILINE = &h0004&
Const ES_WANTRETURN = &h1000&
Dim MyString as String

Sub Main
MyString = "Hello World" & Chr$(13) & Chr$(10)
Begin Dialog Dialog_1 370,162,252,181, "Dialog_1", .DlgFunc
CheckBox 4,4,100,12, "Check to enable controls ", .EnableTextBox
TextBox 4,16,236,136, .Edit1, ES_WANTRETURN or ES_MULTILINE
CheckBox 140,4,76,12, "Update Text Box", .Check1
End Dialog

Dim Dialog_1Var As Dialog_1
Dialog_1Var.Edit1 = "Update my text" & Chr$(13) & Chr$(10) & "Some More text"
ret% = Dialog(Dialog_1Var)

End Sub

Function DlgFunc (ControlID$,Action%,SuppValue%)
Select Case Action%
Case 1 'Initialize dialog controls
DlgEnable "Edit1" ,0
Case 2 'One of the buttons or checkboxes was pressed
if ControlID$ = "EnableTextBox" Then
Select Case SuppValue
Case 1
DlgEnable "Edit1" ,1
Case Else
DlgEnable "Edit1" ,0
End Select
End If
if ControlID$ = "Check1" and SuppValue = 1 then
MyString = MyString & Now & Chr$(13) & Chr$(10)
DlgFunc = -1
DlgText "Edit1", MyString
End if
Case 3 'Text or combo box changed
Case 4 'Control focus changed
Case Else
End Select
DlgFunc = 0
End Function

Tom

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba

Ah this cleared  a thing: you literally need to type 'OR' between them, I thought it was something I needed to choose.

TextBox 16,10, 550, 320, .Edit1, ES_MULTILINE  or ES_WANTRETURN  'or ES_READONLY

This is now perfectly functioning as a multiline AND return AND readonly field.

Your last example will be the direction for my solution! Thanks!  


I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
Hi Jacco,

If you would like users to be able to tab into the TextBox or to be able to copy the contents then read only is the way to go.

If you would not like users to be able to tab into the TextBox or copy the content, then DlgEnable does the trick.

Glad that there appears to be light at the end of the tunnel,
Tom

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba

Could you explain what the line: ret% = Dialog(Dialog_1Var) does?

How does if ControlID$ = "Check1" and SuppValue = 1 then  works when the control is a PushButton?

Thanks for all your help


I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
Hi Jacco,

the ret% = Dialog(Dialog_Var) allows you see which Button was pressed, -1 == OK, 0 == Cancel (or Close)

Here is a new script for you to play with, this demos how to keep the dialog open after a button click, which is what I think you are after.

Const ES_MULTILINE = &h0004&
Const ES_WANTRETURN = &h1000&
Const ES_READONLY = &h0800&

Dim MyString as String

Sub Main
MyString = "Hello World" & Chr$(13) & Chr$(10)

Begin Dialog Dialog_1 370,162,252,181, "Dialog_1", .DlgFunc
CheckBox 4,4,100,12, "Check to enable controls ", .EnableTextBox
TextBox 4,16,236,136, .Edit1 , ES_WANTRETURN or ES_MULTILINE or ES_READONLY
CheckBox 140,4,76,12, "Update Text Box", .Check1
OKButton 94,160,56,15
CancelButton 12,160,40,15
PushButton 184,160,52,15, "Update", .Button1
End Dialog

Dim Dialog_1Var As Dialog_1

Dialog_1Var.Edit1 = "Update my text" & Chr$(13) & Chr$(10) & "Some More text"

ret = Dialog(Dialog_1Var)
Msgbox ret
End Sub

Function DlgFunc(ControlID$,Action%,SuppValue&)
Select Case Action%
Case 1 'Initialize dialog controls
DlgEnable "Edit1" ,0
Case 2 'One of the buttons or checkboxes was pressed
Select Case ControlID$
Case "EnableTextBox"
Select Case SuppValue
Case 1
DlgEnable "Edit1" ,1
Case Else
DlgEnable "Edit1" ,0
End Select
Case "Check1"
Select Case SuppValue
Case 1
MyString = MyString & Now & Chr$(13) & Chr$(10)
DlgText "Edit1", MyString
End Select
Case "Button1"
MyString = MyString & Now & Chr$(13) & Chr$(10)
DlgText "Edit1", MyString
DlgFunc = -1
End Select
Case 3 'Text or combo box changed
Case 4 'Control focus changed
Case Else
End Select
End Function

Normally clicking on the Update button would close the dialog and ret ==1, by setting DlgFunc = -1 (TRUE), this forces the dialog to redisplay.

Tom

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
YES! Thas was exactly what was happening, my dialog closed when I pussed my button for the second time. I'm going to work on this, and I'll post my work when I've got some things running.

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba

I've got one more problem. How do I get the value from a TextBox into the function?

How do I add the text from .Edit2 to MyString: MyString & Dialog_1Var.Edit2 & Now & Chr$(13) & Chr$(10)

I've adjusted you example:

Const ES_MULTILINE = &h0004&

Const ES_WANTRETURN = &h1000&

Const ES_READONLY = &h0800&

Dim MyString as String

Sub Main

MyString = "Hello World" & Chr$(13) & Chr$(10)

Begin Dialog Dialog_1 370,162,292,181, "Dialog_1", .DlgFunc

CheckBox 4,4,90,12, "Check to enable controls ", .EnableTextBox

TextBox 186,2,40,12, Edit2

Text 232,4,76,12, "Input"

TextBox 4,16,276,136, .Edit1 , ES_WANTRETURN or ES_MULTILINE or ES_READONLY

CheckBox 100,4,76,12, "Update Text Box", .Check1

OKButton 94,160,56,15

CancelButton 12,160,40,15

PushButton 184,160,52,15, "Update", .Button1

End Dialog

Dim Dialog_1Var As Dialog_1

Dialog_1Var.Edit1 = "Update my text" & Chr$(13) & Chr$(10) & "Some More text"

ret = Dialog(Dialog_1Var)

Msgbox ret

End Sub

Function DlgFunc(ControlID$,Action%,SuppValue&)

Select Case Action%

Case 1 'Initialize dialog controls

DlgEnable "Edit1" ,0

Case 2 'One of the buttons or checkboxes was pressed

Select Case ControlID$

Case "EnableTextBox"

Select Case SuppValue

Case 1

DlgEnable "Edit1" ,1

Case Else

DlgEnable "Edit1" ,0

End Select

Case "Check1"

Select Case SuppValue

Case 1

MyString = MyString & Now & Chr$(13) & Chr$(10)

DlgText "Edit1", MyString

End Select

Case "Button1"

MyString = MyString & Now & Chr$(13) & Chr$(10)

DlgText "Edit1", MyString

DlgFunc = -1

End Select

Case 3 'Text or combo box changed

Case 4 'Control focus changed

Case Else

End Select

End Function


I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
Hi Jacco,

to get the value of the TextBox in your dialog handler you have to use the DlgText as a function.

e.g.
Case "Button1"
MyString = MyString & Now & Chr$(13) & Chr$(10)
DlgText "Edit1", MyString
Msgbox DlgText("Edit1" )
DlgFunc = -1

Cheers,
Tom

I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba

That did the trick.

How could I've know this?  The help states:

"This statement is used to set or change the text of a dialog control. "

I'm I missing basic programming knowledge, or is it missing in the help file?

 

 


I have started to learn how to use the Dialog editor within the Rumba Script Editor. I have been trying, maybe not the right syntax, to take a Text Box field and have the data go to a new line within the text box. I am trying to accomplish this because I have mutliple data points that make up one set of data. For example address scrap from Rumba might require scrapping from two different fields but I want the text to appear together in the Text Box. here is a sample code that I tried to use.

Sub Main
 
Begin Dialog Dialog_1 270,156,100,181, "Dialog_1"
  TextBox 16,20,40,15, .Edit1
End Dialog
Dim Dialog_1Var As Dialog_1
Dialog_1.Edit1 = "TEST" & vbnewline & "SMARTS"
Dialog Dialog_1Var
End Sub

I even tried to use Chr(10) instead of vbnewline but it continues to put the text in one continuous line.

Any thoughts or ideas on how to make this possible where I could put Test and Smarts on two separate lines within the same text box?


#Rumba
Hi Jacco,

no, I don't think it's you :-). This doesn't appear to be documented in the Rumba Scripting Help.

I'm not sure which engine Rumba Scripting uses, but the dialogs in Rumba Scripting are very similar to those used in Extra! Basic and in Reflection Basic, and using DlgText as a function is how it works in those.

Tom