Problems with Desktop Programmer


Licensed User
Hi all,

I'm fairly new to B4PPC, working on my first app, and having a blast. My desktop programmer is giving me fits. I find that after running the program for awhile (30 minutes) I loose the ability to add a BREAK command from the toolbar. I instead have to add a #break# comment, which seems to work as a workaround. Also after a bit of use the copy/paste funtionality gets erratic, taking multiple attempts to copy/paste for it to work. (Doesn't happen outside this application).

I have been working through these limitations (I wasn't sure if it's my own environment causing problems or a buggy program). Well now I'm at a stand still: My program has ~750 code lines now and whenever I try to run in Debug, or compile, I get random error messages like the following:

Error compiling program.
Error description: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
Occurred on line: 697

- or -

Error description: Length cannot be less than zero.
Parameter name: length
Occurred on line: 696

In the first example, I have no parameter named 'startIndex'.
In the second example, the only 'length' I can find in my code is all the 'StrLength' keyword.

The program keeps adding the quotes seen in the last line in the examples above to the code during compile or debug run. Sometimes it'll add one, sometimes up to three quotes. The line number of the error is usually nothing more than a blank line with the quote that the program added! No matter how many lines of code I comment out I can't pin down the problem. The program keeps adding these quotes to the code then error'ing out at the line the quotes are added. I have spend a good deal of time looking for typos in my code, just in case the program isn't so thorough in checking syntax, but I can find no fault. I realize that doesn't mean there isn't any but I'd like to hear what others are experiencing with the programmer.

I'm hoping since this board is new and it seems like a lot of good information was lost that this is old news to some people.

Thanks in advance for any help.


B4X founder
Staff member
Licensed User
Longtime User
First about the #break#:
When you add a break point in normal mode (your program is not running), a #break# will appear at the break line.
When you run your program, the #break# will switch to a red line.
When you stop your prorgam the #break# will return.
This is the normal behaviour.

About the quotes:
There is a bug in the IDE, that will be fixed in version 5.00, that adds a single quote to the next line if the current line is missing a quote.
For example: Msgbox("slkdjflksf)
The bottom line is that you should check line above the error line and make sure that you don't miss any quote.


Licensed User
Hello Erel,

First, thank you for pointing out the problem with the quote. I can't tell you how many times I looked at the code and overlooked the missing quote. Note to self: stop working on program when you're tired ;)

Regarding the #break#, I may not have explained the problem well. I understand what you state in your message. I am stating that after continued use of the program I eventually lose the ability to add a break to a line via the toolbar. When I click the break icon the cursor will move to the right (jumping over code) with what looks like the same number of characters as #break#, however there is no break being added to the line. It's as if the break funtion is broken. What I stated was that to get around this problem I was manually entering a #break# at the front of the line. This works, however manually adding the break only maintains the break for one run, after which I have to re-add the break command time and again for each time I wish to run the program. Clearly there is something wrong with the ability to add a break via the toolbar.

Also, do you have any information as to why cut/paste works erratically in the IDE? I sometimes have to copy multiple times before a paste command places the clipboard data inside the program. I do not experience this problem outside Basic4ppc.

My WinXP/SP2 machine has on ocassion given me grief, too many years of service without an OS reload (thanks Microsoft). It may be part of the problem. I have already tried re-installing B4P too.

Kind regards,
Last edited: