Nested for (for Inserting Continues Numbers in Text Fields)
Hi Brothers and Professionals..
I'm Trying to make a Nested for (for repeating numbers) into fields, I have 16 fields named as (SN1-SN2...SN16), i want the user to enter a Number like 20 and i want to Script to Continues Repeating this Number from 20 to 36 (as Example)..i write the following code into Button But when i hit the Button and Enter the Starting Number it Doesn't work at all, even no error message, its my first time to try Nested for twice so i don't know what is the problem, please help me if you can , thanks in advance:
// Dialog Definition
var oDlg = {
strName: "", initialize: function(dialog) {
dialog.load({"usnm":this.strName});
},
commit: function(dialog) {
var data = dialog.store();
this.strName = data["usnm"];
},
description: {
name: "Test Dialog", elements: [ {
type: "view", elements: [
{ name: "Please Enter Starting Number ?", type: "static_text", },
{ item_id: "usnm", type: "edit_text", char_width: 3 },
{ type: "ok_cancel", },
]
},]
}
};
// Dialog Activation
oDlg.strName = "";
if( "ok" == app.execDialog(oDlg)) {
var DesNum = oDlg.strName;
var MaxNum = DesNum+16
for (var i=1 ;i>=16 ;i++){
for (var x=DesNum ;x>=MaxNum ;x++) {
this.getField("SN"+i).value = x;
}
}
}
