Results 1 to 10 of 10

Thread: Multiple outcomes of addition using any number in textbox

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2014
    Posts
    45

    Multiple outcomes of addition using any number in textbox

    Trying to figure out the filtering for my code so far to exclude repeating adding numbers to given number in textbox. Here's a picture of my project. Any help is welcome, thanks in advance.Name:  2021-05-08_193741.jpg
Views: 81
Size:  43.7 KB

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,543

    Re: Multiple outcomes of addition using any number in textbox

    One simple way is to have the numbers in a list and remove them from the list as you use them so they are no longer available as a choice.

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2014
    Posts
    45

    Re: Multiple outcomes of addition using any number in textbox

    Quote Originally Posted by DataMiser View Post
    One simple way is to have the numbers in a list and remove them from the list as you use them so they are no longer available as a choice.
    I'm using a listbox as you can see. Is just that my code is too long so I'm looking for options here to code something simple. Thanks anyways.

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,543

    Re: Multiple outcomes of addition using any number in textbox

    I was talking about a list for the source numbers but I am not really sure what you mean by repeating. Should for example 1 only be used 1 time or 1 time per addition as shown in your list.

    Based on your first post I assumed the output you show is not what you want but now am not so sure. If you are asking how to shorten your code you would first have to show your code

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,840

    Re: Multiple outcomes of addition using any number in textbox

    Well, I see you are not following the same 'rules' (sketchy as they were) on your other thread. You said that you want to see the 3 numbers in ANY order...now you want to DELETE them? Don't put them in there in the first place.

    Also, IF you still want 3 numbers in ANY order, you are also missing some (my code I offered before also missed several when I was thinking 3 numbers, but in only one order) Like 2 + 1 + 9, 3 + 1 + 8, 3 + 2 + 7, etc....see the repeating pattern there But that should be a moot point if you don't want any 3 sets repeated.

    Please explain once again.
    Sam I am (as well as Confused at times).

  6. #6

    Thread Starter
    Member
    Join Date
    Nov 2014
    Posts
    45

    Re: Multiple outcomes of addition using any number in textbox

    Quote Originally Posted by SamOscarBrown View Post
    Well, I see you are not following the same 'rules' (sketchy as they were) on your other thread. You said that you want to see the 3 numbers in ANY order...now you want to DELETE them? Don't put them in there in the first place.

    Also, IF you still want 3 numbers in ANY order, you are also missing some (my code I offered before also missed several when I was thinking 3 numbers, but in only one order) Like 2 + 1 + 9, 3 + 1 + 8, 3 + 2 + 7, etc....see the repeating pattern there But that should be a moot point if you don't want any 3 sets repeated.

    Please explain once again.
    What I meant is not to repeat in any order same digits and repeat same digit in any addition. I've been trying to figure it out last night but still can't. I just need someone would share some useful information code to filter this out.

  7. #7
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    1,565

    Re: Multiple outcomes of addition using any number in textbox

    You don't need any code to filter anything out. You can write the code using nested for loops and the right "from" and "to" logic that will ensure these duplicates aren't possible.

  8. #8
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,840

    Re: Multiple outcomes of addition using any number in textbox

    EXACTLY!!!!

    so, vbc, post your CODE!
    Sam I am (as well as Confused at times).

  9. #9
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,840

    Re: Multiple outcomes of addition using any number in textbox

    To post your code, COPY all the code into Memory (select all of it from your program and use CNTRL-C).

    Then, click on the "#" icon above (the icon right of the VE icon). Insert your mouse after "QUOTE]" and before "[/QUOTE".
    Then paste with CTRL-P.
    Sam I am (as well as Confused at times).

  10. #10
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    1,565

    Re: Multiple outcomes of addition using any number in textbox

    When it comes to assisting with homework, I (and most others here) will rarely provide usable code. It is your assignment, giving you code is akin to giving you solutions to a math assignment.

    I took a high school programming class. For one assignment that I had completed, one of my friends was struggling with it. So I gave them my code. And, unbeknownst to me, they gave it to others who gave it to others, etc. In the end, about 16 people turned in essentially the same code (some were "smart" enough to at least change variable names, lol), and all of us that turned in that code got a zero on the assignment. So I did the work legit, tried to be "nice", and got bit for it.

    So I'm more than happy to provide guidance, ideas, or feedback on code. But I'll never write the code for you.

    Good luck.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width