Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




2 To 4 Digit Permutations


This is a mini experiment I would like to try out. I had created 4 textboxes joined together, "Text1 to Text4", an "Enter" command button by the text boxes, a "2 number Text" command button, a "3 number Text" command button, a reset command button and an Exit button, all separated by a space one by one below. (The command buttons are the same size as each other.) The space below the 4 joint text boxes is the most puzzling among them all, the Label. I will explain my objective and then the questions:

a) The 4 textboxes are supposed to display numbers between 0 to 9, no letters and no numbers smaller than 0 or bigger then 9. (This part is solved.)

b) When I clicked on the "2 number text" command button, the "3 number text" command button is disabled and Text3 and Text4 are invisible .
When I clicked on the "3 number text" command button, the "2 number text" command button is disabled and Text4 is invisible.
When I clicked Enter without any selection, "2 number text" and "3 number text" command buttons are disabled, assuming that I wanted to input all 4 digits. (These parts are solved.)

c) The Reset button resets all the conditions back to normal. Text1 to Text 4 boxes will be resetted back to "0" with all the 4 Text boxes available (visible) and the 2 common buttons ("2 number text" button and "3 number text" button) made enabled. The exit button quits the programme, as usual. (This part is also solved.)

Now, the question :

1) Notice that there is an empty space under the 4 textboxes? That is for the label to cover the rest of the display. That is the place where I want the enter button to output the permutation. The problem now is how do I write the permutation in the Label after I input my 2 to 4 numbers and pressed enter? Also take in account that the number I planned to input is also supposed to be one of the selected choices. (Example: If I want 0 and 1 as my 2 numbers, "01" and "10" are supposed to be displayed in the label as 2 permutations, not just 10.) Please help me to write a clear display function for the label when I press the reset command button.

2) I wanted only one digit to display in my text boxes but I do not know how to do that.(eg. 09 is also less than 10.) Can anyone help?

For those who have no idea how the display looks like, just imagine it like this display message page. Close current Tag, close all tags and the smilies on the right are the 5 command buttons. The dropdown boxes, option functions and guided mode is roughly the length of the textboxes, number size, 4 of them. This big textbox is something like the label, to store the 1 to 24 permutations.

I hoped that my explanations and the layouts are clear to you guys. Please help. Thanks!!!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Get 6 Digit Permutations
Basically I need to get every 6 digit permutation which only uses three numbers:

3, 5, 2

Don't know why I can't figure it out on my own, I've done something similar to this before.

Conversion Of Signed Digit To 8 Digit Hexadecimal In Vb6
Hi all,

i need to write a program which convert a signed digit to a 8 digit
hexadecimal.
If given a decimal number 100, i need to convert to hexadecimal as
00000064.
How can i set the hexadecimal output to 8-digit?


Thanks.

Hashing A 10 Digit Number To 8 Digit Alphanumeric
Can anyone help me with an algorithm to convert a 10 digit number to an 8 digit alphanumeric?

Preferably, I'd like the following constraints:

1. The number generated is unique - no two numbers will generate the same output
2. The algorithm is one way (irreversable) - not required but would be nice

Eg. Hash(7594865729) returns 8A74BZ65.

Any ideas?

Hashing A 10 Digit Number To A 2 Digit Alphanumeric
I need a function that does the following:

1. Takes a 10 digit number as input and creates a unique hash of that number
2. The hash should allow letters so that it can be shorter than the original number
3. The algorithm should be one-way (ie. irreversable)
4. I'm guessing by adding 26 letters (A to Z) with (0 to 9) will give 36 possibilities for each character. This means a 10 digit number can be hashed to a 2 digit alpha-numeric (?)

10^10 = 10000000000
2^36 = 68719476736

Eg. Hash(0374863796) returns A3 and no other 10 digit number (or < 10 digits) should produce A3.

Does anyone have any ideas about the algorithm to do such a thing. I've looked over the Net at hashing algs such as MD5, but it's not really suited for my purpose. I'm afraid I'm not much good at maths either...

MOD Of 1st 7digit = The 8th Digit Of A 8 Digit Number ?
Hi all,

I am new here and this forums is the best for VB, I use search a lot on this forum and always get what i am jamming at.
But after a whole days search, I am not able find this thing any where.

I have a text box which can take only 8 digits, the thing is, if the : MOD of 1st seven digit = 8th digit then it should focus on next fillup other wise prompt a msg of not been equal.

I know its not that hard for ppl around this great place.

Help would be really appreciated

Regards to all ..

Permutations! Pls Help
i want to generate a set of possible permutations with this number 1119, will give a set of result 1119,1191,1911,and 9111. this will give a 4 set of result due to only 1 number difference, if 1144 got 2 difference number will give a 6 sets of result and so on. i have found this code, it works but it give me too many unwanted result. can anyone help me with this?

Code:
Option Explicit

Private Sub Command1_Click()

List1.Clear
Call permute("", Text1.Text)
MsgBox List1.ListCount & " combinations found"

End Sub

Private Sub permute(sPrefix As String, sPermIn As String)

If Len(sPrefix) > 0 Then Output sPrefix

Dim ix As Long
For ix = 1 To Len(sPermIn)
permute sPrefix & Mid(sPermIn, ix, 1), Left(sPermIn, ix - 1) & Mid(sPermIn, ix + 1)
Next ix

End Sub


Private Sub Output(sOut As String)
List1.AddItem sOut
End Sub

Permutations
Alright, I have text1 and list1.... now, I want list1 to display all the permutations of the characters in text1, like if text1 had abcd then list1 would show a ab ac ad abc abd abcd... etc...

Get All Permutations
First of all this isn't homework. A student of mine asked me how to do it and I'm a tad stumped.

Basically, the task is to print every permutation of "12345" without any number repeating.

Eg.
12345
12354
12435
...
54321

I was thinking of a recursive solution, but wasn't sure on how to implement it.

Any help is much appreciated.

PS. There should be 120 different numbers printed (5P5 = 120)

Permutations
What, do you guys think, is the best way to arrange 7 aribtrary letters in all of thier combinations and enter them into an array or compare them to an array.

i want to loop through each of these combinations, and then compare it to an array of 4000 elements to see if there are any matches

P.S. there are 8031810176 combinations

Permutations
how do i display all alternatives that can be matched using n different characters

eg:

a b c d
a b d c
a c b d
and so on...until all different unique combinations are made

a b c
b a c
b c a
c a b
c b a

Permutations
I am trying to figure out a function to list permutations of some numbers, i.e. if I call

Code:perm = GetPermutations(3)

where perm is a variable array of Integers, I need it to return

1    2    3
1    3    2
2    1    3
2    3    1
3    1    2
3    2    1

The order of the rows isn't important; the order of the columns is everything. I've been trying to figure this out for a while, and haven't come up with anything. Help, anyone?

Combinations, Permutations
I have a list of 24 items. For example, boat, chair, table, etc.
I want to find and list all possible combinations of any two(2) of them, and order does matter.

Any suggestions or VB code I can use to automate the process?

Thanks.

Permutations &amp; Combinations
I've been playing around with perm/comb processing, and got some things to share.

following is a slight improvement of a method posted by MathImagics for calculating nCr (the number of ways to select r items from a total of n):

Code:
'calculates n!/(r!*(n-r)!), avoids overflow by scaling down the multiplied values
Function nCr(n As Long, r As Long) As Variant
Dim Numerator&(), Denominator&, iNumerators&, GCD&, i&
'if the number of items equals slots, or there are no slots
If (n = r) Or (r = 0) Then
'there is only only combination
nCr = CDec(1)
'if the number of item is 1 more then the slots, or there's only 1 slot
ElseIf (n = r - 1) Or (r = 1) Then
'there are n possibilities
nCr = CDec(n)
Else
'get the smaller of r/n-r
iNumerators = n - r
If r < iNumerators Then
r = iNumerators
iNumerators = n - r
End If
'populate an array with values from r+1 to n
ReDim Numerator(1 To iNumerators)
For i = 1 To c
Numerator(i) = i + r
Next i
'for each denominator
For i = 2 To iNumerators
n = 1
Denominator = i
'loop through the numerators
Do
If Numerator(n) > 1 Then
'if there's a common divisor
GCD = GreatestCommonDivisor(Numerator(n), Denominator)
If GCD > 1 Then
'scale down the numerator
Numerator(n) = Numerator(n) / GCD
If GCD = Denominator Then
Exit Do
'there's more to scale down from the denominator
Else
Denominator = Denominator / GCD
End If
End If
End If
n = n + 1
If n > iNumerators Then Exit Do
Loop
Next i
'multiply the numerators, an error should only be caused by overflow
On Error GoTo ErrorOverflow
nCr = CDec(Numerator(1))
For i = 2 To iNumerators
nCr = nCr * Numerator(i)
Next i
End If
'calculation didn't overflow
Exit Function
ErrorOverflow:
'the result is just too big
MsgBox n & "C" & r & " overflows", vbExclamation, App.Title
End Function
this has the same functionality as a standard scientific calculator.
the main part that differs from MathImagic's code is that I don't store the entire Denominator list,
and instead I iterate it dynamically canceling them one by one.


another algorithm I came up with, handles rotating permutations when selecting a number of items from an item range (not all of them...):

Code:
'Variables
Private PWheel() As Long
Private LB As Long, MB As Long, UB As Long
Private PCount As Variant
Private iStep() As Long
'Initialize the rotation with new bounds
Public Sub Init(LowerBound As Long, UpperBound As Long, Slots As Long)
Dim i&
'the upper bound must be larger than the lower
If LowerBound >= UpperBound Then
MsgBox "invalid bounds", vbOKOnly Or vbExclamation, App.Title
ElseIf (1 > Slots) Or (Slots > (UpperBound - LowerBound + 1)) Then
MsgBox "invalid number of slots", vbOKOnly Or vbExclamation, App.Title
Else
'save the bounds for later use
LB = LowerBound
MB = LowerBound + Slots - 1
UB = UpperBound
'redim the permutations wheel according to the new bounds
ReDim PWheel(LB To UB)
'populate the permutation array with values from LB to UB
For i = LB To UB
PWheel(i) = i
Next i
'this is a help variable used when rotating the wheel
ReDim iStep(LB To MB)
'determine the number of permutations
'PCount = nPr(UB - LB + 1, Slots)
End If
End Sub
'Rotate the permutation wheel
Public Sub Rotate()
Dim i&, n&, lTemp&()
'permutating one item
If MB = LB Then
If PWheel(LB) = UB Then
PWheel(LB) = LB
Else
PWheel(LB) = PWheel(LB) + 1
End If
'permutating some of the items in the range (this is the algorithm)
ElseIf MB < UB Then
i = MB + 1
Do While PWheel(i) < PWheel(MB)
If i = UB Then
i = MB
Do While PWheel(i) < PWheel(i - 1)
i = i - 1
If i = LB Then Exit Do
Loop
If i > LB Then
ReDim lTemp(i To MB)
For n = i To MB
lTemp(n) = PWheel(n)
Next n
For n = i To UB - (MB - i + 1)
PWheel(n) = PWheel(n + (MB - i + 1))
Next n
For n = UB - (MB - i) To UB
PWheel(n) = lTemp(UB + i - n)
Next n
SwapLongs PWheel(i - 1), PWheel(i + iStep(i))
If iStep(i) + i = UB Then
iStep(i) = 0
Else
iStep(i) = iStep(i) + 1
End If
Else
For i = LB To UB
PWheel(i) = i
Next i
End If
Exit Sub
End If
i = i + 1
Loop
SwapLongs PWheel(i), PWheel(MB)
'permutating the entire range _
(same as the method used by MathImagics In the knowledge base)
Else
n = UB - 1
Do While PWheel(n) > PWheel(n + 1)
n = n - 1
If n < LB Then Exit Do
Loop
If n >= LB Then
i = UB
Do While PWheel(n) > PWheel(i)
If i = LB Then Exit Do
i = i - 1
Loop
SwapLongs PWheel(i), PWheel(n)
End If
i = UB
n = n + 1
Do While i > n
SwapLongs PWheel(i), PWheel(n)
i = i - 1
n = n + 1
Loop
End If
End Sub
'Retrieves the current permutation
Public Function Current() As Long()
Current = PWheel
ReDim Preserve Current(LB To MB)
End Function
I hope these can be of some use to someone.

Getting Permutations, Recursive?
Hello, nice forum, I registered a year or so back but forgot all my details so rejoined.

I dont do much coding and have hit a problem which is beyond my grasp and am requesting help.

I need something to output every permutation of a variable set of inputs. Let me give some examples of the inputs.

4-6N 1-3A 5-6A

This means 4 to six A's, followed by 1 to 3 N's, followed by 5 to 6 A's.

I could also have any number of input chunks.

So, 5-5A 2-3N 3-3N 1-3N 3-3A is also a valid input.

I have prepared this input by putting the information into a collection of collections. So if we take the first example input, 4-6N 1-3A 5-6A, I have a 3 element collection of collections, the sub collections containing:

in collection 1:
AAAA
AAAAA
AAAAAA

in collection 2:
N
NN
NNN

in collection 3:
AAAAA
AAAAAA

So. From there I want to output every permutation of the above into another collection, thats where my puny mind breaks down. I suspect it requires some sort of recursive sub routine which moniters the positions in the sub collections and header collection but I just cant work it out. Help?

Generate All Possible Permutations?
Hi all,

I am currently stuck in a project where I am required to write an algorithm to generate all possble permutations.

For example, I have an array of 3 characters (a,b,c) and I want all possible string permutations of length 3.

I would get

aaa, aab, aac, aba, abb, abc, aca, acb, acc
baa, bab, bac, bba, bbb, bbc, bca, bcb, bcc
caa, cab, cac, cba, cbb, cbc, cca, ccb, ccc

Altogether 27 of them. I keep getting lost somewhere and cannot proceed. Any hints in any direction would be greatly appreciated!

Thanks and regards,
Brendon

More Advanced Permutations
Dave Barr's post on permutations got me thinking...

I need to generate all the "unique" permutations of n elements where some of the elements are the same.

Simple Example : Perm{"ABB"}
There are 3 unique permutations
ABB
BAB
BBA
But six in total each one of the above is produced twice with the B's swapped, to me there the same.

At present I'm generating "ALL" the permutations and checking each one against those I've already generated, and ignoring it if it matches.

This worked OK up to 10 or so elements but then started to get SLOW.
So I instiuted in 3 level index to speed up the search... 'cos that's what was taking the time once the number of elements gets big.

There must be a better way of doing this!!

The WHOLE situation

Generate all the "Unique" permutations of n elements where 1 (or more) groups of elements are the same.

Full Example : ABCDEEEEEFFFFFFFFFF

I can quickly calculate how many total permutations there are (n!)
And the number of unique permutations in the above (n! / (5! * 10!))
Divide n! by the fractorial of the number of same elements in each group.
(5 E's and 10 F's in the above)

So I very quickly know how many I'm looking for... but the "What they are" is proving slow and combersome.

Any suggestions.

Number Permutations
Hi there

Problem:

I have a set of numbers 1-3, what I would like to have is to list all combinations of the 3 numbers. I would like the combinations to display in seperate cells. For example:

Columns:

A B C
1) 1 2 3
2) 1 3 2
3) 2 1 3
4) 2 3 1
5) 3 2 1
6) 3 1 2

Also, I would like to be able to change the value of 3, so instead of entering 3I could say I have a set of 10 numbers.

How does one do something like this within excel? No need for a form, just code to copy into a module and compile!

Any info will be greatly appreciated. Thanx

Permutations Of An Array,VB6
Hi,
Anybody help me about this topic.
I am trying from few days to display all the permutations of a given array of elements.The number of array elements are more than 10 elements.
I found few examples in this forum to display all the possible permutations of a word or integers.But the examples are only for small number.If i try the same examples for 10 numbers it is taking very very long time. Can anybody help me to display all the permutations for more than 10 integers.
For example my array contains
{a,b,c,d,e,f,g,h,i,j}
I want to display
abcdefghij
abcdefghji
...
Any idea please
thank you

Combnations And Permutations In VB
I'm famuliar with doing combonations and permutations in real life, but I don't know, I have some mental block about doing it in VB. I just have trouble wrapping my head around a programming approach to something like that.
So um, what's the approach for coding combonations & permutations?

Thanks!

Algorithm For Permutations...
I need an algorithm for listing all the possible n! permutations of a list of numbers 1...n

I searched through the message board for previous solutions, and there were ones that dealt with permutations on a string of letters. My list of numbers will be stored as an array of 9 integers, but I would like a solution that avoids hard-coding the 9.

I would like to juggle the numbers within the array of integer so that every possible n! permutation is made.

thanks for any help in advance.

Xeifrank

Permutations Application With A Twist
Hi all -

I am attempting to write a program that will take numbers from a user (that the user enters in text boxes) and will transform them into a string. but more than that, I want the program to show all the possible strings that the numbers could fall into. plus, i include an area that would allow the user to input pairs of numbers (numbers that would pair the single numbers that were already enterd) and then create strings based on that. lastly, I offer an option for users to input the first or last number of the the future string, and then output all the possibilities. can anyone help me?

More Detailed:
Step 1 - 10 Digits Permutating:

The user would enter 10 single digits , and the program would display all the possible permutations of those digits (deleting all duplicates).

I do realize how big the possibilietes could get. If all the digits were different, then there would by 3628800 possibilities. That goes to about a 40MB text file (HUGE!!!!) I understand this! That is why I have steps 2, 3, and 4.

Step 2 - Pairing digits:

The user would be able to enter up to five 2 digit comibnations that would tell the program that the 2 combined numbers must be paired with one another in the final display.

For example:
I enter the digits 0, 0, 0, 3, 0, 0, 0, 7, 0, 0
and I enter a pairing code of 37
the program should make sure that anywhere 3 shows up, 7 must follow it.

0000000037
0000000370
0000003700
0000037000
0000370000
0003700000
0037000000
0370000000
3700000000

Like that.

Step 3 - Junctioning pairs:

The user would be able to enter up to four 2 digit comibnations that would tell the program that the 2 combined numbers must be the beginning and end of two different pairs of numbers from step 2.

For example:
I enter the digits 0, 5, 0, 3, 0, 2, 0, 7, 0, 0
and I enter pairing codes of 37 and 25, and a juntion code of 72.
The program should pair 37 and 25 together by 72.

0000003725
0000037250
0000372500
0003725000
0037250000
0372500000
3725000000

Step 4: First or Last Digit:

The user would also have an option to input the first or last digit of the final display.

For Example:
I enter the digits 0, 5, 0, 3, 0, 2, 0, 7, 0, 8
and I enter pairing codes of 37 and 25, a juntion code of 72, a First Digit code of 8 and a Last Digit code of 0.
The program should pair 37 and 25 together by 72, and place 8 at the beginning and 0 at the end.

8000037250
8000372500
8003725000
8037250000
8372500000


I hope this is more understandable, and I hope anyone can help me. Thanks!

Calculating All Discrete Permutations
Hello,

In a spreadsheet I have 4 categories running vertically with 4 items in each -16 cells. (They're excersies that are grouped by type) So what I've attempted to do is create a random selector of exercises; one from each group. It will initiate using the Seconds portion of the Now function -this I did not include. My initial thought was to take 4 factorial  x 4 factorial for a total of 576 permutations, but I'm not interested in all possible sequences within a combination, only the unique selection as a whole. For example; Push Up, Pull Up, Dip and Sit Up would be one unique combination and I'm not concerned with order. And so I think factorial includes order.
Anyway, what I came up with was 256 discrete combinations by comparing two groups at a time for 16 possible combinations(disregarding order), then compared those 16 versus second group of 16. Initially I tried to code it as one big ugly set of For Nexts, but realized it was an enormously daunting task.
The following works, but I wonder if anyone has a different take on combination algorithms.

Thanks.......Mickey

Dim PartCmb1(32), PartCmb2(256), Some1(4), Some2(4), Some3(4), Some4(4), Some5(4)
Dim i As Integer, j As Integer, k As Integer, m As Integer

  
    For j = 1 To 4
        Some1(j) = Worksheets("Exercise").Range("B" & j).Value
        Some2(j) = Worksheets("Exercise").Range("B" & j + 4).Value
        Some3(j) = Worksheets("Exercise").Range("B" & j + 8).Value
        Some4(j) = Worksheets("Exercise").Range("B" & j + 12).Value

    Next

k = 1
        For i = 1 To 4
           For j = 1 To 4
             PartCmb1(k) = Some1(i) & ", " & Some2(j)
             k = k + 1
           Next j
        Next i
      
         For i = 1 To 4
           For j = 1 To 4
             PartCmb1(k) = Some3(i) & ", " & Some4(j)
             k = k + 1
           Next j
        Next i

''''Combines fist two groups
j = 16
m = 1
For k = 1 To 16
        For i = 1 To 16
           PartCmb2(m) = PartCmb1(i) & ", " & PartCmb1(j)
           m = m + 1
        Next i
     j = j + 1
Next k

For m = 1 To 256
Cells(m, 6).Value = PartCmb2(m)
 Next

Macro For Calculation All Permutations Of 12 Numbers
Hey All,

I need to calculate and display all of the possible permutations of 12 digits. I am aware that the number of permutations is 12! (factorial) but I am really in need of a macro that displays them. I am unsure how to go about this .

Is there any body out there that can help?????

In desperation, a harrassed college student!!!!

Function For Integer Combinations/permutations? - Worth A Look!!
Thanks Darre1,
That thread did the business (especially the attachment at the bottom). But unfortunately I need to add in the letters of the aplhabet a-z (not case sensitive)and possibly the character "-".
Are you aware of any past threads on this possibly?
Again thanks for you help,

Last Digit
how can i get the last 2 digit of a number Ex: 12345 = "45"

All 6 Digit
is there a way have all 6 digit number possiblity, with 0 in front for example:
000000
000001
000002
000003
000004
..
999995
999996
999997
999998
999999
the zero in front is mainly my main in writing thing... can anyone help?

Last Digit
How can i get the lat 2 digit in a number like Ex: 3136 = "36"

60 Digit Calculator
Does anyone know, of how I can create a calculator that will add and subtract 60 digit integers. The integers must stay as whole 60 digits, and not as E..i.e. 121322e+12.
I have tried a simple + & - function, but i get an 'overflow' error.
Thx in advance for any help.

60 Digit Calculator
This is some code that i have written to add
two 60 digit numbers and leave a whole number response. However i can't seem to get it to work with my interface made up of two labels for the input and a text box for the output. Any help will be much apprieciated!!

Dim Num1(0 to 59) As Integer
Dim Num2(0 to 59) As Integer
Dim Result(0 to 60) as Integer
Dim Overflow as Boolean

For Digit=59 to 0 step -1
TempNum=Num1(Digit)+Num2(Digit)
If TempNum>9 then
Result(Digit)=TempNum-10
If Digit=0 Then
Overflow=True
Else
Num1(Digit-1)=Num1(Digit-1)+TempNum-Result(Digit)+1
End If
Else
Result(Digit)=TempNum
End if
Next
If Overflow=True Then
MsgBox("ERROR: Number is over the expected value")
End If

How To Check A Certain Digit??
Hi all, I am wondering how I can look at a specific spot in an integer. I have two text boxes, one being a date and the other being a time, and I want to check each digit in the integer of for example, 09:30, starting with the first digit, and check to see if it is > 1 and if so have a messege pop up stating it is an incorrect time.

Thanx everyone for the help!

Get Last Two Digit From Combo Box
I have record populate in the combo box for example 2007,2008,2009,2010,2011.

How I can get the last two digit from combo box and show it in the textbox?

Text6.Text = Combo6.Text

Four Digit Numbers
I want it so that when the user presses Command1 it adds the numbers 1 - 9999 and txtWord.text to lstFound, the problem is I want it to add, say for the first ten, this :

0000Word
0001Word
0002Word
0003Word
0004Word
0005Word
0006Word
0007Word
0008Word
0009Word
0010Word

I was thinking of, depending on the length of x, it adds 4 - x zeroes with a loop, but I dont know how to determine the length. All help is appreciated.

- Steve

Mod 11 Check Digit
Does anyone have a block of VB code to do a Mod 11 Check Digit? Thanks.

Is Charecter Is Digit?
How can i find if a charector is a ditit?

Digit Grouping
Hi there everyone,

I don't know it's me missing something really simple or what, since I haven't been able to find ONE sample code in any language for digit grouping.
I want to have a text box where as you input numbers it groups digits dynamically like in Windows Calculator.
The format function (Format(num, "###,###,###.00") ) or the VB6 "MaskEdBox" don't do it for me because they always assume a fixed number of characters.
I have come up with a rather awkward code with string manipulation using the "KeyUp" event that would work if I could keep the cursor at the right side of the digits being input. Since after each character that's entered the cursor jumps to the left side of the number I try to remedy this with SendKeys.Send("{END 1}"). It works fine in some routines and causes an infinite loop in others.
Does anyone have a cure? If I could just keep the godd*mn cursor at the end of the number, I could solve the thing with string manipulations. Any ideas?
I'd really appreciate your help.

Zpluug

Getting The Middle Digit
Help please !

i have 4 txtboxes and 1 cmdButton:

the first txtbox where the user input a minimum and maximum of 10 digits Ex: "1234567890" or "12345" or "123" or "1234567" and so on.

the second txtbox must get the middle digit in the 1st txtbox Ex: "1234567890" midDigit = "56" || "12345" midDigit="3" || "123" mid = "3"

the third txtbox must squared the midDigit in the 2nd txtbox Ex: 56 * 56 = 3136
|| 3 * 3 = 9

and the fourth txtbox must get the 1st digit of the squared number in the third txtbox Ex: "3136" = "3" || "9" = "9"

help me please !

What Datatype To Use For 12 Digit Number?
The subject basically speaks for itself, What datatype can I use to work with 12 digit numbers?

EDIT: I have tried a single which doesnt produce the overflow error, but when looping through the rows in my spreadsheet, looking for a matching 12 digit number I get the type mismatch errors. Any suggestions please.

Checking If It's A Letter Or A Digit
Hi all,

I was wonderring if in VB there is a function that checks if a string is a letter or a digit. Also is there a function which converts from lower case to upper case (and vise versa)

Thanks

Get The Permutation Of Of 4-Digit Number
Thanks for reading below scenario:

It's about generate / get the permutation of 4 digit number .Example:
user will input 4-digit number at a text box, assume use input---> 1116
and there's command button, when you click on it, it will find the permutatiion of 1116 and display it at a label--> 1116 1161 1611 6111



Thank's for any help

Yep, Another 60 Digit Calculator Question
Thanks to anyone who's helped me out so far, but I require more help here, if it not too much trouble.

For those who don't know:
My calculator adds or subtracts a 60 digit number, 60 digits is too big to simply just add the numbers together, so the 60 digits are split into 6 boxes. Each box contains 10 digits. So split one number into 6 boxes of 10 digits and then the same with the other, add them together and bob's your uncle. The calc looks like this:

.............................................................. <-- main entry text box (for the 60 digits)

1st number goes here:
|1234567890|1234567890|1234567890|1234567890|1234567890|1234567890|

2nd number goes here:
|1234567890|1234567890|1234567890|1234567890|1234567890|1234567890|

.............................................................. <-- answer goes here

Right, I have the addition sorted. With all the carrying of numbers sorted. except the problem with zeros. if 0000000000 is in one box and 1 is in the next box, when I click add, the zeros are ignored. So 10000000000 + 10000000000 would come out as 2. So how can i get the calculator to keep the zeros?


Second problem is subtraction - I haven't really got a clue so any help would be appreciated.

Thanks

Another Problem With 60 Digit Calculator
Hi, thanks to anyone who helped me for my original post for help with building a calc that can handle 60 digits.
If you look again at that topic, you can see what my calculator looks like.
Now I have another problem.
I have to get the 6 text boxes of 10 digits and place them into one text box. The problem is i cant just add them, I have to literally place them next to each other to look like on number

e.g.

|1234567890|1234567890|1234567890|1234567890| <-- Have to get these numbers

to look like this:
1234567890123456789012345678901234567890

Position Of A Digit In A Integer
I need to know how to tell the where a certain digit is in a integer. And if it is possible to check certain places in a integer for a specific digit?

How To Convert Digit In Words
is there any built in Function which can convert any Digit figure in to words
if not then please give any hint or example to make this function

Making Two Digit Numbers
Ok, I have a label, it has a number in it (currency amount) it has the format 00.00 dollar, and then cents. If, there are only 1 digit at the end of the number, I want it to add a 0 after the ., if it is a two digit number ending in 0, i want it to have the 0 behind it. Can i get some help please?
Viperchief

Random 29-Digit Number
Title explains it all. I just need to generate a random 29-Digit number and display it in text1.text.

Thanks

Extracting 20 Digit System ID
my girlfriend and i are working on a small app. we need to extract the 20 digit system ID number in windows.

Under systems properties in Windows we have a) system info, b) Who it is registered to and c) that 20 digit number. this is the one we need to get and place in a text box?? Is it possible to locate this then get it and place in a text box??

Thankyou for your help guys.

How To Check Duplicate Digit?
Dear all expert programmer,
I want to make project to check duplicate digit. Please see data below.

set1 = "0123-4506"
set2 = "1234-4506-8899"
set3 = "0123-1234-4506"

Summary data is "0123-4506-1234-4506-8899-0123-1234-4506"

After check duplicate in all set it will be show result below

Dup3 = "4506" (That mean it have number of 4506 = 3)
Dup2 = "0123-1234" (That mean have number of 0124 and 1234 = 2)
Dup1 = "8899" (That mean it have number of 8899 = 1)

Please tell me how to code it.

Thank you for all answer.

Vb - Character Or Digit Indentification
Hello I am lookiing for simple function within VB, which can indentify

wheater given parameter is

character ( like A,b,c ) etc
or
any digit ( 1,2,3.5 etcc)

I neeed that to trigger if else loop for both different case.


-Veda

Dont Show Last Digit
i have a file that shows location of mouse on click only is says if the location is 300 0 it says 3000 00 annny help?

Copyright 2005-08 www.BigResource.com, All rights reserved