Page 1 of 1

PostPosted: Thu Jan 10, 2002 3:26 am
by croane
I am following a tutorial but after typing in the program I get the message "unkown data type". Keep in mind I am very new to this. Here is the beginning program
string name;
name = gets ("Enter your name);
puts("Hello ");

The problem is on line 2 of this program. Why is this happening. Is the tutorial wrong?

Any help would be appreciated.

Clinton Roane

PostPosted: Thu Jan 10, 2002 4:59 am
by ggravier
Actually, you have it mostly wrong...

1) <b>//main()</b> is not correct. <b>main</b> is the name of the main function. It is not a comment.

2) <b>showconsole</b> is not a <i>PocketC</i> function.

3) I've updated the <b>puts</b> line to take advantage of <i>PocketC</i> syntax.

The result is:
<font face=Courier New>
// Test
string name;
name = gets ("Enter your name");
alert("Hello "+name);
</font id=Courier New>

<b>alert</b> outputs a string in a pop-up, whereas <b>puts</b> outputs it in the console output area... not as nice looking. And <i>PocketC</i> does nice string operations... to make it easy.


-- Gilles Gravier = = --
PGP Key ID: 0x8DE6D026 ICQ: 77488526
"Chastity is its own punishment." (Solomon Short) [David Gerrold]

PostPosted: Thu Jan 10, 2002 3:19 pm
by wolfgang

showconsole IS a PocketC command. But one from the WindowsCE version, not the Palm version. I assume croane is going through the tutorial on my webpage, and this was written for the WindowsCE version. I have, hoewever, also posted a page there about what has to change to make it usable for the Palm version.