When I use the example code to define a string in my program,
I get the errormessages :
ASM: compiled.asm:248:Error [113] Symbol not previously defined (PCLATH).
ASM: compiled.asm:300:Error [113] Symbol not previously defined (IRP).
ASM: compiled.asm:302:Error [113] Symbol not previously defined (IRP).
ASM: compiled.asm:311:Error [113] Symbol not previously defined (IRP).
ASM: compiled.asm:313:Error [113] Symbol not previously defined (IRP).
PIC is the 16C57, compiler lastest update
What is the correct way to define several strings, or one string
with about 40 characters ?
regards,
Reelf
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The lower end PICs like the 16C57 don't work properly with the string routines in GCBASIC. I did fix the problem which was causing those messages, but GCBASIC will not be able to handle string constants on the 16C57 as the SysReadString subroutine isn't able to call the table used to hold the string in the program memory.
The correct way to define a string is:
Dim SomeString As String
This will create a string of 20 characters on chips with less than 368 bytes of RAM, and 40 characters on chips with more. To override the default size, you can set the StringSize constant like this:
#define StringSize 40
Or add the length to the Dim command like this:
Dim SomeString As String * 40
Either of these methods will create a string of 40 characters.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I use the example code to define a string in my program,
I get the errormessages :
ASM: compiled.asm:248:Error [113] Symbol not previously defined (PCLATH).
ASM: compiled.asm:300:Error [113] Symbol not previously defined (IRP).
ASM: compiled.asm:302:Error [113] Symbol not previously defined (IRP).
ASM: compiled.asm:311:Error [113] Symbol not previously defined (IRP).
ASM: compiled.asm:313:Error [113] Symbol not previously defined (IRP).
PIC is the 16C57, compiler lastest update
What is the correct way to define several strings, or one string
with about 40 characters ?
regards,
Reelf
The lower end PICs like the 16C57 don't work properly with the string routines in GCBASIC. I did fix the problem which was causing those messages, but GCBASIC will not be able to handle string constants on the 16C57 as the SysReadString subroutine isn't able to call the table used to hold the string in the program memory.
The correct way to define a string is:
Dim SomeString As String
This will create a string of 20 characters on chips with less than 368 bytes of RAM, and 40 characters on chips with more. To override the default size, you can set the StringSize constant like this:
#define StringSize 40
Or add the length to the Dim command like this:
Dim SomeString As String * 40
Either of these methods will create a string of 40 characters.