SX/B - Using LOAD
![John Kauffman](https://forums.parallax.com/uploads/userpics/555/nZBNEPT0B6FMD.jpg)
The help on the LOAD directive does not include an example so I have some usage questions.
·
I start with the following constant declarations within a file named Serial_LCD_Template.sxb. The program runs fine.
>>>>>·
' Constants for Serial LCD #27976/7
LcdRt·········· CON···· $09············ ······ ' move cursor right
LcdCR·········· CON···· $0D············ ··· ' move pos 0 of next line
LcdBLon········ CON···· $11············ ··· ' backlight on
·
·
So I change the code to following:
>>>>>·
' Constants for Serial LCD #27976/7
LcdRt·········· CON···· $09············ ······ ' move cursor right
'· LcdCR·········· CON···· $0D············ · ' move pos 0 of next line
LOAD "lcdcr.sxb"
LcdBLon········ CON···· $11············ ··· ' backlight on
·
And I create in the same folder a file named lcdcr.sxb with one line as follows:
LcdCR·········· CON···· $0D············ ··· ' move pos 0 of next line
·
When I run the file doing the loading it switches to the file to be loaded, highlights the one line in yellow and says no "Program" command used.
·
I tried adding to the top of the file to load "PROGRAM" and "PROGRAM START" but no luck.
·
Any suggestions?
Does anyone have a working example using LOAD?
·
Thanks.
·
I start with the following constant declarations within a file named Serial_LCD_Template.sxb. The program runs fine.
>>>>>·
' Constants for Serial LCD #27976/7
LcdRt·········· CON···· $09············ ······ ' move cursor right
LcdCR·········· CON···· $0D············ ··· ' move pos 0 of next line
LcdBLon········ CON···· $11············ ··· ' backlight on
·
·
So I change the code to following:
>>>>>·
' Constants for Serial LCD #27976/7
LcdRt·········· CON···· $09············ ······ ' move cursor right
'· LcdCR·········· CON···· $0D············ · ' move pos 0 of next line
LOAD "lcdcr.sxb"
LcdBLon········ CON···· $11············ ··· ' backlight on
·
And I create in the same folder a file named lcdcr.sxb with one line as follows:
LcdCR·········· CON···· $0D············ ··· ' move pos 0 of next line
·
When I run the file doing the loading it switches to the file to be loaded, highlights the one line in yellow and says no "Program" command used.
·
I tried adding to the top of the file to load "PROGRAM" and "PROGRAM START" but no luck.
·
Any suggestions?
Does anyone have a working example using LOAD?
·
Thanks.
Comments
Take a look at this post by Jon Williams:
http://forums.parallax.com/showthread.php?p=699975
Open the file DS1621.SXB and look for the ' Subroutine / Function Declarations' and 'Subroutine / Function Code' here will be an example of using LOAD
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
The PROGRAM command must be used before the end of any LOAD file.
So either the first LOAD file must use the PROGRAM command, or the main program must use the PROGRAM command.
This will be corrected in the next release.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·