Storing Strings using the Write command


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Location
    UK-Midlands
    Posts
    84

    Default Storing Strings using the Write command

    Hi All,
    I wanted to use a variable to point to the eeprom address using the WRITE command, but it generates an error. After searching for a solution last night I keep comming back to my original (clumsy) solution!

    I want to be able to do this:

    FOR T1= 10 to 23
    messline[T1]=phone1[T1]
    WRITE T1,phone[T1]
    NEXT

    But I can only get this to work:
    FOR T1= 10 to 23
    messline[T1]=phone1[T1]
    NEXT
    write 10,phone1[0]
    write 11,phone1[1]
    write 12,phone1[2]
    write 13,phone1[3]
    write 14,phone1[4]
    write 15,phone1[5]
    write 16,phone1[6]
    write 17,phone1[7]
    write 18,phone1[8]
    write 19,phone1[9]
    write 20,phone1[10]
    write 21,phone1[11]
    write 22,phone1[12]

    Is there a 'neater' solution.

    Thanks,
    Bob

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    Did you find this post helpful? Yes | No

    Default

    May be something like this?

    FOR T1= 10 to 23
    messline[T1]=phone1[T1]
    write T1,phone1[10-T1]
    NEXT

    Ioannis

  3. #3
    Join Date
    Mar 2004
    Location
    UK-Midlands
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Many thanks, Couldn't see it. Must of been past my bedtime last night!!!

    Thanks,
    Bob

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  2. WRITE: One more PBP 2.60 Surprise ...
    By Acetronics2 in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 26th August 2009, 09:10
  3. Please help with storing strings in codespace
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th May 2008, 01:02
  4. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34
  5. Can I do this???
    By noobie in forum mel PIC BASIC
    Replies: 2
    Last Post: - 10th June 2006, 18:57

Members who have read this thread : 1

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