Hi!
(i hope my english is good enough to understand) ;-)
Im writing a tool to import/export contacts as vcards and have some trouble while accessing data:
*************************************
First problem: Contact.WebPage
setting Contact.WebPage by program to a nonvalid URL (without leading http://) produced an runtime error - not a real problem: syntaxcheck is possible;-)
BUT:
If Contact.Webpage contains an non valid URL (entering or editing the contact manually by user) then accessing to this field produces an runtime error!
How to access or syntaxcheck this field if every access fails?
***********************************************
Second problem: Contact.Birthday and Contact.Anniversary
If the user has no date(s) in an contact entry the query
strDate = Date(Contact.Birthday) delivers the date: 01/01/1601
in this case the reverse operation:
Contact.Birthday = ParseDate(strDate)
generates an runtime error to!
If birthdday or anniversary set to an actual date -> No problem
******************************************************
my sample code for the second problem (in case its an human problem):
******************************************************
Sub Globals
'Declare the global variables here.
End Sub
Sub App_Start
ErrorLabel(errHandler)
Form1.Show
Contact.New1
PimCol.New1("Contacts")
nr = PimCol.FindItem("LastName","Tester")
If nr > -1 Then
Contact.Value = PimCol.GetItem(nr)
ContactDateTicks=Contact.Birthday
ContactDateString=Date(Contact.Birthday)
'reverse operation
ContactDateNewTicks=DateParse(ContactDateString)
'for showing query results only
Label1.Text = ContactDateTicks &crlf
Label1.Text = Label1.Text & ContactDateString &crlf
Label1.Text = Label1.Text & ContactDateNewTicks &crlf
'following line now fails if Contact entry is not set to a ?valid? date
Contact.Birthday = ContactDateNewTicks
Contact.Update
Else
Label1.Text = "Create a contact with Lastname: Tester first!"
End If
Label1.Text = Label1.Text & "SUCCESS!"
Form1.Refresh
Sleep(3000)
AppClose
errHandler:
Label1.Text = Label1.Text & "FAIL!"
Form1.Refresh
Sleep(4000)
AppClose
End Sub
(i hope my english is good enough to understand) ;-)
Im writing a tool to import/export contacts as vcards and have some trouble while accessing data:
*************************************
First problem: Contact.WebPage
setting Contact.WebPage by program to a nonvalid URL (without leading http://) produced an runtime error - not a real problem: syntaxcheck is possible;-)
BUT:
If Contact.Webpage contains an non valid URL (entering or editing the contact manually by user) then accessing to this field produces an runtime error!
How to access or syntaxcheck this field if every access fails?
***********************************************
Second problem: Contact.Birthday and Contact.Anniversary
If the user has no date(s) in an contact entry the query
strDate = Date(Contact.Birthday) delivers the date: 01/01/1601
in this case the reverse operation:
Contact.Birthday = ParseDate(strDate)
generates an runtime error to!
If birthdday or anniversary set to an actual date -> No problem
******************************************************
my sample code for the second problem (in case its an human problem):
******************************************************
Sub Globals
'Declare the global variables here.
End Sub
Sub App_Start
ErrorLabel(errHandler)
Form1.Show
Contact.New1
PimCol.New1("Contacts")
nr = PimCol.FindItem("LastName","Tester")
If nr > -1 Then
Contact.Value = PimCol.GetItem(nr)
ContactDateTicks=Contact.Birthday
ContactDateString=Date(Contact.Birthday)
'reverse operation
ContactDateNewTicks=DateParse(ContactDateString)
'for showing query results only
Label1.Text = ContactDateTicks &crlf
Label1.Text = Label1.Text & ContactDateString &crlf
Label1.Text = Label1.Text & ContactDateNewTicks &crlf
'following line now fails if Contact entry is not set to a ?valid? date
Contact.Birthday = ContactDateNewTicks
Contact.Update
Else
Label1.Text = "Create a contact with Lastname: Tester first!"
End If
Label1.Text = Label1.Text & "SUCCESS!"
Form1.Refresh
Sleep(3000)
AppClose
errHandler:
Label1.Text = Label1.Text & "FAIL!"
Form1.Refresh
Sleep(4000)
AppClose
End Sub
Last edited: