Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Have a look to the project and please correct me.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-12-2008, 07:27 AM
Senior Member
 
Join Date: Mar 2008
Location: Dhaka, Bangladesh
Posts: 164
Default Have a look to the project and please correct me.

Hi,
In the attached project (with database), Table1 represents individual house hold and head name. Clicking a house hold will show the Date of birth (dob) of all members of that house hold in Table2.

What I want:
Calculation of individual member’s age and to keep those in an array variable, so could be use later in the program.

What I did:
Declared in Global sub an array variable agecal (0) in line-3
Redefined it with “RowCount” of table2 in line-26
And tried to calculate individual’s age in line-29
But doesn’t calculate any thing !

Please help.


Regards
Reply With Quote
  #2 (permalink)  
Old 10-12-2008, 07:06 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You should redefine the array with:
Code:
Dim agecal(rc)
The complete sub should be:
Code:
Sub Table1_SelectionChanged (ColName, Row)
    
If table1.SelectedRow >=0 Then
        i=table1.SelectedRow 
        txthpidselect.Text=table1.Cell(
"HPID",i)
        cmd.CommandText=
"select dob from member where hpid="&table1.Cell("HPID",i)
        cmd.ExecuteTable(
"table2",0)
        rc=table2.RowCount
        
Dim agecal(rc) ' array variable "agecal" is redefined here.
        For i=0 To table2.RowCount-1
            agecal(i)= 
Int(((calendar1.Value-DateParse(table2.Cell("dob",i)))/cTicksPerDay)/365.25)
        
Next
    
End If
End Sub
BTW, you can call DateFormat under App_Start instead of calling it each time.
Reply With Quote
  #3 (permalink)  
Old 10-13-2008, 03:02 AM
Senior Member
 
Join Date: Mar 2008
Location: Dhaka, Bangladesh
Posts: 164
Default

Hi Erel,

Thank you again for your time.


regards,
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed converting a VB6 Project Drewpeu Questions (Windows Mobile) 11 10-15-2008 06:13 PM
about database bundled project gjoisa Questions (Windows Mobile) 1 02-24-2008 03:01 PM
multiple form on an desktop project Cableguy Bug Reports 11 01-08-2008 10:19 PM
Returning subroutine error - Input string was not in the correct format HarleyM Questions (Windows Mobile) 4 10-20-2007 06:45 AM
Battery Saver project Cableguy Questions (Windows Mobile) 1 07-12-2007 07:02 PM


All times are GMT. The time now is 07:44 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0