Posts: 576
Threads: 97
Joined: Aug 2007
Hey i have this dialog and i want it to be able to grab the text from the 2 spaces wen the button Grab is pressed and out put the starting number all the way to the ending number in order....like say it was filled in 1 and 50 it wud out put
1 2 3 4 5....50
every number in between the two numbers entered but including them....can anyone help?
Dialog:
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 209 44 "Number Dialog"
;2 Button 0x54030000 0x4 148 6 56 32 "CLOSE"
;3 Edit 0x54032000 0x200 56 8 32 14 ""
;4 Edit 0x54032000 0x200 56 24 32 14 ""
;5 Static 0x54000000 0x0 2 10 52 10 "Starting Number"
;6 Static 0x54000000 0x0 4 26 50 8 "Ending Number"
;7 Button 0x54032000 0x0 90 6 56 32 "GRAB"
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""
str controls = "3 4"
str e3 e4
if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret
ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)
sel message
,case WM_INITDIALOG
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
Posts: 12,140
Threads: 142
Joined: Dec 2002
Insert this above case IDOK line:
,case 7 ;;Grab
,int i a b; str s
,s.getwintext(id(3 hDlg)); a=val(s)
,s.getwintext(id(4 hDlg)); b=val(s)
,for i a b+1
,,out i
Posts: 576
Threads: 97
Joined: Aug 2007
Ok Thanks that worked perfect now can u help me get it so it out puts like this
Number 1
Number 2
Number 3 .....
Number 10
if number 1 and 10 were entered? like maybe use an array to do it? thanks
Posts: 473
Threads: 33
Joined: Aug 2007
Can't you just change out i to out "Number" i ?
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
Nope it just outs Number then.....another question is....can u make it possible to getwintext of another spot then add the number and out it for the amount of times?
like say i have 3 boxes... Starting Number, Ending Number, Root
Root = "Number "
Starting Number = "1"
Ending Number = "10"
it would output
Number 1
Number 2
Number 3
Number 4
Number 5
Number 6
Number 7
Number 8
Number 9
Number 10
??? Any Help ???
Posts: 473
Threads: 33
Joined: Aug 2007
Can you post your whole code, the code above doesn't work for me. Then I might be able to help out better.
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
Qm Assistant, the code is above in the post's its just a dialog and gint posted his code as case 7...try that
Posts: 473
Threads: 33
Joined: Aug 2007
I put that all together and it doesn't work for me.
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
Dialog2:
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 209 44 "Number Dialog"
;2 Button 0x54030000 0x4 148 6 56 32 "CLOSE"
;3 Edit 0x54032000 0x200 56 8 32 14 ""
;4 Edit 0x54032000 0x200 56 24 32 14 ""
;5 Static 0x54000000 0x0 2 10 52 10 "Starting Number"
;6 Static 0x54000000 0x0 4 26 50 8 "Ending Number"
;7 Button 0x54032000 0x0 90 6 56 32 "GRAB"
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""
str controls = "3 4"
str e3 e4
if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret
ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)
sel message
,case WM_INITDIALOG
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 7 ;;Grab
,int i a b; str s
,s.getwintext(id(3 hDlg)); a=val(s)
,s.getwintext(id(4 hDlg)); b=val(s)
,for i a b+1
,,out i
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
Make sure its named "Dialog2"
Posts: 473
Threads: 33
Joined: Aug 2007
Here ya go.
Macro ( Macro24 )
str controls = "3 4"
str e3 e4
if(!ShowDialog("Dialog3" &Dialog3 &controls)) ret
Function ( Dialog3 )
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 209 44 "Number Dialog"
;2 Button 0x54030000 0x4 148 6 56 32 "CLOSE"
;3 Edit 0x54032000 0x200 56 8 32 14 ""
;4 Edit 0x54032000 0x200 56 24 32 14 ""
;5 Static 0x54000000 0x0 2 10 52 10 "Starting Number"
;6 Static 0x54000000 0x0 4 26 50 8 "Ending Number"
;7 Button 0x54032000 0x0 90 6 56 32 "GRAB"
;END DIALOG
;DIALOG EDITOR: "" 0x2020102 "" "" ""
ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)
sel message
,case WM_INITDIALOG
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 7 ;;Grab
,int i a b; str s q
,q="Number"
,s.getwintext(id(3 hDlg)); a=val(s)
,s.getwintext(id(4 hDlg)); b=val(s)
,for i a b+1
,,out "%s %i" q i
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 209 55 "Number Dialog"
;2 Button 0x54030000 0x4 150 12 56 32 "CLOSE"
;3 Edit 0x54032000 0x200 56 20 32 14 ""
;4 Edit 0x54032000 0x200 56 36 32 14 ""
;5 Static 0x54000000 0x0 2 22 52 10 "Starting Number"
;6 Static 0x54000000 0x0 4 40 50 8 "Ending Number"
;7 Button 0x54032000 0x0 90 12 56 32 "GRAB"
;8 Edit 0x54030080 0x200 30 4 58 14 ""
;9 Static 0x54000000 0x0 8 8 18 8 "Root"
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""
str controls = "3 4 8"
str e3 e4 e8
if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret
ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)
sel message
,case WM_INITDIALOG
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 7 ;;Grab
,int i a b; str s
,s.getwintext(id(3 hDlg)); a=val(s)
,s.getwintext(id(4 hDlg)); b=val(s)
,for i a b+1
,,out i
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
Ok now i have that dialog can u help me with my other senario?
Quote:Nope it just outs Number then.....another question is....can u make it possible to getwintext of another spot then add the number and out it for the amount of times?
like say i have 3 boxes... Starting Number, Ending Number, Root
Root = "Number "
Starting Number = "1"
Ending Number = "10"
it would output
Number 1
Number 2
Number 3
Number 4
Number 5
Number 6
Number 7
Number 8
Number 9
Number 10
??? Any Help ???
Posts: 473
Threads: 33
Joined: Aug 2007
Like this?
Macro ( Macro22 )
str controls = "3 4 8"
str e3 e4 e8
if(!ShowDialog("Dialog4" &Dialog4 &controls)) ret
Function ( Dialog4 )
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 209 55 "Number Dialog"
;2 Button 0x54030000 0x4 150 12 56 32 "CLOSE"
;3 Edit 0x54032000 0x200 56 20 32 14 ""
;4 Edit 0x54032000 0x200 56 36 32 14 ""
;5 Static 0x54000000 0x0 2 22 52 10 "Starting Number"
;6 Static 0x54000000 0x0 4 40 50 8 "Ending Number"
;7 Button 0x54032000 0x0 90 12 56 32 "GRAB"
;8 Edit 0x54030080 0x200 30 4 58 14 ""
;9 Static 0x54000000 0x0 8 8 18 8 "Root"
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""
ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)
sel message
,case WM_INITDIALOG
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 7 ;;Grab
,int i a b c; str s d
,s.getwintext(id(3 hDlg)); a=val(s)
,s.getwintext(id(4 hDlg)); b=val(s)
,d.getwintext(id(8 hDlg))
,for i a b+1
,,out "%s %i" d i
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
Ok i got this, it gets them both and outputs them...but is it possible to use them to setwintext of another Edit box somewhere else? for example in another dialog
Plz Help
Dialog2:
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 209 55 "Number Dialog"
;2 Button 0x54030000 0x4 150 12 56 32 "CLOSE"
;3 Edit 0x54032000 0x200 56 20 32 14 ""
;4 Edit 0x54032000 0x200 56 36 32 14 ""
;5 Static 0x54000000 0x0 2 22 52 10 "Starting Number"
;6 Static 0x54000000 0x0 4 40 50 8 "Ending Number"
;7 Button 0x54032000 0x0 90 12 56 32 "GRAB"
;8 Edit 0x54030080 0x200 30 4 58 14 ""
;9 Static 0x54000000 0x0 8 8 18 8 "Root"
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""
str controls = "3 4 8"
str e3 e4 e8
if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret
ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)
sel message
,case WM_INITDIALOG
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 7 ;;Grab
,int i a b; str s q
,q.getwintext(id(8 hDlg))
,s.getwintext(id(3 hDlg)); a=val(s)
,s.getwintext(id(4 hDlg)); b=val(s)
,for i a b+1
,,out "%s%i" q i
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
Posts: 473
Threads: 33
Joined: Aug 2007
I'm not sure.
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
Posts: 473
Threads: 33
Joined: Aug 2007
Maybe setclip & getclip or global variables? Just throwing out suggestions.
Taking on Quick Macros one day at a time
Posts: 576
Threads: 97
Joined: Aug 2007
Possibly but i dont know how i would do this ANY IDEAS GINT? lol
Posts: 576
Threads: 97
Joined: Aug 2007
Hello lol can anyone help me i cant figure this out :lol:
Posts: 473
Threads: 33
Joined: Aug 2007
Just experiment with setclip and getclip, maybe you'll discover something? :?:
Taking on Quick Macros one day at a time
|