Search:

Type: Posts; User: treddie

Page 1 of 12 1 2 3 4

Search: Search took 0.19 seconds.

  1. Re: Whaaaat?! Int(x) doing something weird.

    Thanks everyone for your help. I am marking this thread as resolved.
  2. Re: Whaaaat?! Int(x) doing something weird.

    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...
  3. Re: Whaaaat?! Int(x) doing something weird.

    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 =...
  4. Re: Whaaaat?! Int(x) doing something weird.

    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...
  5. Re: Whaaaat?! Int(x) doing something weird.

    Good point. Thanks!
  6. Re: Whaaaat?! Int(x) doing something weird.

    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
    ...
  7. Re: Whaaaat?! Int(x) doing something weird.

    Lol!
    I refuse to be approximated. "I am a man! Not a number!" -quote by #6, I believe.
  8. Re: Whaaaat?! Int(x) doing something weird.

    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...
  9. Re: Whaaaat?! Int(x) doing something weird.

    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
  10. [RESOLVED] Whaaaat?! Int(x) doing something weird.

    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
  11. Replies
    6
    Views
    634

    Re: Problem passing an array from a function

    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...
  12. Replies
    6
    Views
    634

    Re: Problem passing an array from a function

    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...
  13. Replies
    6
    Views
    634

    Re: Problem passing an array from a function

    Thanks for the reply, tg!

    I see your point, so I tried it and still the same problem. Scratching my head.
  14. Replies
    6
    Views
    634

    Problem passing an array from a function

    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...
  15. Replies
    21
    Views
    2,129

    Re: Error 5 on Something so Simple

    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...
  16. Replies
    21
    Views
    2,129

    Re: Error 5 on Something so Simple

    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...
  17. Replies
    21
    Views
    2,129

    Error 5 on Something so Simple

    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
  18. Replies
    20
    Views
    5,141

    Re: On Error Goto Fails

    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...
  19. Replies
    20
    Views
    5,141

    Re: On Error Goto Fails

    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
  20. Replies
    20
    Views
    5,141

    Re: On Error Goto Fails

    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...
  21. Replies
    20
    Views
    5,141

    Re: On Error Goto Fails

    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...
  22. Replies
    20
    Views
    5,141

    Re: On Error Goto Fails

    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.
  23. Replies
    20
    Views
    5,141

    Re: On Error Goto Fails

    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.
  24. Replies
    20
    Views
    5,141

    Re: On Error Goto Fails

    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...
  25. Replies
    20
    Views
    5,141

    Re: On Error Goto Fails

    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...
  26. Replies
    20
    Views
    5,141

    On Error Goto Fails

    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...
  27. Replies
    9
    Views
    1,360

    Re: Open Statement's Port Keeps Closing

    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...
  28. Replies
    9
    Views
    1,360

    Re: Open Statement's Port Keeps Closing

    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.
    ...
  29. Replies
    9
    Views
    1,360

    Re: Open Statement's Port Keeps Closing

    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...
  30. Replies
    9
    Views
    1,360

    Open Statement's Port Keeps Closing

    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...
  31. Re: Split Function Gives Weird Results Sometimes

    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...
  32. Re: Split Function Gives Weird Results Sometimes

    I have tried that but get the same result..."30777".

    Here is the text file:
  33. Split Function Gives Weird Results Sometimes

    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...
  34. Replies
    7
    Views
    817

    Re: Inconsistent? Runtime Error 5

    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.
  35. Replies
    7
    Views
    817

    Re: Inconsistent? Runtime Error 5

    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...
  36. Replies
    7
    Views
    817

    Re: Inconsistent? Runtime Error 5

    a = .45
    b = 4.65
    c = 4.35
    d = -3.45
  37. Replies
    7
    Views
    817

    Re: Inconsistent? Runtime Error 5

    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 /...
  38. Replies
    7
    Views
    817

    Inconsistent? Runtime Error 5

    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...
  39. Replies
    38
    Views
    107,333

    Re: Accessing Controls from Worker Threads

    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!
  40. Replies
    6
    Views
    3,901

    Re: FindFirstFileEx and Unicode

    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.
Results 1 to 40 of 449
Page 1 of 12 1 2 3 4



Click Here to Expand Forum to Full Width