Dialog Input to Compare

ellusiveladyellusivelady Member Posts: 23
I have a table (Sales Order) that contains a field (SubberNo).

When user click a button on the Sales Order form, a dialog box appear.

Following is my coding (with the help of searchin in forum :wink: ).
window.OPEN ('Enter Sub Order No. #1#########\',
subNo);

EntryNo := 0; 
NewEntryNo := 1; 
WHILE (NewEntryNo > 0) AND (EntryNo <> NewEntryNo) DO BEGIN 
EntryNo := NewEntryNo; 
CASE EntryNo OF 
1 : NewEntryNo := window.INPUT(1,subNo);
END;
END;
window.CLOSE;
IF NewEntryNo = 0 THEN
EXIT;

Now, what I wish to do is practically compare the subNo (input in dialog) to the data (SubberNo) in my table (Sales Order).

If it's the same, then I wish to exit. Otherwise, I want them to keep entering the input on the dialog till it is the same.

Any idea how to work about it? :?: [-o<

Thanks..

Answers

  • ellusiveladyellusivelady Member Posts: 23
    I keep playing around with the codings and i managed to figure it out...

    Just thought of sharing with you guys.. :P
    EVALUATE(dataSub,"SubberNo");
    subNo := 0;
    REPEAT
      window.OPEN ('Enter Sub No. #1#########\',subNo);
      window.INPUT(1,subNo);
      window.CLOSE;
      IF (subNo = 0) OR (subNo > dataSub) THEN
        MESSAGE('Please enter a valid Sub No.')
      ELSE 
        EXIT;
    UNTIL ((subNo < dataSub) OR (subNo = dataSub));
    

    i guess it does helps if u keep playing trial and error and never give up..!!
    :mrgreen:
  • GRUBBYFANSGRUBBYFANS Member Posts: 154
    edited 2008-05-27
    This is My Code, It is Successful!

    window.OPEN ('Enter Sub Order No. #1#########\');
    EntryArry[1]:=1;
    EntryArry[2]:=2;
    EntryArry[3]:=3;
    EntryArry[4]:=4;
    i:=1;
    window.INPUT(1,NewEntryNo);;

    REPEAT
    SLEEP(100);
    window.UPDATE(1,EntryArry);
    IF NewEntryNo = EntryArry THEN
    BEGIN
    ERROR('OK!');
    END;
    i:=i+1;
    UNTIL i>5;


    When dialog appear you input number,for example you input 3

    and Click 'Enter Sub Order No.'
    Remember must Click title 'Enter Sub Order No.' on dialog
    You Can see error number
    IF You Input 7
    there is no error!!!!
  • GRUBBYFANSGRUBBYFANS Member Posts: 154
    I think your code is that
    window.OPEN ('Enter Sub Order No. #1#########\',
    subNo);

    EntryNo := 0;
    NewEntryNo := 1;
    WHILE (NewEntryNo > 0) AND (EntryNo <> NewEntryNo) DO BEGIN
    EntryNo := NewEntryNo;
    CASE EntryNo OF
    1 :window.INPUT(1,subNo);
    END;
    END;
    window.CLOSE;
    IF NewEntryNo = 0 THEN
    EXIT;


    You can look my Example code!!
  • ellusiveladyellusivelady Member Posts: 23
    Thanks! but however my second coding doesn't require me to click on the title. it will just automatically highlight the number and all user have to do is just input the number and press enter.

    Thanks for your effort though. =)
Sign In or Register to comment.