very basic question


Closed Thread
Results 1 to 8 of 8
  1. #1
    scorpion's Avatar
    scorpion Guest

    Question very basic question

    if i have 2 arrays arrayone[7] and arraytwo[7]
    can I copy them all together:

    arraytwo = arrayone

    or do i have to do each part seperatly?

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    never test it but i really think you must copy item by item in a simple loop.

    for a=0 to 6
    arraytwo[a]=arrayone[a]
    next

    regards
    Last edited by mister_e; - 23rd November 2004 at 17:42.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    scorpion's Avatar
    scorpion Guest


    Did you find this post helpful? Yes | No

    Default

    thanks

  4. #4
    scorpion's Avatar
    scorpion Guest


    Did you find this post helpful? Yes | No

    Default

    can i do any manipulation with a whole array?

    if arrayone <> 0 then goto dealwithit

    ?

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i don't think we can do anything with an whole array. only with separate items... loop again

    regards
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    scorpion's Avatar
    scorpion Guest


    Did you find this post helpful? Yes | No

    Default 2nd question for today

    this might be a daily occurance... i think i might need my own forum for my questions.... scorpion's stupid subject of the day.

    anyways
    is it possible to do floating point math ie. #### / 10.24
    or should i shift the #s over divide and then move back?

  7. #7
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Scorpion

    S>>is it possible to do floating point math ie. #### / 10.24
    or should i shift the #s over divide and then move back?<<

    yes, you can do Floats.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  8. #8
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    Hi Scorpion,

    You can do floats, it's described on Melabs page. However, there's a different way, calculations with fractions. This is done with the "*/" or "**" operators. Tracey Allen has done a good job of describing theese(and a lot more) on his site http://www.emesys.com/BS2math1.htm .

    The "*/" operator does an "invisible" division by 256.
    The "**" operator does an "invisible" division by 65536.

    Lets say you want to calculate Y=X/10.24 ......

    X VAR WORD
    Y VAR WORD

    Y = X */ 25

    This would be the same as doing X*25/256 on your calculator. 25/256 is equal to 1/10.24.

    /Ingvar

Similar Threads

  1. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  2. very basic matrix keypad question
    By kitcat in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th July 2006, 21:33
  3. Visual Basic 6 question
    By Christopher4187 in forum Off Topic
    Replies: 5
    Last Post: - 3rd July 2006, 13:06
  4. Experimenting With Pic Basic Pro Question
    By jabahunter in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 28th May 2005, 08:16
  5. Basic Question about PICBASIC
    By zonkwilliams in forum General
    Replies: 1
    Last Post: - 10th March 2005, 21:55

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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