View previous topic :: View next topic |
Author |
Message |
teccs
Joined: 14 Oct 2006 Posts: 69
|
Posted: Mon Mar 14, 2016 7:20 am Post subject: USING PRINT#1 in a SELECT CASE |
|
|
This code won't work:
SUB ParseCommand(CommandReceived AS BYTE)
ReceivedSomething = 0
IF CommandReceived = 13 THEN
SELECT CASE ToolStatus
CASE IS < 13 :
PRINT #1, CommandReceived
END SELECT
END IF
END SUB
If I use PRINT CommandReceived instead of PRINT#1, CommandReceived it will work.
Why can't I use PRINT #1 in a SELECT CASE setup?
(BASCOM-AVR version : 2.0.7.8 ) |
|
Back to top |
|
|
six1
Joined: 27 Feb 2009 Posts: 553
|
Posted: Mon Mar 14, 2016 9:20 am Post subject: |
|
|
Hi,
pls show us your declaration of Channel #1
best, michael _________________ For technical reasons, the signature is on the back of this message. |
|
Back to top |
|
|
teccs
Joined: 14 Oct 2006 Posts: 69
|
Posted: Mon Mar 14, 2016 4:33 pm Post subject: My declaration of Serial #1 |
|
|
Config Serialin1 = Buffered, Size = 254
Config Serialout1 = Buffered, Size = 254 |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Mon Mar 14, 2016 4:36 pm Post subject: |
|
|
you post just a fragment, how can we help with this?
you have to show a small as possible piece of code that will demo the problem BUT that we can compile. _________________ Mark |
|
Back to top |
|
|
teccs
Joined: 14 Oct 2006 Posts: 69
|
Posted: Mon Mar 14, 2016 4:41 pm Post subject: Error when I try to post my code |
|
|
Hi Albert,
I get an error of 403 forbidden when I try to post all the code. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Mon Mar 14, 2016 4:46 pm Post subject: |
|
|
please send it to support so Tomi can check it.
our new server has new software and in order to prevent sql injection there is a lot that can not be posted.
you can however always post a ZIP file. _________________ Mark |
|
Back to top |
|
|
teccs
Joined: 14 Oct 2006 Posts: 69
|
Posted: Mon Mar 14, 2016 4:48 pm Post subject: Code attached |
|
|
My Problem has changed. I had no open statement for the comm port.
I added the Open statement.
Now, I get an error with the bytematch of 27.
I really appreciate the assistance. |
|
Back to top |
|
|
teccs
Joined: 14 Oct 2006 Posts: 69
|
Posted: Mon Mar 14, 2016 4:56 pm Post subject: Typo |
|
|
I found a type on the word bytematch. Now, am getting duplicate label errors. |
|
Back to top |
|
|
teccs
Joined: 14 Oct 2006 Posts: 69
|
Posted: Mon Mar 14, 2016 5:12 pm Post subject: Duplicate label error |
|
|
When I remove #1 from the Print Statement in Sub ParseCommand the code compiles.
Also had to change the name of the timer interrupt service routine. Now it is Timer1_isra:
Not sure why the a is required. |
|
Back to top |
|
|
teccs
Joined: 14 Oct 2006 Posts: 69
|
Posted: Mon Mar 14, 2016 5:13 pm Post subject: Print #2, not Print #1 |
|
|
Got that one figured out. So, lastly is why does the ISR have to have an "a" at the end of the ISR name? |
|
Back to top |
|
|
teccs
Joined: 14 Oct 2006 Posts: 69
|
Posted: Mon Mar 14, 2016 5:16 pm Post subject: Newest Code |
|
|
Attached is the latest. It complies. Your original request for the declaration of Channel #1 was very helpful. That got me on the right track.
Thank you. |
|
Back to top |
|
|
six1
Joined: 27 Feb 2009 Posts: 553
|
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Mon Mar 14, 2016 8:27 pm Post subject: |
|
|
Quote: | Got that one figured out. So, lastly is why does the ISR have to have an "a" at the end of the ISR name? |
Because in your code you have :
Timer1_isra: _________________ Mark |
|
Back to top |
|
|
teccs
Joined: 14 Oct 2006 Posts: 69
|
Posted: Mon Mar 14, 2016 9:12 pm Post subject: Thank you |
|
|
Another typo. They are the death of programmers. |
|
Back to top |
|
|
|