Results 1 to 11 of 11

Thread: Do really long calculations cause problems? what am i doing wrong?[resolved]

Threaded View

  1. #1

    Thread Starter
    Lively Member MET777's Avatar
    Join Date
    Apr 2005
    Posts
    76

    Resolved Do really long calculations cause problems? what am i doing wrong?[resolved]

    heres my code for saving some info to an array
    VB Code:
    1. For h = 0 To Shp.ubound
    2.     For i = 0 To Shp.ubound
    3.             gravforcex(h, i) = (Shp(h).Left - Shp(i).Left) * (((Sqr(Sqr((Shp(h).Left - Shp(i).Left) ^ 2 + (Shp(h).Top - Shp(i).Top) ^ 2))) ^ -1 * 500) / (Sqr((Shp(h).Left - Shp(i).Left) ^ 2 + (Shp(h).Top - Shp(i).Top) ^ 2)))
    4.             gravforcey(h, i) = (Shp(h).Top - Shp(i).Top) * (((Sqr(Sqr((Shp(h).Left - Shp(i).Left) ^ 2 + (Shp(h).Top - Shp(i).Top) ^ 2))) ^ -1 * 500) / (Sqr((Shp(h).Left - Shp(i).Left) ^ 2 + (Shp(h).Top - Shp(i).Top) ^ 2)))
    5.     Next i
    6. Next h

    on the gravforcex(h,i) = blah line... it gives me an invalid procedure call or argument error.
    shp is a shape control array, and its set up correctly... ive tested the top and left properties in other ways and they are working.
    if u have any input itd be greatly appreciated
    Last edited by MET777; Dec 30th, 2005 at 04:00 PM.
    --Matt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width