Forum Discussion

DainiusA's avatar
DainiusA
Contributor
4 years ago
Solved

Press numbers on a Windows form app from SQL query

Hello everyone,   Not sure how to explain as simple as possible. So I have this kind of Windows form app buttons. and I have an SQL query which returns me some kind of numbers. Is it possible someh...
  • AlexKaras's avatar
    AlexKaras
    4 years ago

    HI Dainius,

     

    Actual implementation depends on the data returned from the query and how you NameMapped buttons.

    Assuming that:

    -- Query returned string value; and

    -- Buttons are NameMapped as Button1, Button2, ...

     

    below is a sample untested pseudo-code:

    var strQueryValue = <valueFromQuery>; // e.g. '12345'

    for (var i = 0; i < strQueryValue.length; i++)

    {

      eval('Button' + strQueryValue.charAt(i)).Click(); // this will click Button1, Button2, ...

      aqUtils.Delay(500); // short safety delay

    }

    ...