in my input menu, i have an OK button and a CANCEL button
i usually have an optionnal admin logon and password (in case you are logged as normal user)
i also validate the input as a 5 char project number to generate a folder in a project network drive
if the input is invalid, i add a value to the array containing a message after the input box
if this message contain any "error" or "erreur" text, when the frame regenerate, it will display it in RED color
then regenerate the input frame until the correct data is entered
if the data input is ok, i clear the data input frame (fmid) and execute another sub that will do the job
if a cancel is pressed, i clear the two frames, and also clear all the input variables from main menu
(we do not want the button to stay pressed and loop indefinitly)
also when the job is complete, i do not clear the frames
so the user can see the results in the fbot (bottom frame)
the user then, have to select another option from main menu to move on
------------------------
'msgbox(a)
if chkmenu=0 and fmid.Script.CheckValcancel()=0 then
'=== User has clicked the OK button, retrieve the values
connum = fmid.form01.connum.Value
if len(connum) < 5 then
a = "error - contrat doit avec 5 caractères"
err01=1
errtmp(2)=a
a = dynforgen (distmp,namtmp,deftmp,typtmp,errtmp,buttmp,tit)
else
'=== all the data from the form is ok, we proceed to next step
end if
end if
loop while err01<>0
if chkmenu=0 and fmid.Script.CheckValcancel()=0 then
'=== doing the job, all input are ok
clefra(array("fmid"))
fbot.WriteLn("structure i pas encore pret hahaha<br>")
'=== clear main menu options to restart with a new option without reloading frames, so we can still see the results
a = clrmenu
elseif chkmenu=0 then '=== cancel was pressed
'fbot.WriteLn("cancelled<br>")
a = clrmenu
a = clefra(array("fmid","fbot"))
end if
end if
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
in my input menu, i have an OK button and a CANCEL button
i usually have an optionnal admin logon and password (in case you are logged as normal user)
i also validate the input as a 5 char project number to generate a folder in a project network drive
if the input is invalid, i add a value to the array containing a message after the input box
if this message contain any "error" or "erreur" text, when the frame regenerate, it will display it in RED color
then regenerate the input frame until the correct data is entered
if the data input is ok, i clear the data input frame (fmid) and execute another sub that will do the job
if a cancel is pressed, i clear the two frames, and also clear all the input variables from main menu
(we do not want the button to stay pressed and loop indefinitly)
also when the job is complete, i do not clear the frames
so the user can see the results in the fbot (bottom frame)
the user then, have to select another option from main menu to move on
------------------------
'msgbox(a)
if chkmenu=0 and fmid.Script.CheckValcancel()=0 then
'=== User has clicked the OK button, retrieve the values
connum = fmid.form01.connum.Value
if len(connum) < 5 then
a = "error - contrat doit avec 5 caractères"
err01=1
errtmp(2)=a
a = dynforgen (distmp,namtmp,deftmp,typtmp,errtmp,buttmp,tit)
else
'=== all the data from the form is ok, we proceed to next step
end if
end if
loop while err01<>0
if chkmenu=0 and fmid.Script.CheckValcancel()=0 then
'=== doing the job, all input are ok
clefra(array("fmid"))
fbot.WriteLn("structure i pas encore pret hahaha<br>")
'=== clear main menu options to restart with a new option without reloading frames, so we can still see the results
a = clrmenu
elseif chkmenu=0 then '=== cancel was pressed
'fbot.WriteLn("cancelled<br>")
a = clrmenu
a = clefra(array("fmid","fbot"))
end if
end if