Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

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