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 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:112)
[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:112)
[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:112)
[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:112)
OrbWorks Community Forum • View topic - type mismatch runtime error from volopenfile

type mismatch runtime error from volopenfile

Discuss OrbForms Designer and PocketC Architect

Postby bbtapb on Wed Nov 22, 2006 7:00 pm

When I run the following code, I get that error message.
Strange, if I omit the call to volcreatedir, instead I get an expected "file does not exist" message. Anything obvious that I'm doing wrong?

z=volcreatedir(logVolID, "/blah");
#ifdef DEBUG
if (z!=0) puts("create dir:"+vfserror(z)+"\n");
#endif
logFileName="/blah/";
z=date(0)%100000;
logFileName=logFileName+"_";
if (z<10000) logFileName=logFileName+"0";
z=time(2)/100; if (z<1000) logFileName=logFileName+"0";
logFileName=logFileName+z+".csv";
z=volcreatefile(logVolID,logFileName);
#ifdef DEBUG
if (z!=0) puts("create log:"+vfserror(z)+"\n");
#endif
z=volopenfile(logVolID, logFileName, vfsModeWrite, &logFileID);
#ifdef DEBUG
if (z!=0) puts("open log:"+vfserror(z)+"\n");
#endif

Thanks.
bbtapb
 
Posts: 3
Joined: Wed May 17, 2006 3:10 am

Postby bbtapb on Wed Nov 22, 2006 7:35 pm

Here's a full PocketC program to demonstrate. This happens on the 5.4 simulator and on my TX.

Thanks for any help.

#define DEBUG

@cid "VFST";
@name "VFS Test";
@dbname "VFS Test";

#include "vfserror.h"

int logVolID,logFileID;
string logFileName;
char buffer[2000];

start_log();
stop_log();
log_data();

main()
{
int n;

logVolID=logFileID=0;
start_log();
for (n=0; n<20; n++) log_data();
stop_log();

}

start_log()
{
int i,z,el;
string entry;
int v,d;

if (logVolID==0)
{
z=enumvols(1,&v);
while(z)
{
logVolID=v;
#ifdef DEBUG
puts("Vol: " + vollabel(v)+"\n");
#endif
z=enumvols(0,&v);
}
}
if (logVolID==0)
{
z=dbopen("EIS Data");
if (z==0) { z=dbcreatex("EIS Data","EISD","data"); if (z==0) return; dbbackup(1); }
dbrec(dbnrecs());
}else{
if (logFileID==0)
{
z=volcreatedir(logVolID, "/blah");
#ifdef DEBUG
if (z!=0) puts("create dir:"+vfserror(z)+"\n");
#endif
logFileName="/blah/";
z=date(0)%100000;
logFileName=logFileName+z+"_";
if (z<10000) logFileName=logFileName+"0";
z=time(2)/100; if (z<1000) logFileName=logFileName+"0";
logFileName=logFileName+z+".csv";
z=volcreatefile(logVolID,logFileName);
#ifdef DEBUG
if (z!=0) puts("create log:"+vfserror(z)+"\n");
#endif
z=volopenfile(logVolID, logFileName, vfsModeWrite, &logFileID);
#ifdef DEBUG
if (z!=0) puts("open log:"+vfserror(z)+"\n");
#endif
}
}
entry="\nDATE,TIME,";
for (i=0; i<20; i++) entry=entry+i+",";
entry=entry+"\n";
el=strlen(entry);
strtoc(entry,buffer);
if (logFileID==0) dbwritexc(buffer, "c", el);
else filewrite(logFileID,entry,"c",el);
}

stop_log()
{
if (logFileID) fileclose(logFileID);
else dbclose();
}

log_data()
{
int i, loggit, el,t,rc;
string entry;

t=time(2);
entry=date(1)+","+t/10000+":";
if (t%10000<1000) entry=entry+"0";
entry=entry+t%10000/100+":";
if (t%100<10) entry=entry+"0";
entry=entry+t%100+",";
for (i=0; i<20; i++)
{
entry=entry+random(100)+",";
}
entry=entry+"\n";
el=strlen(entry);
strtoc(entry,buffer);
//for (i=0; i<el; i++)
if (logFileID)
{
rc=filewrite(logFileID,buffer,"c",el);
#ifdef DEBUG
puts("write rc=" + rc+" "+vfserror(rc)+"\n");
#endif

}
wait();
}
bbtapb
 
Posts: 3
Joined: Wed May 17, 2006 3:10 am

Postby dewey on Thu Nov 30, 2006 7:27 pm

In the following block:

Code: Select all
entry="\nDATE,TIME,";
for (i=0; i<20; i++) entry=entry+i+",";
entry=entry+"\n";
el=strlen(entry);
strtoc(entry,buffer);
if (logFileID==0) dbwritexc(buffer, "c", el);
else filewrite(logFileID,entry,"c",el);


Your call to filewrite should also be using buffer instead of entry.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 2 guests

cron