PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

defining a path in Pocket C

NYIllustrator · 01 Sep 2001, 12:30 UTC
Ok in order to have a game play a wav file I need to define a path to it in Pocet C. But, I am very bad at how to define a path on the pocket pc because there is nothing like C:/folder...whatever. So lets say the wav file is in a folder called "game" and that folder is in "my documents" folder, what would the exact path be I need to put in?
\My Documents\game\whatever.wav

Remember that in C the backslash is the escape character used to indicate non-printing characters, thus you would have to use two backslashes together for it to map to a plain slash:

"\\My Documents\\game\\whatever.wav"

Dan East
NYIllustrator · 02 Sep 2001, 04:35 UTC
Ok I did exactly what you said and when I go to compile it I get this error message..."Error Message: lexical error. (Please make sure source code format is unicode.)" Anybody know what Im doing wrong?
Moose or Chuck · 02 Sep 2001, 07:50 UTC
It has to be in UNICODE. You can't define paths and stings inline like that. make it:
TEXT("\\My Documents\\game\\whatever.wav" )
instead of
"\\My Documents\\game\\whatever.wav"
I seem to remember being able to use forward slashes (/) and thinking to myself "hmmm...".  Perhaps I am a little confused.
Guys, he's using PocketC. I doubt it has problems with Unicode.

I think I would try the forums over at orbworks.com, davinci.
Opps.  

What's PocketC?  Just kidding.
How is Pocket C doing now?
NYIllustrator · 02 Sep 2001, 12:42 UTC
Well I tried posting in the orbworks forum and got no response i also tried putting "wave text(\\path....ect but got a syntax error when I did that, any other ideas? If not Im stuck and cant continue my game arrgghh!
Moose or Chuck · 02 Sep 2001, 13:17 UTC
Instead of the "TEXT()" idea, try just putting an "L" (no quotes) after the source code that's in quotes. I have no experience with PocketC (well, I do, but not really), but those are ways to make the code UNICODE.
Yeah, but Moose, here's my point: he's using a compiler on the platform it compiles for. Not a real binary, we're talking bytecode here. He shouldn't have to worry about Unicode. That's the whole point of PocketC, is that you don't have to mess with the Win32 API.
davinci, check this out instead. I looked over the WinCE docs portion of the orbworks site, and I think it might help you out.

http://pocketc.net/doc/default.asp?library_id=4&method_id=59#doc

The file will be opened as Unicode/ASCII, but that's transparent to your code. You just need to be able to deal with the stream, its format won't likely matter.

And for the love of God, now that I think about it, why would he need Unicode to access a path in his program? That's just bloody stupid. Unicode only applies to strings, not relative location.
NYIllustrator · 02 Sep 2001, 14:48 UTC
I tried it and it still gives me the same exact error message. All Im trying to do is get a button to play a wav sound when pendown on it. Surley someone knows the exact code Im supposed to be putting in as this is a simple operation, unless the code Im using now is the right code and its giving me this error message for no good reason. I cant believe no one on the orbworks board has responded all these programmers on that board and none know how to make a button play a sound when clicked?
What is the exact syntax you are trying to use? The wave "myfile" example you gave is not valid C syntax, if wave is a function (wave("myfile" )  is correct) .

Dan East
Moose or Chuck · 02 Sep 2001, 20:37 UTC
He's using PocketC, not C