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

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 - Truncating strings in PDB

Truncating strings in PDB

Discuss OrbForms Designer and PocketC Architect

Postby jobie on Thu Mar 01, 2007 3:08 pm

Hi,

I'm running into an issue where I'm writing a structure to a PDB file, but some of the strings are getting cut short. It seems to be almost random. Here's the code:

Code: Select all
   if ( db.open( "scsr", false ) )
   {
      if ( db.getrec(RecordFound, dbr, false) )
      {
         dbr.write( &TempSCSR, typeof(TempSCSR), 1 );
         dbr.close();
         
         db.backup = true;
         db.close();
         alert( "Record saved." );
      }
   }


The structure I'm writing is this:

Code: Select all
struct inspection_scsr
{
   int      id;            
   string   Barcode;   
   string   Mine_ID;   
   string   Make_Model;      
   string   Serial_Number;   
   char   Location_Type;   
   string   Location_Desc;
   int      Emp_Or_Map_Num;   
   char   BarcodeChanged;
   char   ConfirmMake;   
   char   ConfirmSerial;   
   char   ConfirmLocation;
   string   Found_At;      
   char   Unit_Pass;      
   char   Seals_Intact;   
   char   Parts_Intact;   
   char   Gauges_OK;      
   char   Case_OK;      
   char   Shake_Test_OK;   
   char   Failure_Code;   
   string   Insp_Time;      
   string   Insp_Date;      
   string   Insp_Comments;   
   int      Inspector_Num;   
   string   Inspector_Sig;   
};


The field currently exhibiting the problem is <b>Found_At</b>. It seems very deterministic as to what text gets truncated. Our test strings were "Bobs place", "Moms place", and "jacks place". Mom gets only the "M", jack gets "jac", and Bob gets all of it.

Also, it seems that sometimes records won't be saved, i.e. I'm changing the content of a record. I'm thoroughly befuddled.

Any help you can provide would be greatly appreciated.

-John
jobie
 
Posts: 23
Joined: Wed Dec 27, 2006 8:53 pm
Location: USA

Postby FrankG on Thu Mar 01, 2007 4:29 pm

John,

Have you done alerts to display the Found_At value before and after the dbr.write? I've intermixed strings, ints, and bools in structures with no problem. The only question I wonder about is whether I use chars very often. I rarely overwrite records though. I delrec the old one and newrec the new one rather than read and replace.

Also, if you open the database but fail to read the record id in RecordFound, you leave the database open which will cause a problem next time you try to open it. That's not related to your current question.

Not much help!
Good luck,
Frank
FrankG
 
Posts: 210
Joined: Thu Jan 23, 2003 7:58 pm

Postby jobie on Thu Mar 01, 2007 6:45 pm

Hi Frank,

Yes, I've verified the value is correct. I could try removing the record then adding it, I hadn't thought of that.

-John

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by FrankG</i>
<br />John,

Have you done alerts to display the Found_At value before and after the dbr.write? I've intermixed strings, ints, and bools in structures with no problem. The only question I wonder about is whether I use chars very often. I rarely overwrite records though. I delrec the old one and newrec the new one rather than read and replace.

Also, if you open the database but fail to read the record id in RecordFound, you leave the database open which will cause a problem next time you try to open it. That's not related to your current question.

Not much help!
Good luck,
Frank
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
jobie
 
Posts: 23
Joined: Wed Dec 27, 2006 8:53 pm
Location: USA

Postby jobie on Fri Mar 02, 2007 1:22 pm

Additional weirdness...

I made the change to delete/add new record.

The software works 100% as I expect on my palm emulator. On my client's actual device AND emulator, it does not work. I am modifying the same exact PDB file that he is.

It is definitely the same version of the app (I made sure he verified this).

I'm totally at a loss on this one.

Jeremy...are you out there?

-John
jobie
 
Posts: 23
Joined: Wed Dec 27, 2006 8:53 pm
Location: USA


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 1 guest

cron