Posted: 24th Jun 2007 7:18
This is just strange. I am getting an error on execution after adding the following function to an app.

+ Code Snippet
function _CW_DynamicUp(index)
UpItm$=Cmd(index).Label
UpItmVal$=Cmd(index).StrVal
UpItmComb$=UpItm$+" "+UpItmVal$
PanelList(0,index).PItemStr=UpItmComb$
endfunction


It works fine if I change the UpItmComb$ to the following...
+ Code Snippet
function _CW_DynamicUp(index)
UpItm$=Cmd(index).Label
UpItmVal$=Cmd(index).StrVal
UpItmComb$=UpItm$+UpItmVal$
PanelList(0,index).PItemStr=UpItmComb$
endfunction


Here is the error I get:
CodeWatch.exe has encountered a problem and needs to close. We are sorry for the inconvenience.

Detailed information Error Signature:
AppName: codewatch.exe AppVer: 1.0.0.0 ModName: compress.dll
ModVer: 1.0.1.2 Offset: 000026c9

Now what's even more strange is I am sure I have done this before, and not encountered issues. In fact I had something similar in another function.

I will try using an ASCII string for the space. But does anyone know whats up????

[EDIT]:
Well this works as well.
+ Code Snippet
function _CW_DynamicUp(index)
UpItm$=Cmd(index).Label
UpItmVal$=Cmd(index).StrVal
UpItmComb$=UpItm$+space$(1)+UpItmVal$
PanelList(0,index).PItemStr=UpItmComb$
endfunction


So I'll stick with that. But is there something wrong with adding a " " to a string? And if so, how com the compiler doesn't catch it?
Posted: 24th Jun 2007 7:38
Strange, I do that all the time with no errors. Try opening a blank project and just doing something like:
string1$ = "Hello"
string2$ = "Testing"
test$ = string1$ + " " + string2$

Does that give you a compile error? Must just be a bug, or some other part of your code is interfering with it for some reason.
Posted: 24th Jun 2007 8:22
ok Gil,
I created a new project and did the following without error.

+ Code Snippet
sync on
sync rate 0
mystring1$="hello"
mystring2$="world"
mystring3$=mystring1$+" "+mystring2$

do
text 200,200,mystring3$
sync
loop


@GIL, Can I email you the source, and see if you wind up with the same problem?

so now it must be something in my code that's doing it. What's strange is if I commnet out the function i posted everything works. If I comment out the one line everything works. If I use space$(1) it works and the output string is what I expected. And if I remove the +" "+ it works.

I'll try to figure out what is going on. But I'm not sure I get what could be happening. Right before the function call, i call two other functions that update the data. I'll try cutting and pasting the code into a new project.
Posted: 24th Jun 2007 8:38
This is messed up. I put the +" "+ back in and copied the source and pasted it into a blank project. And it works fine. So what the heck happened to my project. I should now mention that this was being worked on in CodeSurge. Not that it's to blame, but it's not like anything in the project seems corrupt at all.

The project is only one source file. It doesn't load any media or sprites. Just working with data and types. So what could possibly happen to a project like this, if the source copied "exactly as-is" works in a new blank project.
Posted: 24th Jun 2007 16:04
I don't know what the reason is, but this sounds very similar to a problem Scraggle reported a week or two ago on this board. You might have a quick look to see if there are clues there. The solution to his problem was the same, I think.
Posted: 24th Jun 2007 16:14
It might be some error further up the code confusing the debugger.

eg in C++ if i miss off a ; from the end of a line the debugger don't realise it's missing until it hits another line with " " in it and says there is an error there because it don't realise it's started a new line of code.
Posted: 26th Jun 2007 8:07
@GG thanks I'll take a look

@GatorHex, Just to clarify, the debugger/compiler isn't picking up the error at all. it compiled fine, and the error occured upon the running of the .exe

Also the source as is works perfectly normal, once I started a blank project, and posted the source AS-IS. I just can't seem to comprehend what possibley could happen to the project file the .DBpro that would cause this. I hope i won't have to copy the source into a blank porject every few hundred to a thousand lines of code. That could get irritating, and It scares me that something could happen. Needless to say I just ran 3 backups.
Posted: 26th Jun 2007 8:38
Sry for the DBL post, but TGC mentiod the word "GAME" alot, and defines it in the EULA's. Does this mean it would be against the EULA if i use the SDK to create and releas tools or game creator type software i am in violation???

That may nix it. I need to make sure!!!
Posted: 27th Jun 2007 0:59
it's a bug of the style of mystery ones...
I suspect that something related to string is badly handled by compiler ..
I encounter problems with string on FILE EXIST commands on a big project (more than 10000 lines).
If I use the FUNCTION that crash in a small program, I don't get the crash ...