Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


how to create a database ?


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 02-14-2008, 10:22 AM
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 141
Default

Hmm, that is more difficult. I think that is beyond the level of my competence, sorry

Björn
Reply With Quote
  #12 (permalink)  
Old 02-14-2008, 10:25 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

No problem, you've been helpful.
Anyone else?
Reply With Quote
  #13 (permalink)  
Old 02-14-2008, 10:42 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,683
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Stellaferox View Post
Just a question that pops into mind: is there a way to create a CSV-database, using the FileWrite method?
Yes, but as the answer is simple I may not have understood your problem

text = "values1" & "," & "value2" & "," & .....
FileWrite(c1, text)
Reply With Quote
  #14 (permalink)  
Old 02-14-2008, 10:56 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Agraham,

That might work well, but I need roughly 133 million entries (with equivalent comma's) in a single textstring then. Will that work?
Reply With Quote
  #15 (permalink)  
Old 02-14-2008, 11:35 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,683
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Stellaferox View Post
I need roughly 133 million entries (with equivalent comma's) in a single textstring then. Will that work?
Probably not! But it begs the question - Why do you need to save that much data to a csv file as a single line?
Reply With Quote
  #16 (permalink)  
Old 02-14-2008, 11:41 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Well, I dont NEED to write it as a single line. I need to write 133784560 entries in a CSV, comma separated file. Then I want to read it in an array using the splStringfeature using the commaseparator.
Later on when having checked the data I will use a binary file (I need to sort the data first).
Marc
Reply With Quote
  #17 (permalink)  
Old 02-14-2008, 12:05 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,683
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Why do you need to write it to a CSV file and then reread it all back in again? I assume you are generating the data within the program. Unless it takes a lot of processing to generate each data point it might well be quicker to just generate the data straight into the array rather than doing a whole lot of string processing on it.

Also that is a huge amout of data that will occupy a huge amount of memory. If it were Int32s it is nearly half a Gigabyte, as Strings it could be even more! Unless your PC has a lot of memory your app will cause Windows to page stuff to and from disk and slow down processing to a crawl. Are you sure that you have structured your app and its' data in the optimum way.
Reply With Quote
  #18 (permalink)  
Old 02-14-2008, 03:43 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Agraham,

You are right. I am generating the code from inside and then building a "mothertable". I have to eyeball the data, hence the CSV format.
Later I want to read in the data in an array and after some work, split up the mothertable in a few smaller ones with indexes. Then I can use BinaryFile options. That is the main idea.
I need to optimize my code (lot easier in the earlier days with assembly languages, but Basic4PPC doesn support this (yet)).
Because computing from code takes a lot longer then reading a table (using binary search) I am able to have any entry I want in a 133 million base within 27 steps maximum.
Marc
Reply With Quote
  #19 (permalink)  
Old 02-14-2008, 04:30 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,683
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Stellaferox View Post
I have to eyeball the data, hence the CSV format.
You can't possibly eyeball all 133Mitems. Why not just generate the data into an array then put some testing code in to write out selected chunks of it to MsgBoxes or to small text files, they don't have to be CSV files to be readable.
Quote:
Because computing from code takes a lot longer then reading a table (using binary search) I am able to have any entry I want in a 133 million base within 27 steps maximum
Sorry - you missed my point. I meant generate all the items into the array rather than read all those items from a file and then do your lookups and build your smaller tables. Although for 27 steps involving 27 equality checks to save any time it must be a relatively long algorithm to generate the data? Also that implies sorting the table. Unless you can generate the data in sorted form that could take a long time as well. Have you done any timings to estimate how long this mammoth thing will take to run?
Quote:
lot easier in the earlier days with assembly languages, but Basic4PPC doesn support this (yet)
It probably never will as B4PPC outputs C# code which is compiled to IL (intermediate language) and written to the exe which the .NET Framework CLR (Common Language Runtime) JITs (Just In Time compiles) it at runtime to "safe" machine code. All this is done to stop humans fiddling with Assembly code and making mistakes. There are ways to cross over into "unsafe" code in DLLs but for B4PPC that would need a library and I'll go out on a limb and bet that Erel will never support this natively in B4PPC. If you are enough of an anorak (like me) you can buy books to find out how IL and the CLR works.
Reply With Quote
  #20 (permalink)  
Old 02-14-2008, 04:58 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

@agraham
I think that this one is pretty thorough:
http://www.amazon.com/Expert-NET-2-0...3008169&sr=8-1
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Record from one database to another database. mozaharul Questions & Help Needed 0 07-15-2008 05:47 AM
How to create a new appointment willisgt Questions & Help Needed 2 05-15-2008 09:21 PM
Command to create a database in sqlite mozaharul Questions & Help Needed 5 03-30-2008 04:38 AM
Can you help me create B4P lib? conf Questions & Help Needed 7 08-20-2007 08:41 PM
How to convert an Access database to a sqlite database Peter Code Samples & Tips 5 07-24-2007 04:20 PM


All times are GMT. The time now is 12:10 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0