Comparing intergers with a user input

Hi there,
Im working on a programming project which is about a lottery game, and the only part I am missing is where I have to compare the player's number to the winning number. The user has 2 types of bets but one of them have to match the winning number in any order. For example:
Players Number: 546      
Winning Numbers (Match Any Order) :546,564,654,645,456,465
Here is a pseudocode of the program:
if ( bet1)
     if (all three numbers match in exact order)
player wins
     else
player loses
else // bet2
     if (all three numbers match in any order)
          player wins so check whether bet contains duplicates to determine payoff
     else
player loses
Hope somebody can help me with this soon! Thank uuuuu

Hi there,
Im working on a programming project which is about a
lottery game, and the only part I am missing is where
I have to compare the player's number to the winning
number. The user has 2 types of bets but one of them
have to match the winning number in any order. For
example:
Players Number: 546      
Winning Numbers (Match Any Order)
:546,564,654,645,456,465
Here is a pseudocode of the program:
if ( bet1)
     if (all three numbers match in exact order)
player wins
player loses
// bet2
     if (all three numbers match in any order)
player wins so check whether bet contains
ns duplicates to determine payoff
     else
player loses
e somebody can help me with this soon! Thank uuuuuhi :-)
you already have your pseudo. just do it ;-)
regards,

Similar Messages

  • Open CC applications to default preferences with no user input

    I am searching for a way to open CC applications to default preferences with no user input. I understand there is a key board short cut (command/option/shift on start) but I am hunting for a way to have the preferences always revert to default. In the past I have written a script to delete the preference files upon computer start up but once again, it needs to be rewritten. Is there a method that does not require KLUDGE?

    Try:
    *http://kb.mozillazine.org/Preferences_not_saved

  • Create SAP B1 Query with Optional User Input Fields

    Hi All... any help is greatly appreciated, I am new to this forum and hope to contribute in the near future once I become more of an expert with B1.
    I have a query I need to build that will search about 10 UDF's. The problem is, I don't know how to make the user input fields optional within the query. Currently, I have the following queries as testing searching 2 UDF"s:
    SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand] FROM OITM T0 WHERE T0.[U_Quality] = [%0] OR T0.[U_LengthFT] =[%1]
    This query works when leaving one of the user input fields blank. However, the values it provides are wrong because it is an OR statement which will show item codes with a certain quality OR a certain size.
    The following query is the same as above but switched the OR to AND:
    SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand] FROM OITM T0 WHERE T0.[U_Quality] = [%0] AND T0.[U_LengthFT] =[%1]
    This query provides me with the correct values but will not work if one of the user defined fields is not filled out.
    How do I go about getting the results I want and not having the user fill out all the UDF's for the query to execute properly?

    I think I figured it out
    SELECT T0.ItemCode, T0.ItemName, T0.OnHand
    FROM OITM T0
    WHERE (T0.U_Quality = '[%0]' OR '[$0]' = '0') AND (T0.U_LengthFT ='[%1]' OR '[%1]' = '0')
    SAP must be defaulting empty user input field values to "0"
    I tried the above query and it worked!!!
    Is there anything you can add if I am missing something?
    Thanks, Alec.

  • How would I change the variables in multiple methods with the user input?

    Here is my code for a tic tac toe game I have to do for an assignment, it is currently set at the normal 3 x 3, but the teacher what the user to be albe to change these to between 3-5 before they start playing, here is my codeing
    import java.util.*;
    public class TicTacToe
    Constructs an empty board.
    private String[][] board;
    private static int ROWS = 3;
    private static int COLUMNS = 3;
    public TicTacToe()
    int size = in.nextInt();
    board = new String[ROWS][COLUMNS];
    // Fill with spaces
    for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
    board[i][j] = " ";
    Sets a field in the board. The field must be unoccupied.
    @param i the row index
    @param j the column index
    @param player the player ("x" or "o")
    public void set(int i, int j, String player)
    if (board[i][j].equals(" "))
    board[i][j] = player;
    Creates a string representation of the board, such as
    |x o|
    | x |
    | o|
    @return the string representation
    public String toString()
    String r = "";
    for (int i = 0; i < ROWS; i++)
    r = r + "|";
    for (int j = 0; j < COLUMNS; j++)
    r = r + board[i][j];
    r = r + "|\n";
    return r;
    I am having a problem figuring out how to change the variables ROWS , COLUMNS to the given user input, it seems easy but i can't really figure out how to do it
    thanks ahead of time

    import java.util.*;
    public class TicTacToe
    Constructs an empty board.
    private String[][] board;
    private static int ROWS = 3;
    private static int COLUMNS = 3;
    public TicTacToe()
    int size = in.nextInt();
    board = new String[ROWS][COLUMNS];
    // Fill with spaces
    for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
    board[j] = " ";
    Sets a field in the board. The field must be unoccupied.
    @param i the row index
    @param j the column index
    @param player the player ("x" or "o")
    public void set(int i, int j, String player)
    if (board[j].equals(" "))
    board[j] = player;
    Creates a string representation of the board, such as
    |x o|
    | x |
    | o|
    @return the string representation
    public String toString()
    String r = "";
    for (int i = 0; i < ROWS; i++)
    r = r + "|";
    for (int j = 0; j < COLUMNS; j++)
    r = r + board[j];
    r = r + "|\n";
    return r;
    }sorry for not posting code correctyl new to this forums
    Thanks for the help but let me rephrase my question, the rows and columns are the same like 3x3, 4x4 ,or 5x5,
    -when the program runs it will ask the user for what they want to set the tic tac toe at between 3 - 5.
    My question is how do I get the code
    Scanner a = new Scanner ( System.in );
    System.out.print("Enter the size of the tic tac toe box to be between 3-5 : ");
    int sizeTicTacToe = a.next();to change the variables of ROWS COLUMNS
    I just want to know of a way to make the users input of sizeTicTacToe to change the variables ROWS & COLUMNS in my toString() and TicTacToe() methods

  • How can I define a tooltip with multiline user input?

    I've created a button with app.response to get user input for defining a textbox's tooltip, but for my purposes I need multi-line text formatting within the tooltip, such as the \n character.  How can I accomplish this?  Thanks.

    How do you mean?  I've not been able to find any real settings for the tooltip under properties.  A long enough line of text wraps around, but I want it to contain some actual formatting, for ease of reading.  One long paragraph, followed by a few individual bullet points of info.  For example:
    Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.
    Blah: blah blah blah blah blah blah blah blah blah blah blah blah
    Blah: blah blah blah blah blah blah blah blah blah blah blah blah
    Blah: blah blah blah blah blah blah blah blah blah blah blah blah
    Is that at all possible with the built in tooltip?

  • Problems with getting user input

    Hi All,
    I want to get user input from a command line and i am NOT using a GUI.
    The user can still see their password when they are typing it in.
    Is there anyway to show '******' when they type in their password??
    This is what I have so far..
    public static void getPassword() {
    System.out.print("Enter password-->");
    DataInputStream input = new DataInputStream(System.in);
    try{  
    password = input.readLine();
    catch (IOException e){
    System.out.println("ERROR " + e);
    Any help would be greatly appreciated.
    Thanks
    Kal.

    Kal,
    I'm pretty sure you're going to need some kind of GUI (either a Java window or an HTML page) to get the desired effect. There might be a way to set the echo character in the command line, but I'm not sure.
    - Sheepy

  • Portege R500 logs off spontaneously with no user input

    My Toshiba Portege R500 has a strange problem where it logs off spontaneously without any user input. This has happened since approximately 2 weeks into ownership and happens once or twice per day.
    There is no consistency in when or why this happens. The machine can be idle, or I can be running a variety of software. There is no consistency in the software I have running when it happens. The machine will just suddenly display the Windows XP "logging off" dialog box, then commence log-off. It gets to the "Saving your Settings" stage then hangs. I then need to force a power off and reboot the machine. This happens regardless of whether the machine is running off the battery or mains power.
    This doesn't seem to be heat related, as I would expect heat related problems to simply power the machine off, not actually go through the log off procedure. There is nothing in the event viewer and it does not seem related to any particular software. I have tried recreating my local profile and the problem still occurs.
    My technical services department have been told that Toshiba Support will not look at this problem unless we try a full rebuild of the machine first. I find this a bit extreme and would rather they looked at resolving the problem instead of just wiping the whole thing and re-installing Windows XP.
    Has anyone experienced this? Any ideas what could be causing this?
    Thanks,
    Derek

    Hello Derek
    Is WXP your own installation or you got WXP recovery media?
    To be honest for such problems is really not easy to find an answer and to find any logical explanation can take hours of investigation. If your case is an isolated case I do not see any sense to spend so many times and because of that I can understand the support guys.
    The fact is that Toshiba must guarantee that recovery image will work well. And because of that they can say: let us make new WXP installation and see if the problem persists. At this point where you make some changes on preinstalled OS and install some non-supported software there is a new situation and it is not easy to offer simply answer to every strange issue.
    I am really interested if someone else will report about the same problem.
    Bye

  • Customising a pdf form with online user input?

    I've designed a breast cancer pamphlet and saved it as a pdf.
    I'm looking for a way that web users can customise the headline, or add their contact info to the pamphlet.
    Then, after they have personalised the pdf, it is saved as a new pdf for them to download and print at a high quality.
    I also have my site built with Wordpress, so if there's a wp plugin out there, that would be helpful.
    Any ideas how a graphic designer could make this happen?
    Thanks!
    worldwidebreastcancer.com

    > it is saved as a new pdf
    This will really be your limitation. If your end users have a full version of Acrobat Standard or Professional, no problem. But since I assume most would only have the free Adobe Reader, in order for them to save the form it would have to be Reader Extended and that would require that you have an Adobe LiveCycle Reader Extensions Server.
    There is an option in Acrobat Professional to apply extended usage rights to the document, but in the EULA it clearly states this is limited to 500 uses of the form - so unless you can physically limit access to your form to 500 people or less, total, ever, that will not be an option for you since going over 500 would be a violation of your licensing agreement.

  • I need help with reading user input

    Hi there, I have the following sql query:
    select v.veh_vin, v.veh_make, v.veh_model, v.veh_regonumber, c.cond_desc
    from vehicle v, condition c
    where v.cond_code = c.cond_code and v.br_no = &branch_number
    order by v.veh_make, v.veh_model;
    The query compiles fine, but when I'm prompted to input the value for "&branch_number", I get an error stating "invalid identifier". I make I input the value correctly, but I still keep getting an error. Can anyone tell me what I'm doing wrong? (v.br_no is a CHAR(4 byte) datatype, if this helps.)
    On an unrelated note, what's the difference between using only one ampersand, compared to using two ampersands? (ie. what's the difference between "&branch_number" and "&&branch_number"?)

    Are you providing a char-value? That is are you enclosing it between single quotes?
    You could also do this:
    select v.veh_vin, v.veh_make, v.veh_model, v.veh_regonumber, c.cond_desc
    from vehicle v, condition c
    where v.cond_code = c.cond_code and v.br_no = '&branch_number'
    order by v.veh_make, v.veh_model;Which prevents you from having to provide the quotes every time.
    The double ampersand will prevent being prompted twice (or as many times as the variable is used inside the query).
    Eg.
    select *
    from dual
    where &i = &i
    /Will prompt you twice to provide the value for i. Whereas:
    select *
    from dual
    where &&i = &&i
    /will only prompt you once.
    Toon

  • ISight green LED comes on with no user input?

    So,pretty freaky when it looks like someone has taken over control of your perfectly sound Mac, right? I was across the room, and I say the camera light come on my MPB, and there weren't any IM apps loaded, and certainly none with auto camera on configured. Who would be crazy enough to do that? Performance artists of some description.
    Any thoughts on what could be doing this, and what I might look for to find out if I'm being hacked? I could pull the net connection, but the point of having a computer is to be on the network, right? Unless all you're doing is writing, of focussed on local activities.
    Freaked me out, that did.

    Hi,
    Nearly a yewar ago there was a report that a US School had given out Macs that had software on them that allowed the School to access the computer and the Camera.
    They claimed it was so they could see who had any computer that was stolen.
    I don't remember if the story actually said if any were stolen.
    It did say that students got to find out and the School was in a lot of trouble for taking and storing pics, mainly of students in thier bedrooms.
    I don't remember if anyone said the light came on or not.
    I don't think it is going to be any sort of hacking.
    Things to exclude. 
    Some Web Sites can access the camera via the Flash Plug-in.
    This normally causes a Pop up to appear where you have to specifically Agree to Allow access. However there is also a Remember button.
    It is a long time since I saw someone code a page that accessed the camera without asking (whether that is Adobe changing that feature or actual Coding I am not sure)
    There is also a Google Video Chat Plug-in for Macs so they can chat via the Google Mail Web page Chat option.
    I had used this very little and can't say that I can remember if it asks for Permission.
    However you don't say you found a Video Chat Invite in a Google Chat
    Face Time on a Intel Mac and iChat on any both do a partial Login at the Computer Start up.
    In iChat's case this will start the iChat Up if someone sends you an Off Line IM  (it does depend if you have reset the default Accept to be Off - normmaly by a Message from AIMSysMessage asking if you want to receive more - answering No to the IM turns it Off)
    In Face Time's case any Incoming call will start up Face Time.
    The Beta seems reluctant to show a Window but the camera is then Active.
    I do not have the App Store version and don't know if the Preferences can be set to only accept calls when fully active.
    Sticking somewhat with Web Browsers there are apps that can be set up to detect movement linked to the Screen Saver being active (or not) and loading it to a web site (on the Mac or External).
    See EvoCam and SecuritySpy in the Nanny cam section of this page
    Also consider everything else on that page.
    iMovie, Quicktime that you already have and any of the Add-on and apps listed.
    Remember the list is not exhaustive.
    For instance Comic Book bundled at one time with soem Macs can access the camera for Snap Shots.
    System Preferecnes > Accounts > (Any Account) > Login Pic
    This can access the camera for Snap Shots if set to Change the Pic
    Depending what items you have in System Preferences > Sharing and in some cases additional Access Passwords you may have a point of Access.
    Screen Sharing can be accessed without an incoming password over VNC  This would tend to mean that your routiung device is forwarding that port (normally 5900) to your computer - OR - you are connected directly to the internet such as a Cable modem.
    Any person making use of this would have the same access to the Mac and its apps, System Folder structure that you do.
    Most of the Posts that have said someone has reported similar to you (and reported back) have tended to say that a fault was found when they took it to a Store.
    The Internal iSIght is a USB device.
    The OS numbers the devices you have so it "knows" which one the apps and other softare are trying to contact and use.
    It is know that sometimes the  Mac loses track of which device is which.
    The camera may have been triggered when it should have been an External Hard Drive or other device.
    Restarting the computer will normally sort this.
    8:47 PM      Saturday; May 21, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously
    >

  • User input with while

    Hello all!
    I'm kinda new to Java and especially to these forums. I know it's impolite to go into a community and ask for something straight away; but I really can't find a solution to my problem:
    I'm trying to make a small hangman game with console user input. The code:
    package mystupidjavaapp;
    import java.util.*;
    import java.awt.*;
    public class MyStupidJavaApp
        public static void main(String[] args)
         Scanner console = new Scanner (System.in);
         System.out.println("Let's play hangman are you ready? ");
         String s = console.nextLine();
         DrawingPanel panel = new DrawingPanel(500, 400);
         Graphics g = panel.getGraphics();
         panel.setBackground(Color.white);
         drawingPanel(g);
         userInput(console, g, s);
        public static void drawingPanel( Graphics g)
            g.setColor(Color.black);
            g.drawLine(50, 50, 50, 70);
            g.drawLine(50, 50, 100, 50);
            g.drawLine(100, 50, 100, 150);
            g.drawLine(75, 150, 125, 150);
            g.drawString("Hello and welcome to a small sample of a hangman game!", 120, 50);       
        public static void userInput(Scanner console, Graphics g, String s)
           int roll=0;
           String word = "";
           while (!s.equals("yes"))
              console.next();
              System.out.println("Well if you can't say a simple \"yes\"  then we can't go on. ");
              s = console.nextLine();
             System.out.println("Nice! ");
             Random r = new Random();
             roll = r.nextInt(4)+1;
             if (roll == 1)
                 word = "pu";
             else if (roll == 2)
                 word = "copac";
             else if (roll == 3)
                 word = "bani";
             else
                 word = "casa";
          if (roll !=0)
              g.drawLine(150, 130, 200, 130);
           for (int i=0; i<=word.length()-1; i++)
              g.drawLine(150+i*70, 130, 200+i*70, 130);
          int tries=0, position=0, guess=0;
          while (tries <= 6 && guess<=word.length())
           System.out.println("Ok please input a letter(one letter at a time please): ");
           String s1 = console.next();
           char c = s1.charAt(0);
           for (int i=0; i<word.length(); i++)
                 if (word.charAt(i) == c)
                     position = i;
                     System.out.println("Congratulations you got a letter right! ");
                     guess++;
                     if (position==1)
                        {g.setFont(new Font("SansSerif", Font.PLAIN, 40));
                         g.drawString(s1.substring(0,1), 170, 125);}
                     else if (position!=0)
                        {g.setFont(new Font("SansSerif", Font.PLAIN, 40));
                         g.drawString(s1.substring(0,1), 170+70*position, 125);}
                 else
                     tries++;
    }My main problem is with the "while (!s.equals("yes"))" part, where if I enter the loop it will never exit it. What to do? Also, I tried watching for variables but I dunno how to do that to be honest :(. (In Netbeans, I tried going in the top "Debug" menu and there I selected "New Watch" and I chose the variable I wanted. Sadly as I run my code, in the watch window my variable is unchanged; moreover it doesn't even receive a value)
    Suggestions/ help anyone :S?

    Hello!
    Thanks for the reply and sorry for my late reply. I wanted to start out by watching the "tries" variable but I have no idea what I'm doing. i tried setting break points throughout my code but nothing seems to happen/change. I need a step by step tutorial on how to watch a variable "evolve" through my code. I know this is probably a nuisance but until I find a good tutorial on it, I dunno how to do it :(.
    **QUICK EDIT**
    I finally got it to work! The main problem started because I couldn't get all the letters to show up on the right spot or sometimes I couldn't get the letters to show up at all. But after staring at the code for awhile I decide to ditch the "if" that was generating the letters. Here's how it looks now and it works flawlessly! (In case some1 is curious.)
    package mystupidjavaapp;
    import java.util.*;
    import java.awt.*;
    public class MyStupidJavaApp
        public static void main(String[] args)
         Scanner console = new Scanner (System.in);
         System.out.println("Let's play hangman are you ready? ");
         String s = console.nextLine();
         DrawingPanel panel = new DrawingPanel(500, 400);
         Graphics g = panel.getGraphics();
         panel.setBackground(Color.white);
         drawingPanel(g);
         userInput(console, g, s);
        public static void drawingPanel( Graphics g)
            g.setColor(Color.black);
            g.drawLine(50, 50, 50, 70);
            g.drawLine(50, 50, 100, 50);
            g.drawLine(100, 50, 100, 150);
            g.drawLine(75, 150, 125, 150);
            g.drawString("Hello and welcome to a small sample of a hangman game!", 120, 50);       
        public static void userInput(Scanner console, Graphics g, String s)
           int roll=0;
           String word = "";
           while (!s.equals("yes"))
              console.next();
              System.out.println("Well if you can't say a simple \"yes\"  then we can't go on. ");
              s = console.nextLine();
             System.out.println("Nice! ");
             Random r = new Random();
             roll = r.nextInt(4)+1;
             if (roll == 1)
                 word = "pu";
             else if (roll == 2)
                 word = "copac";
             else if (roll == 3)
                 word = "bani";
             else
                 word = "casa";
              g.drawLine(150, 130, 200, 130);
           for (int i=0; i<=word.length()-1; i++)
              g.drawLine(150+i*70, 130, 200+i*70, 130);
          int tries=0, position=0, guess=0;
          while (tries <= 6 && guess<=word.length())
           System.out.println("Ok please input a letter(one letter at a time please): ");
           String s1 = console.next();
           char c = s1.charAt(0);
           for (int i=0; i<word.length(); i++)
                 if (word.charAt(i) == c)
                     position = i;
                     System.out.println("Congratulations you got a letter right! ");
                     guess++;
                     g.setFont(new Font("SansSerif", Font.PLAIN, 40));
                     g.drawString(s1.substring(0,1), 170+70*position, 125);
                 else
                     tries++;
              if (tries == 1)
                  g.drawOval(40, 70, 30, 30);
              else if (tries == 2)
                  g.drawLine(50, 100, 50, 140);
              else if (tries == 3)
                  g.drawLine(50, 110, 20, 120);
              else if (tries == 4)
                  g.drawLine(50, 110, 80, 120);
              else if (tries == 5)
                  g.drawLine(50, 130, 20, 140);
              else if (tries == 6)
                  g.drawLine(50, 130, 80, 140);
    }Sadly I couldn't manage to understand how to use breakpoints :|.
    Edited by: 890334 on Jan 23, 2012 1:53 PM

  • Powershell : Issues with user input collection from Multiple InPutBox Form

    I am having issues with getting user input to pass from a form that a user fills out into variables that I can then use in other methods and commands. (ex; SQL Query, SQL Data Add, ... )
    I have attached the Powershell script I am using in it's designed form but I am having issues getting the DataCollection function to grab the content of the InputBox and send it to a variable for later use.
    Note: I'm running this at this time from the ISE so I can actually see what is going on.
    Any help would be appreciated.
    DAS
    [System.Reflection.Assembly]::LoadWithPartialName( “System.Windows.Forms”)
    [System.Reflection.Assembly]::LoadWithPartialName( “Microsoft.VisualBasic”)
    $FormDBA = New-Object System.Windows.Forms.Form
    $FormDBA.Size = New-Object System.Drawing.Size(300,500)
    $FormDBA.Text = "MIS Data"
    $FormDBA.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen;
    function DataCapture
    $SubSID = $InBoxSID.text
    ECHO $SubSID
    $InBoxTxtSID = New-Object System.Windows.Forms.Label
    $InBoxTxtSID.Location = New-Object System.Drawing.Size(25,15)
    $InBoxTxtSID.Text = "Sticker ID : "
    $InBoxSID = New-Object System.Windows.Forms.TextBox
    $InBoxSID.Location = New-Object System.Drawing.Size(130,10)
    $InBoxSID.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtUSR = New-Object System.Windows.Forms.Label
    $InBoxTxtUSR.Location = New-Object System.Drawing.Size(25,55)
    $InBoxTxtUSR.Text = "User Name ; "
    $InBoxUSR = New-Object System.Windows.Forms.TextBox
    $InBoxUSR.Location = New-Object System.Drawing.Size(130,50)
    $InBoxUSR.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtPCN = New-Object System.Windows.Forms.Label
    $InBoxTxtPCN.Location = New-Object System.Drawing.Size(25,95)
    $InBoxTxtPCN.Text = "PC Name : "
    $InBoxPCN = New-Object System.Windows.Forms.TextBox
    $InBoxPCN.Location = New-Object System.Drawing.Size(130,90)
    $InBoxPCN.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtDPT = New-Object System.Windows.Forms.Label
    $InBoxTxtDPT.Location = New-Object System.Drawing.Size(25,135)
    $InBoxTxtDPT.Text = "Department : "
    $InBoxDPT = New-Object System.Windows.Forms.TextBox
    $InBoxDPT.Location = New-Object System.Drawing.Size(130,130)
    $InBoxDPT.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtPCT = New-Object System.Windows.Forms.Label
    $InBoxTxtPCT.Location = New-Object System.Drawing.Size(25,175)
    $InBoxTxtPCT.Text = "PC Type : "
    $InBoxPCT = New-Object System.Windows.Forms.TextBox
    $InBoxPCT.Location = New-Object System.Drawing.Size(130,170)
    $InBoxPCT.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtMAK = New-Object System.Windows.Forms.Label
    $InBoxTxtMAK.Location = New-Object System.Drawing.Size(25,215)
    $InBoxTxtMAK.Text = "Make : "
    $InBoxMAK = New-Object System.Windows.Forms.TextBox
    $InBoxMAK.Location = New-Object System.Drawing.Size(130,210)
    $InBoxMAK.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtMOD = New-Object System.Windows.Forms.Label
    $InBoxTxtMOD.Location = New-Object System.Drawing.Size(25,255)
    $InBoxTxtMOD.Text = "Model : "
    $InBoxMOD = New-Object System.Windows.Forms.TextBox
    $InBoxMOD.Location = New-Object System.Drawing.Size(130,250)
    $InBoxMOD.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtOPS = New-Object System.Windows.Forms.Label
    $InBoxTxtOPS.Location = New-Object System.Drawing.Size(25,295)
    $InBoxTxtOPS.Text = "O.S. : "
    $InBoxOPS = New-Object System.Windows.Forms.TextBox
    $InBoxOPS.Location = New-Object System.Drawing.Size(130,290)
    $InBoxOPS.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtDIS = New-Object System.Windows.Forms.Label
    $InBoxTxtDIS.Location = New-Object System.Drawing.Size(25,335)
    $InBoxTxtDIS.Text = "Disposed : "
    $InBoxDIS = New-Object System.Windows.Forms.TextBox
    $InBoxDIS.Location = New-Object System.Drawing.Size(130,330)
    $InBoxDIS.Size = New-Object System.Drawing.Size(120,20)
    $button = New-Object System.Windows.Forms.Button
    $button.Location = New-Object System.Drawing.Size(150,400)
    $button.Width = 100
    $button.Text = “Ok”
    $button.Add_Click({DataCapture})
    $FormDBA.Controls.Add($button)
    $FormDBA.Controls.Add($InBoxTxtSID)
    $FormDBA.Controls.Add($InBoxTxtUSR)
    $FormDBA.Controls.Add($InBoxTxtPCN)
    $FormDBA.Controls.Add($InBoxTxtDPT)
    $FormDBA.Controls.Add($InBoxTxtPCT)
    $FormDBA.Controls.Add($InBoxTxtMAK)
    $FormDBA.Controls.Add($InBoxTxtMOD)
    $FormDBA.Controls.Add($InBoxTxtOPS)
    $FormDBA.Controls.Add($InBoxTxtDIS)
    $FormDBA.Controls.Add($InBoxSID)
    $FormDBA.Controls.Add($InBoxUSR)
    $FormDBA.Controls.Add($InBoxPCN)
    $FormDBA.Controls.Add($InBoxDPT)
    $FormDBA.Controls.Add($InBoxPCT)
    $FormDBA.Controls.Add($InBoxMAK)
    $FormDBA.Controls.Add($InBoxMOD)
    $FormDBA.Controls.Add($InBoxOPS)
    $FormDBA.Controls.Add($InBoxDIS)
    $FormDBA.ShowDialog()

    Change this:
    $button = New-Object System.Windows.Forms.Button
    $button.Location = New-Object System.Drawing.Size(150,400)
    $button.Width = 100
    $button.Text = “Ok”
    $button.DialogResult='Ok'  #<<<<<-------
    #$button.Add_Click({DataCapture})
    Remove function andrun like this:
    if('Ok' -eq $FormDBA.ShowDialog()){
        $FormDBA.Controls|%{$_.Text}
    With names you can get values by control name.
    ¯\_(ツ)_/¯
    This suggestion works for the purpose I needed. 
    If I could, I would attach the file instead of pasting the script so you can see what all I am using this to do.
    But in short, we have a main form we use to pull records from a database and call up an application at the click of a button for remote assistance.  However, we seem to now need the ability to have this application to edit and add new records into said
    database.  That's where this second form came in and also when I hit my issue with the information capture.
    At this time I'm getting this to format the information collected so that I can start using using it with SQL commands.

  • How to make Flash to wait for user input

    Hi,
    I found this PHP script, then I made some changes to make it
    FEED the Flash user interface with online user input.
    The main concept of this script is WAITING for user input, so
    it shows the messages and then go to next line and so on.
    The user input go to directly to TEXT file which writes in
    lines, each line has a unique id = (mag_id).
    There "get_msge.php" which works as the middleware between
    FLASH and messages text file.
    The problem, its doesn’t show any data while there are
    data in the text file.
    Help here please, best regards.
    This is the link of
    problem illustartion
    AS is:
    // create an object to store the variables
    varReceiver = new LoadVars();
    // load the variables from the text file
    varReceiver.load("get_msg.php?file_id=1&msg_id=1",
    "POST");
    // trigger something - when the variables finish loading
    varReceiver.onLoad = function(){
    //the variables have finished loading
    if (this.msg_id == 1) {
    _root.xmsg1_swf.text = this.msg;
    _root.xmsg1_ch.text = this.msg;
    gotoAndPlay("line2");
    } else {WAIT }
    PHP is:
    <?php
    //get these values from the FLASH
    $file_id_swf = $_POST ['file_id'];
    $file_name = "messages/messages".$file_id_swf.".txt";
    $msg_id_swf = $_POST ['msg_id'];
    // [0] ."||".[1] ."||".[2] ."||". [3] ."||".[4]."||". [5].
    //$msg_id."||".date."||".time."||".$from."||".$to."||".$msg.
    $fp = fopen ($file_name, 'rb');
    while (!feof ($fp))
    $msg_txt = fgets ($fp, 1024);
    $line = explode ("||", $msg_txt);
    $msg_id = $line[0];
    $from = $line[3];
    $to = $line[4];
    $msg = utf8_encode ($line[5]);
    if ($msg_id == $msg_id_swf)
    echo
    "msg_id=".$msg_id."&from=".$from."&to=".$to."&msg=".$msg;
    }//while
    fclose ($fp);
    ?>

    Well, given the things that you've written, I don't think it
    could. There technically isn't any code in flash that lets it
    "wait." In order to "wait," you must run the script over again
    until some condition is met.
    However, your code does look accurate. Why do you need to
    wait? The onLoad function will be invoked WHEN something is loaded.
    So, I don't see the reason for the "waiting."
    In addition to that, I would like to say that using text
    files isn't that great with flash. I have done this before and
    noticed several problems with using text files. The biggest problem
    is that the text files are cached after being loaded. Every time
    you re-load it again, you will get what you got the first time
    until you reset your cache (ie. close your browser). I suggest
    using MySQL. (Just my thought.)

  • WDA + AIF : Get modified PDF source (XSTRING) after user input

    Hi guys,
    I have this problem.
    I have an online adobe interactive form (ZCI layout) with fillable and dynamic attributes sets to 'X'.
    The interface is type "Dictionary Based" (not XML).
    I've created a wda that calls standard ADS function modules (FP_JOB_OPEN, generated function modules, FB_JOB_CLOSE) to get the xtring of this Form. Then i bind the xstring returned by generated function module in order to show it in a view (that contains an AIF element). Now the user can insert values in input-ready fields.
    When the user close the window, i'd like to read the whole (result) xstring of the pdf, filled with the user input.
    But when i read the context attached of the pdf (called pdfsource) after user input, it contains only the pdf source, but not the user's input also. The result should be a merge of pdfsource and userdata, in order to save the xstring in a specific path (after conversion).
    Is there a way to solve this problem ??
    Thank a lot for your help and hints
    Andrea

    Please,
    no one may help me with this task?
    Just know if it is possible do something like my request, or not.
    I've alredy search in old posts also, but nothig was found.
    Thanks a lot
    Andrea

  • Xcode 4 - AppleScript - User Input

    I have just started playing with Xcode 4, and started a AppleScript project.
    I have wrote a quick piece of code that refreshes a webpage every five seconds, and I want to put it into a .app for my friend who wants to use it.
    Here's my code
    script AppDelegate
    property parent : class "NSObject"
        on clickedme_(sender)
            repeat
                delay 5
                tell application "safari"
                    open location "(website url / user input wanted here)"
                    end tell
                end repeat
        end clickedme_
              on applicationWillFinishLaunching_(aNotification)
      -- Insert code here to initialize your application before any files are opened
              end applicationWillFinishLaunching_
              on applicationShouldTerminate_(sender)
      -- Insert code here to do any housekeeping before your application quits
                        return current application's NSTerminateNow
              end applicationShouldTerminate_
    end script
    Where it is highlighted in my script, I would like to know if I could possibly get a user to copy/paste a URL into a text box, and then they can click a button which refreshes that page.
    So on the left of my UI, I want the user input text box, and then the button on the right which executes the script with the user input where it's highlighted.
    Thanks!

    Create an outlet property and connect it to your text field, after which you can use various methods of the NSTextField class and its parents (such as NSControl's stringValue to get its value).  Note that you really shouldn't use the delay command, since that will block your user interface - better would be to use NSObject's performSelector:withObject:afterDelay: or perhaps a repeating timer.

Maybe you are looking for

  • Venn diagram in BEX

    Is venn diagram possible in BEX For example Total no of vendors GGn = 100                       Total no of vendors DHR =50                        Common vendors between these 2 plants is = 20 Then I want the venn diagram for this

  • Handling Namspaces in XSLT xpaths...

    Hi,    I'm trying to generate the SOAP envelope using XSLT mapping. The source message to my mapping program, contains two fields:   a. username   b. pwd But they come in with attached namespaces like ns1. How do I specify the xpath to get the data f

  • SAP CRM and ECC doubt

    Hello, Could anyone help me for my doubt in the SAP CRM. When have a Two systems SAP CRM and ECC, If we create a role in CRM (Eg. Employee) how this role is transfered to ECC ?

  • Getting Error in Non-Existent File

    hi getting "invalid expression term" error on a line that does not exist in the file (aspx file).  Then, i delete the file. Now, still getting same error-- for a file that does not exist.  How to fix? thx

  • Troubleshooting slow startup of JavaFX app

    I made a simple Hello World example from the Efxclipse tutorial on JavaFX. It takes 12 Seconds to start. After searching the internet I found: Deploying JavaFX Applications: Troubleshooting | JavaFX 2 Tutorials and Documentation I can pass "-Djavafx.