Author Topic: Drop Down List Box  (Read 4861 times)

winuser2003

  • Newbie
  • *
  • Posts: 34
Drop Down List Box
« on: December 16, 2013, 09:34:23 am »
All,

Thank you for taking the time to read my issue, and I hope I am posting in the correct area. I have a drop down list that displays a few items, and the line is as follows

Code: [Select]
ATGFILELIST= STRCAT("SmartSupplyATGWeeklyReport_2013_12_15.xls",@TAB,"SmartSupplyATGWeeklyReport_2013_12_22.xls",@TAB,"SmartSupplyATGWeeklyReport_2013_12_29.xls",@TAB,"SmartSupplyATGWeeklyReport_2014_01_05.xls",@TAB,"SmartSupplyATGWeeklyReport_2014_01_12.xls",@TAB,"SmartSupplyATGWeeklyReport_2014_01_19.xls",@TAB,"SmartSupplyATGWeeklyReport_2014_01_26.xls",@TAB,"SmartSupplyATGWeeklyReport_2014_02_02.xls",@TAB,"SmartSupplyATGWeeklyReport_2014_02_09.xls",@TAB,"SmartSupplyATGWeeklyReport_2014_02_16.xls",@TAB,"SmartSupplyATGWeeklyReport_2014_02_23.xls")

Now the items in the above line change from time to time. I would like to see if its possible to setup a variable where it just reads from maybe a txt file, but still lists the same items. Editing the script itself can be a lot of hassel, whereas if I use something as simple as a notepad the process is a little easier. I believe there is a way to do this, but cannot remember. I set a variable called "ATGFILELIST and its just calling the drop down menu data direct from the script. I would rather the source of this data be in a txt file if  possible. Thank you for your time.

JTaylor

  • Pundit
  • *****
  • Posts: 1939
    • Data & Stuff Inc.
Re: Drop Down List Box
« Reply #1 on: December 16, 2013, 09:56:37 am »
Sure.   You will probably find FileGet() and StrReplace() useful functions.

Jim

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Drop Down List Box
« Reply #2 on: December 16, 2013, 09:57:34 am »
Create a separate txt file that has each file name on its own line and place in the same directory as your script. Then in your script you can read the data and replace the carriage return line feeds with tabs, like this:

Code: Winbatch
filedata = FileGet( DirSCript(): 'xlsfiles.txt')
ATGFILELIST = StrReplace( filedata, @CRLF, @TAB )
Deana F.
Technical Support
Wilson WindowWare Inc.

winuser2003

  • Newbie
  • *
  • Posts: 34
Re: Drop Down List Box
« Reply #3 on: December 16, 2013, 07:10:03 pm »
As usual thats the perfect kind of assistance :) thank you. I apologize if I posted this in the wrong section however.