Monday 15 July 2013

replace - I want to make this program without using a selection and iteration... does anyone know? (VBScript) -



replace - I want to make this program without using a selection and iteration... does anyone know? (VBScript) -

create programme asks input number between 0 , 5 input requirements in form of text (e.g. zero, one, two, etc.). then, programme display messagebox button corresponding input number (e.g. 0 - ok, 1 - okcancel, 2 - abortretryignore, ff.). 1 time user presses 1 of buttons, display text of button pressed user.

i grateful if in here solve this, spent 2 hours didn't solve t_t

only using vbscript

a dictionary can used avoid loop- , if-control-structures. such replacement of command statements info thing, can't programme in vbscript @ to the lowest degree ifs , loopings:

option explicit dim dicb : set dicb = createobject("scripting.dictionary") dicb.comparemode = vbtextcompare dicb("zero") = array(vbokonly, "vbokonly") ' ... dicb("five") = array(vbretrycancel, "vbretrycancel") dim vinp ' inputbox(prompt[, title][, default][, xpos][, ypos][, helpfile, context]) vinp = inputbox("enter button code: zero, one, ...") if vbempty = vartype(vinp) msgbox "aborting ..." exit else if dicb.exists(vinp) ' msgbox(prompt[, buttons][, title][, helpfile, context]) vinp = msgbox(vinp & ": " & dicb(vinp)(1), dicb(vinp)(0), "you asked for:") else if "" = trim(vinp) msgbox "nice try" else msgbox vinp & "- no such button code!" end if end if end if loop

cf msgbox, msgbox consts, inputbox.

replace vbscript

No comments:

Post a Comment