arraylist

nick2210

Member
Hello
Can anybody tell me how to represent items of an arraylist in a single messageBox,separated by "*"?
I have created my first application that does Factorization,but can't represent the result to the user in a single msgbox
 

Attachments

  • math.sbp
    1.1 KB · Views: 185
  • primeNumbers.txt
    7 KB · Views: 182

nick2210

Member
Thanx a lot Klaus.
Although your Math1 version won't work,I have found the solution to my problem.
according to you:
i=0
do
do
a=n/arraylist2.item(i)
.........................
loops with the same value,that i 2.

variable "mn" IS used and it's a russian contraction for "multiplier"

The final version of my "masterpiece" is attached.
 

Attachments

  • math2.sbp
    1.6 KB · Views: 210
  • primeNumbers.txt
    7 KB · Views: 228

klaus

Expert
Licensed User
Longtime User
Why do you say that Math1.sbp doesn't work ?

I compared results between Math1 and Math2 no difference.
When you find a factor, for example 5, there is no need to try with 2 and 3 again you already know that there are none they were already tested.

Best regards.
 

mjcoon

Well-Known Member
Licensed User
variable "mn" IS used and it's a russian contraction for "multiplier"

I imagine that Klaus means that it is not used as a global structure. You may have a future usage in mind but at the moment the two elements of the structure might just as well be separate local variables in Sub Button1_Click. And the index element is write-only.

I would have understood the program faster if the two arraylists had distinctive names rather than the defaults.

I'll keep out of the discussion of program operation...

Mike.
 

nick2210

Member
I beg your pardon Klaus,your version runs smoothely.I just was launching it in the wrong folder(without .txt file)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…