Search:
Type: Posts; User: treddie
Search:
Search took 0.19 seconds.
-
Thanks everyone for your help. I am marking this thread as resolved.
-
True. I just added that as a mod to the original line. Personally, I don't think I would have any use for the second version, since the whole point is to leave the number alone at however many...
-
Hm...This seems to be much better. Forget everything else, just use:
xx = Int(Val(Str(x)))
For more user control over where the accuracy "trigger" point should lie:
xx =...
-
Great point. Much better solution.
Either from a text file that gets numerical data from an Adobe Illustrator file, or from textboxes that are protected from human errors by a checker...
-
-
Well, it ain't necessarily elegant, but I wrote this fault-tolerant Int() function, to address this vb issue:
'Fault tolerant Int():
Dim ResultFlag As Byte
Dim TempLoop As Integer
...
-
Lol!
I refuse to be approximated. "I am a man! Not a number!" -quote by #6, I believe.
-
Passel...I think your test pretty much sums it up. The bummer is that Microsoft would let that ambiguity slip through. So vb is is displaying a rounded version of what it is actually using...
-
System is Windows 7 Ultimate, 6.1.7600 Build 7600
The equation to get value (ue) is:
ue = (bx / vx)
It then goes into:
qx = (Int(ue)) + 1
-
Can anyone explain this? These values were taken from my Immediate window, and reflect what my program is doing ((ue) is a Double data type):
?ue
2
?str(ue)
2
?int(ue)
1
-
OK, finally got it to work. I have to say, I had tried something different with a large program, by putting the new function into its own module with the required variable declarations. The problem...
-
Yah, no go. In fact, it seems that I had to ReDim in the past, because declaring globally with, say, Public Xforms(10) as double, would itself cause the problem. Now, either way, no difference. So...
-
Thanks for the reply, tg!
I see your point, so I tried it and still the same problem. Scratching my head.
-
Hello.
I am having a hard time getting a function to accept an array passed to it, and returning values in another array to the procedure that called the function.
I believe I have the the...
-
LaVolpe is absolutely correct. What threw me was my inattention to exactly what I had done...By ignoring standard heirachy (or rather, vb's and most of the sane world :) ), I had let slip through an...
-
Thank you for the help on this guys. Just curious why, on my calculator, and the vb6 immediate window, I can make the values work.
In my case, I need to preserve the (-) values. But just now...
-
Hi all.
Does anyone know why this simple task will not work? When I try to do this simple operation:
Dim A as Double
Dim NewA as Double
Dim Abby as Double
A= -502.14
Abby = 0.5
-
That's in the vb help system, but it really doesn't say much more than suggest that On Error Goto 0 dumps the error number but leaves an enabled and functionless error handler in memory. If that...
-
When you say, "clear the error", what exactly does that mean. If I do:
ErrHandler:
Dim ErrNum as Byte
Dim a as Byte
a = Err.Number
On Error Goto 0
a = Err.Number
-
So there seem to be two things going on:
1. An error handling (object?) is created with On Error Goto and On Error Resume, which is dealt with through an error handler.
2. Once that error...
-
Had fun playing around with On Error Goto -1. Very useful for problems in the error handler itself. Which is kind of funny...An error in an error handler! Lol!
And the combination of On Error...
-
GAWD I hate undocumented features! Knowing that little gem now is...well...a Gem!
Thanks for all the great responses! I will report back after I have experimented with the suggestions.
-
Solved the problem, but not sure why it worked. I simply replaced both On Error Goto's with On Error Resume Next and the problem went away. Hmmmm.
-
OK, I THINK I get it...I have enabled an error handler that is not separated from the general code in the procedure, by an intervening Exit Sub line. So even though I have used an On Error Goto 0...
-
Thanks for your reply, DataMiser.
The error gets raised and the program stops execution.
Could it be due to having two On Error Goto's in the same procedure? The code shown in my OP, is...
-
Hello.
I am trying to figure out why something so simple is failing. The following code fails to jump to DimArray1 when a Subscript Out Of Range error is encountered. Not much of a jump, since...
-
Ahhh, OK. Got it. And makes perfect sense. I think that I never ran into those issues because I have always concantinated variables with text, never with literal numbers.
Thanks for the great...
-
Hehe...I spoke to soon...I left out the "#" before the NewFileNum variable. It works perfectly now, using Append Mode. Thanks for the tips everyone!
Yes, that's how I eventually did it.
...
-
Sorry for the long delay. Been very busy.
Excellent advice by everyone. Unfortunately, nothing worked. So although your advice is excellent, I believe the problem lies elsewhere. I think I...
-
Hi all.
I have run into an odd problem I have not seen before. I have the following code in my form_load procedure:
Open App.Path + "\" + "DebugFile.txt" For Output As #5
'Write...
-
Hold off...Sorry to bother you. The returned value 30777 IS correct. It's been a while since I worked on this program, but the short 199 lines of text is what came back when I printed out the...
-
I have tried that but get the same result..."30777".
Here is the text file:
-
Hi.
I have a section of code that is intended to split a text file's contents into separate lines that go into an array. Each line should then be easily read from the array:
ProjectText_str...
-
The REAL problem is that I need a function to do roots of complex numbers. I can't find one online, so I'll just write my own based on the rules of exponentiation.
-
OK, I found it. My order of operations was not taken into account. Negation occurs AFTER exponentiation. If (x) is (-), then x^(1/3) will fail. However, doing, say, -.5^(1/3) succeeds because the...
-
a = .45
b = 4.65
c = 4.35
d = -3.45
-
Hi doctrin13th. Thanks for replying.
The following line fails outright:
i_LeftBot = (Sqr((C ^ 3 / (27 * A ^ 3)) + (D ^ 2 / (4 * A ^ 2)) - (B ^ 2 * C ^ 2 / (108 * A ^ 4)) + (B ^ 3 * D /...
-
Hi,
I have a strange problem.
As an example, (x) = the results of a long equation and ends up = -5.22150298374801
In a given situation (but not always), if I try to calculate x ^ (1/3), I...
-
This is the best and simplest explanation I have seen for threading. There were a couple of close "thirds" out there..Not quite "Seconds".
Thanks jmc!
-
OK, I figured out the problems in my code. I will post the resultant demo program when I get some test code copied over and running. The problems were mostly major data-typing problems.
|
Click Here to Expand Forum to Full Width
|