Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combo list text / value difference
#1
Greetings all,

I'm a relatively new user to Quick Macros but have been able to make great use of it for my employer and my superiors are very impressed with it's capabilities. I'm always finding new and creative things to do with the program and it's quite fun to play with....

With that being said, I'm not a serious or professional programer and I get stuck on certain things.... :oops:

In among my various projects, I'm trying to learn and build a very simple Dialog that will generate a string of text to be entered into a program as a file name. The program is DOS based and it's a little archaic to work with.
In the following dialog, I have a combo with 23 numbers. The user selects one of the numbers and one of the radio buttons and clicks OK. It kicks out a text string with the date being part of the string.

What I'd like is to have the dialog display the full number ie. "1001" but truncate the 10 of the number (ie. "01") when the file is generated. I've figured I could do a simple "if" statement for each number but I'm certain that there is a simpler method.

Any help would be appreciated.

Thanks and glad to be a part of the forum,

Daland Speirs
UT, USA

Macro num_f2
Code:
Copy      Help
;Use this code to show the dialog. These variables can be used to set/get values of controls. Read more.
wait 0.25
key F2
wait 0.25
str controls = "3 4 5"
str cb3car o4FC o5PM

type TYPE_A ~controls ~cb3car ~o4FC ~o5PM
TYPE_A d.controls="3 4 5"

d.cb3car="&1001[]1002[]1003[]1004[]1005[]1006[]1007[]1008[]1009[]1010[]1011[]1012[]1013[]1014[]1015[]1016[]1017[]1018[]1019[]1020[]1021[]1022[]1023"
d.o4FC=1
if(!ShowDialog("neumon" 0 +&d)) ret
TO_CBGetItem d.cb3car
,key (d.cb3car)
str s
,s.timeformat("{Mdyy}") key (s)
if(d.o4FC=1)
,key "FC"
if(d.o5PM=1)
,key "PM"

key .txt Y
;key F3
#2
d.cb3car.remove(0 2)
#3
Works perfectly. Thanks.


Forum Jump:


Users browsing this thread: 1 Guest(s)