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
[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 - Field Quirks

Field Quirks

A PocketC native palm library offering native forms and assorted utilities

Postby awschwab on Mon Jan 28, 2002 2:08 pm

There are some quirks to the way PToolboxLib Fields accept text. Here is a small program that demonstrates what I mean, with a description in the comments.

<pre id=code><font face=courier size=2 id=code>//FieldQuirks.pc
// Demonstrates quirks of PToolboxLib Fields.
/*
Both text fields are set to 12 maximum characters. Graffitti text
entry is limited to 12 characters, alphanumeric in the text field,
and numeric alone in the numeric field. The point of this program is
to demonstrate that:
1) Text added by Fctl(INSERT,&string) is not limited to numeric in
the numeric field, but is limited by the field character maximum.
2) Text added by FsetText(Id, string) is not limited by numeric type,
nor by character maximum. The ability to add more text than was
allocated can be dangerous.

Conclusion: Fctl(INSERT, ... is safer than FsetText().
*/
library "PToolboxLib"
include "Fctl.h"

#define LTEXT 256
#define LNUM 257
#define FORM1 3000
#define FTEXT 3010
#define FNUM 3011
#define BINSERT 3020
#define BSET 3021
#define BQUIT 3022

main()
{
int higt, x, y = 40, width = 80, maxChar = 12;
int e, Id;
string crud = "abc123", stuff;

higt = FontHeight();

Form(FORM1, "Field Quirks");
Field(FTEXT, 1, 70, y, width, higt, maxChar, "");
Label(LTEXT, 5, y, "Text Field");
Field(FNUM, 0x1001, 70, y + higt, width, higt, maxChar, "");
Label(LNUM, 5, y + higt, "Numeric Field");

x = Button(BQUIT, 0, 0, 15, 0, 0, "Quit");
x = Button(BINSERT, 0, x, 15, 0, 0, "Insert");
Button(BSET, 0, x, 15, 0, 0, "Set Text");

Fctl(DRAW,FORM1);
Fctl(SETFOCUS,FTEXT);

while (BQUIT != (e = Fevent(1)))
{
if (e == BINSERT)
Fctl(INSERT, &crud);
else if (e == BSET)
{
Id = Fctl(GETFOCUS);
stuff = FgetText(Id);
FsetText(Id, stuff + "A3");
}
}
}
</font id=code></pre id=code>



Edited by - awschwab on 01/28/2002 09:05:39
awschwab
 
Posts: 270
Joined: Tue Feb 06, 2001 2:33 pm
Location: USA

Postby jstadolnik on Mon Jan 28, 2002 3:14 pm

I'll fix all these problems.

Thanks,

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby awschwab on Mon Jan 28, 2002 4:15 pm

It may actually be useful to retain the ability to put some alphanumeric characters into a numeric field in some circumstances. This allows negative numbers and scientific notation. One could imagine a field where the user can change the sign of a number by tapping a button, but would be allowed only to enter digits into the field.
awschwab
 
Posts: 270
Joined: Tue Feb 06, 2001 2:33 pm
Location: USA

Postby jstadolnik on Tue Jan 29, 2002 2:46 pm

I'll just fix the FsetText one then.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby awschwab on Tue Jan 29, 2002 5:36 pm

Would it be easy to make it possible to check whether a field is numeric at run time? This is not crucial; obviously one can just keep track of which field one is dealing with.
awschwab
 
Posts: 270
Joined: Tue Feb 06, 2001 2:33 pm
Location: USA

Postby jstadolnik on Wed Jan 30, 2002 3:41 am

It's possible, and it's not that much work, but at this point I'm inclined not to implement such a feature. As you pointed out the user really already has this information. If you have a compelling reason for having it, I'll reconsider it though.

I just overhauled the v7.1.7 Sort function. It like rocks! It has natural, caseless, and reverse sort options. It can handle any data type. It can sort data structures (blocks of array elements as opposed to individual elements) and can do up to 3 levels of sorting, and it's bloody fast. I also have a complete Handbase and Pilot-DB database interface implemented (but that will be out in 7.2 due to the documentation complexity). Version 7.1.7 should be out in a few days.

Joe



The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby awschwab on Wed Jan 30, 2002 5:34 pm

Cool!
awschwab
 
Posts: 270
Joined: Tue Feb 06, 2001 2:33 pm
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest

cron