result popup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Bruce
    Indigo Rose Customer
    • Jun 2001
    • 2134

    result popup

    This is the end of my code where I am looking for some folders.

    --show the popup
    company_result = PopupMenu.Show(tblPopup, x, y, PopupMenu.HALIGN_LEFT, PopupMenu.VALIGN_TOP);
    if company_result ~= "CANCELLED" then

    end
    end


    If the "(1)Other" folder is picked, I would like to do something...whatever.

    if company_result == (1)other then
    --Do what ever here.
    end


    Thanks

    Bruce
  • TJ_Tigger
    Indigo Rose Customer
    • Sep 2002
    • 3159

    #2
    Try this
    Code:
    --show the popup
    company_result = PopupMenu.Show(tblPopup, x, y, PopupMenu.HALIGN_LEFT, PopupMenu.VALIGN_TOP);
    if company_result ~= "CANCELLED" then
       if company_result == (1)other then
          --Do what ever here.
       else
          --act normally here
       end
    end
    Originally posted by Bruce
    This is the end of my code where I am looking for some folders.

    --show the popup
    company_result = PopupMenu.Show(tblPopup, x, y, PopupMenu.HALIGN_LEFT, PopupMenu.VALIGN_TOP);
    if company_result ~= "CANCELLED" then

    end
    end


    If the "(1)Other" folder is picked, I would like to do something...whatever.

    if company_result == (1)other then
    --Do what ever here.
    end


    Thanks

    Bruce
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

    Comment

    • Bruce
      Indigo Rose Customer
      • Jun 2001
      • 2134

      #3
      Ok, here's what I have now:


      --show the popup
      company_result = PopupMenu.Show(tblPopup, x, y, PopupMenu.HALIGN_LEFT, PopupMenu.VALIGN_TOP);
      if company_result ~= "CANCELLED" then

      end



      if company_result == Other then
      --Do what ever here.
      Application.Exit(0);

      else
      --act normally here
      end


      When I pick the folder "Other" I still get nothing... Here is the full code:


      --define the tables that will be used
      tblMenuItem={}
      tblPopup = {};

      --define a counter variable
      ctr = 0;

      --Get all the files on the desktop/IPT/Offices, store them in a table
      --tblFiles = Folder.Find(_DesktopFolder.."\\IPT\\Offices", "*.*", false, nil)
      tblFiles = Folder.Find(_DesktopFolder.."\\IPT\\Offices", "*", false, nil)

      --if there are no files, skip the popup
      if tblFiles ~= nil then
      --loop through the files found on the desktop/IPT/Offices
      for n, sFiles in tblFiles do
      --split the path into a table
      tblPath=String.SplitPath(sFiles);

      --increment counter
      ctr = ctr + 1;

      --define the row in the table with place holder text
      tblMenuItem[ctr]={text=[[PlaceHolder]],type=[[0]],checked=[[false]],enabled=[[true]]}

      --set the text to the value we want
      tblMenuItem[ctr].text=tblPath.Filename ..tblPath.Extension

      --insert into the PopUp
      Table.Insert(tblPopup, Table.Count(tblPopup) + 1, tblMenuItem[ctr])
      end
      end

      --get the labels position and size
      tblPos = Label.GetPos("Offices Label");
      tblSize = Label.GetSize("Offices Label");

      x = tblPos.X;
      y = tblPos.Y + tblSize.Height;

      --show the popup
      company_result = PopupMenu.Show(tblPopup, x, y, PopupMenu.HALIGN_LEFT, PopupMenu.VALIGN_TOP);
      if company_result ~= "CANCELLED" then

      end



      if company_result == Other then
      --Do what ever here.
      Application.Exit(0);

      else
      --act normally here
      end

      Comment

      • Dermot
        Indigo Rose Customer
        • Apr 2004
        • 1791

        #4
        I think you need quotes around Other.

        if company_result == "Other" then
        --Do what ever here.
        Application.Exit(0);

        else
        --act normally here
        end

        Dermot
        Dermot

        I am so out of here :yes

        Comment

        • Bruce
          Indigo Rose Customer
          • Jun 2001
          • 2134

          #5
          That was it! Thanks Dermot

          Comment

          • Intrigued
            Indigo Rose Customer
            • Dec 2003
            • 6138

            #6
            We are not sure how Dermot gets the answer, but he always answers the question with an answer that answers the question. The question is still... how did he get the answer!

            Intrigued

            Comment

            Working...
            X