In PUB and out PUB
nicolad76
Posts: 164
HEEEELPPP!!!!
It is driving me crazy!!!!
I have the following code
The output is confused, it seems like the strings are passed to the Text method incorrectly.
If I use below code, everything works:
What the difference could be from the interpreter point of view?
THANKSS!!!!!
It is driving me crazy!!!!
I have the following code
PUB Main '' Start main public method [noparse][[/noparse]some code] DisplayMenu '' End main Public method PUB DisplayMenu '' Start Menu eink.Text(179, 35,string("DISPLAY"),72) eink.Text(179,155,string("VIEW GPS INFO"),72) eink.Text(179,275,string("SETTINGS"),72) eink.Text(179,395,string("DEMO"),72) eink.Draw '' END Menu
The output is confused, it seems like the strings are passed to the Text method incorrectly.
If I use below code, everything works:
PUB Main '' Start main public method [noparse][[/noparse]some code] eink.Text(179, 35,string("DISPLAY"),72) eink.Text(179,155,string("VIEW GPS INFO"),72) eink.Text(179,275,string("SETTINGS"),72) eink.Text(179,395,string("DEMO"),72) eink.Draw '' End main Public method PUB DisplayMenu '' Start Menu '' END Menu
What the difference could be from the interpreter point of view?
THANKSS!!!!!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
[noparse]:([/noparse]((
PUB, PRI, OBJ, VAR, CON, DAT symbols should all start on column 0.
Code associated with those symbols should start on column 1+ (indented).
Code meant to be part of an "IF" and other statements should be indented.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The method "SplashScreen" works great.
Do you think I should look for the problem on the definition of "Text" method?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I am 1011, so be surprised!
Advertisement sponsored by dfletch:
Come and join us on the Propeller IRC channel for fast and easy help!
Channel: #propeller
Server: irc.freenode.net or freenode.net
If you don't want to bother installing an IRC client, use Mibbit. www.mibbit.com
The eink objects contains only the routines to send a bitmap to the display. Afterall, its driver accepts only bitmap.
Once completed it will be my pleasure to publish it...
I believe part of the problem is in that piece of code but I do not see problems there. It is also true that I am a beginner
"Like this" doesn't cut it, people need to see what you do have, not something like it, and if there's something wrong in that PUB Text method, it's probably something in one of the objects[noparse]/noparse methods, so what does that code look like ?
I can appreciate no one likes to post half finished code, but sometimes one just has to show it in order to get others interested enough to help. Of course, if it's too complex those who could help might not have the stamina to wade through what you have. The best approach there is to trim the code to a bare minimum to show what problem you're having.
That said, and as a matter of style, it probably looks a little better if you do indent it.
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Still some PropSTICK Kit bare PCBs left!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How does the interpreter habdle calls to PUB and PRI? I experienced different result if I use PRI StartMenu or PUB StartMenu
Thanks guys!!!
It sounds like something is writing to the wrong location(s) in Hub and corrupting your program.
·
Work your way through the code seeing what does work and what's anomalous. Eventually you'll find something which is wrong, then you have to back-track to find what's causing it.
Sometimes it's a good idea to put what code you have to one side and start again, building that code up incrementally while testing it at every stage, adding checks that writes to memory are in the right range, values are as expected, even a routine which compares Eeprom to Ram to show what data changed.
It's a long hard slog at times but part and parcel of being a programmer.
bdtext is string("text")
How does spin handle this? if·it·just save a byte of the bdtext address in body[noparse][[/noparse]0] then this will not work
As soon as I get home I'll try your suggestion....I should stop thinking like I am programmi in VB [noparse]:)[/noparse] [noparse]:)[/noparse] [noparse]:)[/noparse]
Thanks