iPhone SIM writer

Miscellaneous Forums/General Discussion/iPhone SIM writer

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

if anyone has an iPhone and cannot copy contacts from phone to SIM (I need it for my cars phone) then you can get:

http://www.maplin.co.uk/Module.aspx?ModuleNo=98994

and use this code to export a VCard.

SuperStrict

Local text:String = LoadString( "C:\Documents and Settings\Nigel\My Documents\Super GSM Reader\vCards.vcf")
Local outfile:TStream = WriteFile( "C:\Documents and Settings\Nigel\My Documents\Super GSM Reader\Phone 2.FPB" )
WriteLine( outfile, Chr(34) + Chr(34) + Chr(44) + Chr(34) + Chr(34))

Global card:String[] = text.split("BEGIN:VCARD")

For Local i:Int = 1 To Len(card)-1
		
	Local substring_name$ = Mid( card[i], card[i].find("FN:")+4, -1 )
	Local name:String[] = substring_name.split("~r")
	'
	Local tel:String[] = card[i].split("TEL;")
	For Local j:Int = 1 To Len(tel)-1

		Local app$ = ""
		If tel[j].find("WORK") <> -1 Then app$ = " (w)"
		If tel[j].find("CELL") <> -1 Then app$ = " (m)"
		If tel[j].find("HOME") <> -1 Then app$ = " (h)"

		Local substring_tel$ = Mid( tel[j], tel[j].find(":")+2, -1 )
		Local number:String[] = substring_tel.Split("~r")

		DebugLog Chr(34) + number[0] + Chr(34) + Chr(44) + Chr(34) + name[0] + app$ + Chr(34)

		WriteLine( outfile, Chr(34) + number[0] + Chr(34) + Chr(44) + Chr(34) + name[0] + app$ + Chr(34) )

	Next

Next

CloseFile( outfile )

End