Is this legal?


Closed Thread
Results 1 to 3 of 3

Thread: Is this legal?

  1. #1
    BertMan's Avatar
    BertMan Guest

    Default Is this legal?

    Can I use nested brackets like this:

    ShiftIn FPU_DATAIN, FPU_SCLK, MSBPRE [FloatByte[0], FloatByte[1]_
    FloatByte[2], FloatByte[3]]

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default Sure it's Legal

    There's nothing that says you can't use array variables in the SHIFTIN/OUT command. As with everything, try it and see.

    What you can do (a little secret you may not know about) is that you can use normal brackets () around your array variables rather than square ones to distinguish them from the square brackets in the SHIFTIN Command... like so...
    Code:
    ShiftIn FPU_DATAIN, FPU_SCLK, MSBPRE, [FloatByte(0), FloatByte(1), FloatByte(2), FloatByte(3)]
    By the way, your example had a comma missing after MSBPRE and another after FloatByte[1] either of which whould have cause a compilation failure.

  3. #3
    BertMan's Avatar
    BertMan Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Melaine. I couldnt find an example that used arrays with the shift commands. Btw, sweet tip on the (). That makes it a little easier to read.

    The code was something I typed up real fast, and not the actual code. This explains the bad formatting

Similar Threads

  1. DT-INTs What's legal in an INT handler?
    By circuitpro in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 29th January 2010, 18:43
  2. Circuit Maker 2000 "Pro ED" - Up For Grabs!
    By T.Jackson in forum Adverts
    Replies: 12
    Last Post: - 6th November 2007, 11:51
  3. Not so legal copies of PBP
    By skimask in forum Off Topic
    Replies: 6
    Last Post: - 30th December 2006, 02:44
  4. Poor relative in Africa
    By websmith in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 15th December 2006, 06:52

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