Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Insert edittextbox lines to listbox items or txt file to listbox items

Enthusiast ,
Jan 26, 2022 Jan 26, 2022

Hello everyone and greetings
I have a question about List Box
I made a dialog using a text box and a list box
And I added text with lines inside the edit box
But when you add it inside the list box, the texts appear next to each other
I want to make the list box display the texts, but each separate line the same inside the edit box

Note that I will be fetching the data from a text file

I attached an explanatory text file with examples of data.. I also just wrote the code to be modified

لقطة الشاشة 2022-01-26 155352.png

 

This is the attached file to show the data type

https://drive.google.com/file/d/1ayJisFqELn5TKJfoQzihzBjE7Xz4Qhku/view?usp=sharing 

 

 

 

var window = new Window('dialog', "قاعدة بيانات العملاء - ابن حميدو");

var Example= window.add ('edittext {preferredSize: [650, 150] ,justify: "right", active: true,properties:{ multiline: true}}'); Example.graphics.font = "Tahoma-Bold:14";Example.enabled = true

var array = "E.Hamedoooo@gmail.com  _  01033032007  _  Hameed" + "\n" + 
"E.Hamedoooo@gmail.com  _  010050  _  Khalid Hameed" + "\n" +
"E.Hamedoooo@gmail.com  _  0120115020  _  Waled Hameed" + "\n"+
"E.Hamedoooo@gmail.com  _  01033032007  _  Hameed"+"\n"+
"E.Hamedoooo@gmail.com  _  0120115020  _  Waled Hameed"+"\n"
// or I get this items from txt file on my pc

Example.text= array

 var listBox = window.add("listbox", undefined, "" ,
            {   
            numberOfColumns: 1,   
            showHeaders: true,   
            //multiselect:true,
            columnTitles: ['Name'] ,
            columnWidths: [150],
            columnheights:[50,50],
            
        });
    
    
    listBox.graphics.font = "Tahoma-Bold:14";
  listBox.itemSize= [50,100];
  listBox.size = [650, 200];

listBox.add("item",  array );

window.center();
window.show();

 

 

 

TOPICS
Actions and scripting , SDK
306
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 26, 2022 Jan 26, 2022

 

array=array.split('\n'); while(array.length-1) listBox.add('item',array.shift())

 

Translate
Adobe
LEGEND ,
Jan 26, 2022 Jan 26, 2022

That's not how you specify an array.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 26, 2022 Jan 26, 2022
LATEST

 

array=array.split('\n'); while(array.length-1) listBox.add('item',array.shift())

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines