BBC BASIC for Windows
IDE and Compiler >> Debugging >> Missing \ http://bb4w.conforums.com/index.cgi?board=debugging&action=display&num=1427763907 Missing \
Post by CharlesB on Mar 30th, 2015, 11:49pm
I have been learning how to use Windows Dialogue Boxes and having a grand time with it. But, when I compile I am getting a "Missing \" error.
I think that this is associated with the closing of a dialogue box - or the opening of a dialogue box; for it is at this part of my program when I get the error.
I only get it after compiling and I don't have a clue as to what I'm doing wrong. Might anyone have a suggestion as to help me debug this?
Thank you, Charles
Re: Missing \
Post by rtr2 on Mar 31st, 2015, 12:53am
I only get it after compiling and I don't have a clue as to what I'm doing wrong. Might anyone have a suggestion as to help me debug this?
It's impossible to say without seeing the code. List the section where you believe the error is occurring.
Richard. Re: Missing \
Post by CharlesB on Mar 31st, 2015, 1:46pm
Thank you. I think that the problems is as follows.
Below is a snip of the code. I realize that if one runs this in the interpreter, he/she might get errors. (This is due to my deleting some code so this snip can stand alone)
But, in the compiled example the program crashes before one sees the dialogue box.
At least here, one can see the dialogue box.
In the larger program I received a "Missing \ "error when compiled. In the compiled version of this smaller program I am receiving a "syntax error."
I don't think I quite understand how I am to copy code into this box, so here it is . . . cut and paste . . . and I apologize for how amateurish this may be.
This is a modification of the Example program of the dialogue box.
Charles
DEF PROC_AskForFeetOrPieces REM. Program to demonstrate a Dialogue Box INSTALL @lib$+"WINLIB2"
Re: Missing \
Post by DDRM on Mar 31st, 2015, 3:00pm
Hi Charles,
Actually, once I've corrected the smiley to :P ;-) it seems to work OK in the IDE, but stops with a "missing \" error once compiled.
I think the problem is that you have REMMED out a line, but it continues onto the next line, and the interpreter is foxed by finding the line continuation marker without a previous line to continue! If you REM out the continuation, it seems to work OK.
The fault seems to be in the REM line which starts PROC_dlgctrl(...
(You should also lose the DEFPROC at the beginning, and the ENDPROC at the end of your snippet, since it is no longer functioning as a procedure...)
Hope that helps (and is right, or Richard will be after me! :-) )
D
Re: Missing \
Post by rtr2 on Mar 31st, 2015, 3:24pm
Actually, once I've corrected the smiley to :P ;-)
I would request that everybody please takes the trouble to list code surrounded by [code] tags; it is after all one of the principal advantages of this forum over, for example, the Yahoo group.
Quote:
I think the problem is that you have REMMED out a line, but it continues onto the next line
That's one way of putting it. Everything following REM is ignored by the interpreter, which is why you can include keywords, accented characters etc. in a remark without them confusing BBC BASIC. But it follows that the line-continuation character \ is also ignored following REM, so you cannot 'continue' a REM on the following line. There's no cause to anyway, since you might as well start the next line with REM as with \.
I wonder if the OP is familiar with the Add REMs option in the right-click (or Shift+F10) context menu. That's the easiest way of 'commenting out' a block of code, and will avoid the problem so long as any continuation lines are included in the block to be REMmed.
Richard.
Re: Missing \
Post by CharlesB on Mar 31st, 2015, 6:01pm
Thank you all so very much. I will look into this right after work (am at lunch).
Sorry about not including the code tags. Frankly, even when Svein told me what to do, I did not understand him.
He said "
PS. Use the 'code' tags when posting code to avoid corruption of the code. In this case there is a smiley instead of PRINT. Which becomes 'tongueRINT' when pasted into the IDE. Hint: press the # button and put your code in between the 'code' and '/code' ."
I can understand hitting the # key and then the code, but do not know what he meant by 'code' and '/code."
Is there an example on the message board on how to post the code?