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 - OMXROM error HS Prism DB attempt.....

OMXROM error HS Prism DB attempt.....

Discuss PocketC for Palm OS (including Desktop Edition)

Postby gjperker on Fri May 11, 2001 11:45 am

I'm getting this error followed by:

ByteCode: 12983
error in malloct()type

in the program I'm trying to write. I've just joined the PktC world and I'm trying to write the simplist DB I can, two rows of 3 string fields displayed in a table. That's it. Code as follows:

// TESTING
@cid "PerK";
@ver "1.0";
@name "TESTING";
@dbname "TESTING";
@licon8 "../PerK.bmp";

include "Ccontrols.c"

Chandle ht1;

m_create_DB(){

string mydata11 = "Greg";
string mydata12 = "Perkowski";
string mydata13 = "o.k.";
string mydata21 = "J.";
string mydata22 = "Smith";
string mydata23 = "n.g.";
pointer mptr;

dbcreatex("Test1", "PerK", "user");

mptr = malloc(6);
settype(mptr, 3, "s");

dbwrite(mydata11);
dbwrite(mydata12);
dbwrite(mydata13);
dbwrite(mydata21);
dbwrite(mydata22);
dbwrite(mydata23);

dbrec(0);
}

m_draw_controls(){

ht1 = CtableDB(1,32,158,5,6,"Test1","sss");

}

main(){

alert("Starting Test 3");

m_create_DB();

alert("DB created with\n" + "rec's: " + dbnrecs());

graph_on();

m_draw_controls();

dbclose();
wait();
exit();
}

Tried malloct(2,"sss") without the settype() first and got a bytecode error only.

Any suggestions? All help is really appreciated.

Thanks!!


Greg Perkowski
greg@perkowski.net
Greg Perkowski
greg@perkowski.net

The code is out there.
Follow the code Luke....
Beam me up, there's no intelligent code here.
gjperker
 
Posts: 8
Joined: Fri May 04, 2001 12:34 am
Location: USA

Postby gjperker on Fri May 11, 2001 2:10 pm

First, forgot to mention that I've used C a few years ago as a front end for an Oracle DB. I'd be happy to help with beta testing and writing or debugging some of the simpler code as I get up to speed on PctC.

Given the "malloct" errors I went back to using malloct (took out malloc & settype).

Now I get a bytecode error 16003. Here's the code:

// TESTING
@cid "PerK";
@ver "1.0";
@name "TESTING";
@dbname "TESTING";
@licon8 "../PerK.bmp";

// INCLUCES ///////////////////////

include "Ccontrols.c"

Chandle ht1;

// CREATE THE DB ////////////////

m_create_DB(){

string mydata11 = "Greg";
string mydata12 = "Perkowski";
string mydata13 = "o.k.";
string mydata21 = "J.";
string mydata22 = "Smith";
string mydata23 = "n.g.";
pointer mptr;

dbcreatex("Test1", "PerK", "user");

mptr = malloct(2, "sss");

dbwrite(mydata11);
dbwrite(mydata12);
dbwrite(mydata13);
dbwrite(mydata21);
dbwrite(mydata22);
dbwrite(mydata23);

dbrec(0);
}

// DRAW SCREEN CONTROLS //////////////

m_draw_controls(){

ht1 = CtableDB(1,32,158,5,6,"Test1","sss");

}

////////////////////////////////////////
main(){

alert("Starting W/ malloct(2, 'sss')");

m_create_DB();

alert("DB created with\n" + "rec's: " + dbnrecs());

graph_on();

m_draw_controls();

wait();
dbclose();
exit();
}

Any help is appreciated. Thanks!!


Greg Perkowski
greg@perkowski.net
[/quote]

Greg Perkowski
greg@perkowski.net
Greg Perkowski
greg@perkowski.net

The code is out there.
Follow the code Luke....
Beam me up, there's no intelligent code here.
gjperker
 
Posts: 8
Joined: Fri May 04, 2001 12:34 am
Location: USA

Postby eftomi on Fri May 11, 2001 3:07 pm

Greg, be carefull with pointers and type declaration in CtableDB(); try this:

// TESTING
@cid "PerK";
@ver "1.0";
@name "TESTING";
@dbname "TESTING";
@licon8 "../PerK.bmp";

// INCLUCES ///////////////////////

include "Ccontrols.c"

Chandle ht1;

// CREATE THE DB ////////////////

m_create_DB(){

string mydata11 = "Greg";
string mydata12 = "Perkowski";
string mydata13 = "o.k.";
string mydata21 = "J.";
string mydata22 = "Smith";
string mydata23 = "n.g.";
pointer mptr,nptr;

dbcreatex("Test1", "PerK", "user");

mptr = malloct(1, "sss");
nptr = malloct(1, "sss");

dbrec(-1);

mptr[0]=mydata11;
mptr[1]=mydata12;
mptr[2]=mydata13;

dbwritex(mptr,"s10s10s10");

dbrec(-1);

mptr[0]=mydata21;
mptr[1]=mydata22;
mptr[2]=mydata23;

dbwritex(mptr,"s10s10s10");

dbrec(0);
dbreadx(nptr, "s10s10s10");
alert(nptr[0]+nptr[1]+nptr[2]);
dbrec(1);
dbreadx(nptr, "s10s10s10");
alert(nptr[0]+nptr[1]+nptr[2]);

}

// DRAW SCREEN CONTROLS //////////////

m_draw_controls(){

ht1 = CtableDB(1,32,158,5,3,"Test1","s10s10s10");
Cdraw(ht1);

}

////////////////////////////////////////
main(){

alert("Starting W/ malloct(2, 'sss')");

m_create_DB();

alert("DB created with\n" + "rec's: " + dbnrecs());

graph_on();

m_draw_controls();

wait();
dbclose();
exit();
}

==END=================================

Sometimes CtableDB (from Ccontrols) displays '0' instead of a string (like in this case in the first column). Someone knows why? Pointers again...?
eftomi
 
Posts: 8
Joined: Fri May 11, 2001 3:02 pm
Location: Slovenia

Postby gjperker on Fri May 11, 2001 3:39 pm

Thanks Tomaz! But, I still get the:

VIRTUAL MACHINE ERROR
ByteCode: 16008
error in malloct()type

I'm assuming you compiled and ran your code on your machine and it works. I'm wondering if there's a problem specific to the Handspring Visor(Prism) running Palm OS and PocketC. I'm going to search the archives to see if it's been mentioned.

Thanks again! Greg

Greg Perkowski
greg@perkowski.net
Greg Perkowski
greg@perkowski.net

The code is out there.
Follow the code Luke....
Beam me up, there's no intelligent code here.
gjperker
 
Posts: 8
Joined: Fri May 04, 2001 12:34 am
Location: USA

Postby eftomi on Fri May 11, 2001 4:49 pm

Greg, I'm running the code on Handspring Visor DeLuxe and also on POSE (Palm Emulator) with Visor's ROM. Maybe you use some special "hack" sw.

Ooops, regarding the problem I mentioned in previous post ("Sometimes CtableDB (from Ccontrols) displays '0' instead of a string..") - your function m_draw_controls() should be:

m_draw_controls(){

pointer DB;
DB = malloct(1,"sss");

ht1 = CtableDB(1,32,158,5,3,DB,"s10s10s10");
Cdraw(ht1);
}

Regards, Tomaz
eftomi
 
Posts: 8
Joined: Fri May 11, 2001 3:02 pm
Location: Slovenia


Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 2 guests

cron