Variable Problems for Cread


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013
    Posts
    12

    Default Variable Problems for Cread

    Hello,
    I'm trying to access memory locations with labels CData for ASCII characters, I am using a graphic display that does not have libraries, and it has no built-in memory characters, for both I and I have to do for now with the method I am using I have not succeeded in compiling it gives me error. Have if I can help.
    What I try to do is when I have to put a word in the display for example "Hello" this word is separated by Letters and each letter H, O, L, A has its ascii code in hexadecimal:
    "H"= $7F,$08,$08,$08,$7F,$00
    "O"=$3E,$41,$41,$41,$3E,$00

    and so on ... then go to the putting them on display in their X and Y coordinates.

    When compiling I get an error on Line 10 the variable "InDexMemoria" and not to do or convert.
    What I want is to concatenate the variable ("ASCI_") + the number of the Letter Ascii and quedase so "ASCI_72", this works butwhen compiling the variable "InDexMemoria" that goes before CData fails.

    Thanks......

    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''
    '''Code
    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''
    00 Dim X as Byte
    01 Dim InDexMemoria As String * 8
    02 Dim PosMemoria As String * 8
    03 Dim Word1 As Word
    04 Dim Temp As Byte

    05 Word1 = "H"


    06 Ini:

    07 PosMemoria = "ASCI_" ' Part of the Label for CData
    08 InDexMemoria = PosMemoria + Str$(Dec Word1 ) ' Concatenating Label + the number in ascii

    ' The variable "InDexMemoria = "ASCI_72"

    09 For X = 0 To 5
    10 Temp = CRead InDexMemoria + X '>>>>> At Compile fails me here <<<< for the Variable "InDexMemoria"
    11 DelayMS 5000
    12 Next X


    13 GoTo Ini

    14 ASCI_65:
    15 CData $7E,$11,$11,$11,$7E,$00 '65 - A
    16 ASCI_72:-
    17 CData $7F,$08,$08,$08,$7F,$00 '72 - H
    18 ASCI_76:-
    19 CData $7F,$40,$40,$40,$40,$00 '76 - L
    20 ASCI_79:-
    21 CData $3E,$41,$41,$41,$3E,$00 '79 - O

    ''
    ''
    ''
    ''
    ''
    '' ........All ASCII Code

    22 End

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Variable Problems for Cread

    This code is not PBP. Looks like some other syntax.
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. Assigning a string variable to another string variable
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd June 2013, 17:55
  2. variable problems
    By DmitriK in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th June 2008, 21:19
  3. One variable made up of another variable
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 1st September 2007, 00:18
  4. Problems with variable - Advise welcome
    By tracking in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th June 2005, 18:40
  5. 2k barrier variable problems
    By khufumen in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 20th December 2004, 23:35

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