Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - check for key entered
Page 1 of 1

check for key entered

PostPosted: Thu Jan 17, 2008 4:21 am
by arcstrait
Hi. I have been having trouble finding some way to locate a "\b" action. I'm asking especially how to check for simple backspace/delete. Neither "\b" nor '\b' have been working out, so we have used "\n" here in this sample semi-functional program. . .

First I'm checking char input.



Ok, I put this together in PocketC Desktop Edition just to make sure it compiles, but anything below the "@" marks can be used.


[[[[[--CUT--]]]]]]
@cid "YOUR";
@name "Key Dummy";
@dbname "kdummy";
@ver ".01";


int counter;
int acculen;

string accutemp;
string accu;

char cheque;

erase(){

acculen=(strlen(accu));
accutemp=strleft(accu,acculen-1);
accu=accutemp;

graph_on();
clearg();
text(5,55,accu);

} // end erase

main(){

graph_on();
clearg();

while (1) {
cheque = "";
cheque = wait();

if (cheque!="\n") {accu=accu+cheque;}
else {erase();}

text(5,15,accu);

} //end while

} //end Main

[[[[[===CUT===]]]]]
. . .

Simple but troubling. Then what if I want its ascii value? That would be
char(x), right? How would I go about writing a program to tell me what any particular char(x) entry refer to in ASCII?

Thanks.

Re: check for key entered

PostPosted: Thu Jan 17, 2008 5:54 am
by dewey
PocketC doesn't support the \b escape code. Instead, you can use \x08.

Re: check for key entered

PostPosted: Thu Jan 17, 2008 1:08 pm
by arcstrait
dewey wrote:PocketC doesn't support the \b escape code. Instead, you can use \x08.



Dewey, Thanks :shock: Can you refer me to a list of such codes? :mrgreen:

Re: check for key entered

PostPosted: Thu Jan 17, 2008 5:14 pm
by dewey
The full list is at the bottom of the PocketC Language docs (Language-full.html).

Re: check for key entered

PostPosted: Sat Oct 04, 2008 2:01 pm
by palmosm130
Hi... I was looking to get this info also, but it's no longer there.

Re: check for key entered

PostPosted: Sat Oct 04, 2008 10:23 pm
by samps
They are at the end of the 'language' bit, just before the list of built-in functions. Look for 'Escape sequence'

Samps

Re: check for key entered

PostPosted: Mon Oct 06, 2008 7:06 am
by palmosm130
Ah... I thought there would be more than what my book has provided having seen quite a number of source codes.

Special characters
There are two ways to add special characters to a string. The first is by appending them by number, such as:

str = "Here is a neat little square: " + (char)149;The other method is through using escape sequences. The following escape sequences are supported:

Escape sequence \\ \' \" \n \t \x
Interpretation \ ' " newline tab character specified by the following two hex digits. Example: '\x95' is the block character (decimal 149)

So, to create a string that contains a quote:

str = "She said \"I'm sorry,\" but it was too late...";
puts(str); // Prints: She said "I'm sorry," but it was too late...


Thank you