Andromo - Start Making Apps - Free Signup

Announcement

Collapse
No announcement yet.

i need to change this code to automatic open the file without choice the file

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • i need to change this code to automatic open the file without choice the file

    i need to change this code to automatic open the file without choice the file
    without Dialog.FileBrowse

    the code is open a text file and insert it to the tree object.

    file = Dialog.FileBrowse(true, "Locate File", "c:\\", "(*.txt)|*.txt|", "1.txt", "txt", false, true);

    Paragraph.SetText("Paragraph1", TextFile.ReadToString(file[1]));
    t_Text= TextFile.ReadToTable(file[1]);
    t_Node={};
    t_Node.Expanded=true;
    t_anz=Table.Count(t_Text);
    t_Node.Text=t_Text[1];

    Tree.InsertNode("Tree1", "1", t_Node);
    for x=2,t_anz do
    t_Node.Text=t_Text[x];
    result = Tree.InsertNode("Tree1", "1."..x, t_Node);

    end

  • #2
    Code:
    --set file to load
    file = "f:\\file.txt";
    --read the Textfile into a table
    t_Text= TextFile.ReadToTable(file);
    --create table for node properties
    t_Node={};
    --set node property "Expand" to true
    t_Node.Expanded=true;
    t_anz=Table.Count(t_Text);
    t_Node.Text=t_Text[1];
    --insert first entry with level 1
    Tree.InsertNode("Tree1", "1", t_Node);
    for x=2,t_anz do
      t_Node.Text=t_Text[x];
      result = Tree.InsertNode("Tree1", "1."..x, t_Node);
    end;
    Stefan_M
    "With a rubber duck, one's never alone."

    Douglas Adams, The Hitchhiker's Guide to the Galaxy

    Comment

    Working...
    X