How to use Arrays Using Pic Basic Pro(need help)


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    MrSafe's Avatar
    MrSafe Guest


    Did you find this post helpful? Yes | No

    Default

    I still can not get the arrays to work. Look at my program to see what I am doing wrong I haven't tried the other suggestions yet but I will get started on those as soon as i figure out the arrays.
    Attached Files Attached Files

  2. #2
    MrSafe's Avatar
    MrSafe Guest


    Did you find this post helpful? Yes | No

    Default

    In the program when i do

    lcdout #key it shoots out the key correctly on the lcd however

    when i use

    htxt(x) = #key

    it says bad expression when i try to compile

    also when i use

    htxt(x) = key

    it works fine however it displays a blank spot on the lcd

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MrSafe View Post
    In the program when i do
    lcdout #key it shoots out the key correctly on the lcd however
    when i use
    htxt(x) = #key
    it says bad expression when i try to compile
    also when i use
    htxt(x) = key
    it works fine however it displays a blank spot on the lcd
    htxt(x) = key ------>>>>> lookup key , [ "0123456789ABCDEF" ] , htxt[x]
    ^get rid of^---------------^^^^^^ replace with ^^^^^^^^^^^

    Your turn to figure out why assigning the variable 'key' to htxt(x) and trying to get the LCD to display what is effectively variable 'key' doesn't work.
    What is the ASCII character equivalent to 'key', if 'key' = 1? if 'key' = 2? if 'key' = 65?
    Last edited by skimask; - 3rd July 2007 at 02:08.

  4. #4
    MrSafe's Avatar
    MrSafe Guest


    Did you find this post helpful? Yes | No

    Default

    i see ill try thank you for the reply. If you don't mind could you give me an example of that a very simple version of it that I could run with. Im sorry for being so ignorant but arrays is brand spanking new to me.


    Your turn to figure out why assigning the variable 'key' to htxt(x) and trying to get the LCD to display what is effectively variable 'key' doesn't work.
    What is the ASCII character equivalent to 'key', if 'key' = 1? if 'key' = 2? if 'key' = 65?
    I can do that quite effectively ahaha its this damn blasted arrays thats slowing me down I have entire codes already done for that portion its just that I want to be able to loop the message over and over but I need arrays to do that and the message is not predetermined it will be different depending on the user.
    Last edited by MrSafe; - 3rd July 2007 at 02:14.

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MrSafe View Post
    i see ill try thank you for the reply. If you don't mind could you give me an example of that a very simple version of it that I could run with. Im sorry for being so ignorant but arrays is brand spanking new to me.
    I just did...

  6. #6
    MrSafe's Avatar
    MrSafe Guest


    Did you find this post helpful? Yes | No

    Default

    thank you it didn't appear for me

  7. #7
    MrSafe's Avatar
    MrSafe Guest


    Did you find this post helpful? Yes | No

    Default

    The code below will compile all I did different from the code on the bottom is change the htxt[x] to x
    alpha1:
    gosub getkey
    LOOKUP key,[" ABCDEFGHIJ"],x
    htxt[x] = htxt[x] + 1
    RETURN

    alpha2:
    gosub getkey
    LOOKUP key,[" KLMNOPQRST"],htxt[X]
    htxt[x] = htxt[x] + 1
    RETURN
    The code above will not compile the compiler gives me the fallowing error

    "output parameter must be a variable"
    Attached Files Attached Files

Similar Threads

  1. Sending Commands from Visual Basic about IR to Pic
    By tne_de in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th April 2009, 06:09
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 18:05
  4. vb6 to pic basic
    By Darrenmac in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th December 2005, 01:56
  5. The Ultimate PIC Basic
    By picnaut in forum PBP Wish List
    Replies: 4
    Last Post: - 9th November 2004, 22:10

Members who have read this thread : 2

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