Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass variables to functions as arguments
#3
Thank you. this is my code for some reason I can only install very old version pre-installed can not update so sub function can not be used.
Function Main
Code:
Copy      Help
;;text input here
str controls = "9"
str e9
str s
if(!ShowDialog("Function9" &Function9 &controls)) ret
Function Function9
Code:
Copy      Help
;;form input
 \Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages



 BEGIN DIALOG
 0 "" 0x90C80AC8 0x8 0 0 400 200 "Test"
 3 Static 0x54000201 0x0 26 20 60 15 "ID"
 9 Edit 0x54030080 0x200 100 20 110 15 ""
 20 Static 0x54000011 0x20000 222 18 1 143 ""
 21 Static 0x54000010 0x20000 212 90 11 1 ""
 1 Button 0x54030001 0x0 152 176 48 14 "OK"
 2 Button 0x54030000 0x0 216 176 48 14 "Cancel"
 END DIALOG
 DIALOG EDITOR: "" 0x2030605 "" "" "" ""



ret
 messages
sel message
    case WM_INITDIALOG
    case WM_DESTROY
    case WM_COMMAND goto messages2
ret
 messages2
sel wParam
    case IDOK
    mac "Function7"
    case IDCANCEL
    case 26
    mac "Function3"
ret 1
Function Function7
Code:
Copy      Help
;;dialog start and stop
 \Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str c3Sta
if(!ShowDialog("Function7" &Function7 &controls)) ret

 BEGIN DIALOG
 0 "" 0x90C80AC4 0x108 0 0 63 46 "CB"
 3 Button 0x54013003 0x0 6 6 48 14 "Start"
 1 Button 0x54030001 0x0 6 24 48 14 "Back"
 END DIALOG
 DIALOG EDITOR: "" 0x2030605 "" "" "" ""

ret
 messages
sel message
    case WM_INITDIALOG
    case WM_DESTROY
    case WM_COMMAND goto messages2
ret
 messages2
sel wParam
    case 3
    if(but(lParam)) ;;checked
        mac "Macro8"
        _s="Stop"
    else ;;unchecked
        shutdown -6 0 "Macro8"
        _s="Start"
    _s.setwintext(lParam)
    case IDOK
    mac "UI"
    shutdown -6 0 "Macro8"
    case IDCANCEL
ret 1

Macro Macro8
Code:
Copy      Help
;;out text input from main
rep
    out e9


Messages In This Thread
RE: Pass variables to functions as arguments - by yiifm - 05-26-2021, 04:42 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)