Hi All,
I have a script which runs this xbasic code (generated using the genies).
The dialog box has 3 fields:
- Scan_pn
- Scan_qty
- Scan_location
I don't want the user to be able to close the box (select OK) if the field is blank. The genie doesn't give options for this, could you suggest how to modify this code to do that?
Thanks!
'Create an XDialog dialog box to prompt for parameters.
DIM SHARED Scan_PN as C
DIM SHARED scan_qty as N
DIM SHARED scan_location as C
DIM SHARED varC_result as C
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Add Parts To Inventory",<<%dlg%
{region}
OEM Part Number:| [.30Scan_PN];
Quantity:| [%z%.10scan_qty];
Bin Location:| [.30scan_location];
{endregion};
{line=1,0};
{region}
<15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};
%dlg%)
'Conditional code follows. Executes only if the condition expression is True.
IF a5_eval_expression("=exist(Var->scan_pn,"parts","Partnumber")",local_variables()) THEN
'Play sound if Scan_PN is found in parts list.
play_sound("C:\WINDOWS\Media\Windows XP Information Bar.wav")
END IF
'Conditional code follows. Executes only if the condition expression is True.
IF a5_eval_expression("=.NOT.exist(Var->scan_pn,"parts","Partnumber")",local_variables()) THEN
'Play sound if Scan_PN is not in Parts List.
play_sound("C:\WINDOWS\Media\Windows XP Battery Critical.wav")
END IF
'Conditional code follows. Executes only if the condition expression is True.
IF a5_eval_expression("=.NOT.exist(Var->scan_pn,"parts","Partnumber")",local_variables()) THEN
'Run script: Update Inventory
script_play("Update Inventory")
END IF
I have a script which runs this xbasic code (generated using the genies).
The dialog box has 3 fields:
- Scan_pn
- Scan_qty
- Scan_location
I don't want the user to be able to close the box (select OK) if the field is blank. The genie doesn't give options for this, could you suggest how to modify this code to do that?
Thanks!
'Create an XDialog dialog box to prompt for parameters.
DIM SHARED Scan_PN as C
DIM SHARED scan_qty as N
DIM SHARED scan_location as C
DIM SHARED varC_result as C
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Add Parts To Inventory",<<%dlg%
{region}
OEM Part Number:| [.30Scan_PN];
Quantity:| [%z%.10scan_qty];
Bin Location:| [.30scan_location];
{endregion};
{line=1,0};
{region}
<15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};
%dlg%)
'Conditional code follows. Executes only if the condition expression is True.
IF a5_eval_expression("=exist(Var->scan_pn,"parts","Partnumber")",local_variables()) THEN
'Play sound if Scan_PN is found in parts list.
play_sound("C:\WINDOWS\Media\Windows XP Information Bar.wav")
END IF
'Conditional code follows. Executes only if the condition expression is True.
IF a5_eval_expression("=.NOT.exist(Var->scan_pn,"parts","Partnumber")",local_variables()) THEN
'Play sound if Scan_PN is not in Parts List.
play_sound("C:\WINDOWS\Media\Windows XP Battery Critical.wav")
END IF
'Conditional code follows. Executes only if the condition expression is True.
IF a5_eval_expression("=.NOT.exist(Var->scan_pn,"parts","Partnumber")",local_variables()) THEN
'Run script: Update Inventory
script_play("Update Inventory")
END IF
Comment