I have set myself the task of creating a calculator (similar to the Windows calculator - but more alike the calculator found on the default Mac dashboard), and have come across my first serious problem.
My problem begins with this piece of code:
Expand|Select|Wrap|Line Numbers
- DIM result as string
- DIM firstdoub as double
- DIM current as double
- DIM firststr as string
- DIM digstr as string
- result = firstdoub + current
- TextBox4.Text = result
- firststr = result
- digstr = result
Expand|Select|Wrap|Line Numbers
- Dim dig1 As String
- Dim dig2 As String
- Dim dig3 As String
- Dim dig4 As String
- Dim dig5 As String
My problem:
Lets assume the following:
current = 12345
firstdoub = 12345
Thus:
result = "24690"
I want to split the result string up to satisfy the following (in this case of result):
dig1 = "2"
dig2 = "4"
dig3 = "6"
dig4 = "9"
dig5 = "0"
result will be different each time so I can't simply assign a value to it.
If someone could explain how I should even approach this step I'd appreciate it, and if someone were to offer me example code, I'd appreciate that even more so.
Any help is greatly appreciated.
Thanks for your time.