how do i make the things they type in a edit box in my dialog be only numbers and be between 5 and 160.
for example if they type 180 it wont let them click on START script
dialog edit restriction help
Moderators: Dorian (MJT support), JRL
take the result of the edit box(maybe MyDialog.msEdit1) and then call VBScript IsNumeric. If it returns False, then show a warning message like mdl>This value must be numeric between 5 and 160 then you'll want to reset the dialog (rda>MyDialog) then go back to the loop where you are getting the result...(GetDialogAction>MyDialog,myresult
here is a bit of code to get you started.....
vbstart
vbend
let>EditVAR=1
VBEval>IsNumeric("%EditVAR%"),IsNumResult
mdl>%IsNumResult% %EditVAR%
You'll want to use the Dialog var instead of my var, of course.
here is a bit of code to get you started.....
vbstart
vbend
let>EditVAR=1
VBEval>IsNumeric("%EditVAR%"),IsNumResult
mdl>%IsNumResult% %EditVAR%
You'll want to use the Dialog var instead of my var, of course.
there is no need to understand VB. You can use the code almost EXACTLY as I have written it. Just pass the variable from your dialog to the IsNumeric function instead of the example variable.
sorry, MDL stands for MessageModal.....Most MacroScript commands have abbreviations and I am in the habit of using them.
Don't fear VBScript....for example IsNumeric is built in so that you do not need to even see the code....just run the code I sent, you'll see.
sorry, MDL stands for MessageModal.....Most MacroScript commands have abbreviations and I am in the habit of using them.
Don't fear VBScript....for example IsNumeric is built in so that you do not need to even see the code....just run the code I sent, you'll see.
tt
im a real noob at this thing and i dont know what to put in the isnumresult and isnumeric...
And im not sure where i put this o.O
vbstart
vbend
let>natb.delay=1
VBEval>IsNumeric("%natb.delay%"),IsNumResult
mdl>%IsNumResult% %natb.delay%
And im not sure where i put this o.O
vbstart
vbend
let>natb.delay=1
VBEval>IsNumeric("%natb.delay%"),IsNumResult
mdl>%IsNumResult% %natb.delay%
You are correct in putting your variable in the IsNumeric call the way you did. Now, the result of that function will be in the IsNumResult (you can call that whatever you want, but I name it that for clarity) then you can test the variable and take the appropriate action.
if>IsNumResult=False
messagemodal>%natb.delay% is not a number
rda>natb
goto>getNATB
else>
do something useful.....
endif>
why don't you post your code so we an take a look at the entire program.
if>IsNumResult=False
messagemodal>%natb.delay% is not a number
rda>natb
goto>getNATB
else>
do something useful.....
endif>
why don't you post your code so we an take a look at the entire program.