Re: Simple Database [text file] for Pocket PC
This is always the problem when we post code for people to use - unless you really understand it 100% it's really not helping.
First you have two functions definitions.
They both start with...
Code:
Public Function Get_From_Config_File(ByVal strEle As String) As String
.
.
.
and
Code:
Public Function Write_To_Config_File(ByVal strEle As String, ByVal strVal As String) As String
.
.
.
Those functions do the actual work of Get'ing and Write'ing values from the XML file.
If you place those two functions in your FORM CODE you should be able to use them as you posted here...
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Write_To_Config_File("text1", newvalue)
TextBox2.Text = Write_To_Config_File("text2", newvalue)
End Sub
Remember that to put them in your FORM code you need to also have those IMPORTS statements...
Also keep in mind that I'm a really inexperienced in the VB.Net world - I came from mainframes 7 years ago - started with VB6 on PC's and just now use .Net.
So all I just said above should get your functions in the FORM and get them working...
Putting them in their own CLASS and creating PROPERTIES for that CLASS is probably overkill for your needs. And if you don't want to learn the CLASS concept right now - it's probably not worth it.
This code from the CLASS you looked at is really quite simple - but you need to understand object oriented concepts to use it...
Code:
Public Class Settings
Private strServer As String
Private strUserId As String
Const Datapath = "\Program Files\APC"
Public Property sServer() As String
Get
Return strServer
End Get
Set(ByVal value As String)
strServer = Write_To_Config_File("Server", value)
End Set
End Property
Public Property sUserId() As String
Get
Return (strUserId)
End Get
Set(ByVal value As String)
strUserId = Write_To_Config_File("UserId", value)
End Set
End Property
Public Sub New()
strServer = Get_From_Config_File("Server")
strUserId = Get_From_Config_File("UserId")
End Sub
Those two properties expose to your FORM some values.
You use them as:
strValue = Settings.sServer
When done this way - property on the right of the = - the code in the GET portion of the property declaratin is used. Basically a silly little RETURN STRSERVER. STRSERVER gets filled in the CLASS when the CLASS is created by the form - that's when the NEW() function in the CLASS runs. The new function does the initial loading of the STRSERVER and STRUSERID variables - using the GET_FROM_CONFIG_FILE function. The STRSERVER and STRUSERID variables are hidden in the CLASS and not seen by the form unless referenced by the code I showed
strValue = Settings.sServer
You might think this is overkill to have a CLASS load some variables and then hide them and only allow access to them through that type of syntax call - and if you don't appreciate OOP concepts that will be the case.
Now changing the value by using the class is done like this:
Settings.sServer = "xyz"
This calls the SET code in the PROPERTY logic. And you can see that it does two things.
strServer = Write_To_Config_File("Server", value)
That might appear to be one thing - but it's two really important things.
First it calls the WRITE_TO_CONFIG_FILE - which makes sure the text file on the disk has our new value.
Second - and probably most important - it fills the STRSERVER variable with the value (since WRITE_TO_CONFIG_FILE returns that). That keeps the value - the new value - in the CLASS.
So that PROPERTY is accessed by your FORM code with these two lines of code:
strValue = Settings.sServer
or
Settings.sServer = "xyz"
But most important those two lines of code actually run functions in the PROPERTY declaration in the CLASS. You could do all kinds of stuff in that PROPERTY - fill other values - adjust things - validate values - that's the whole point of using OO. Your FORM logic simply asks for a value or sets a value in some property and all kinds of logic can run in the CLASS behind the scenes. You can even enhance that logic in the future - in the CLASS - and probably not have to search around you FORM code making adjustments.
Re: Simple Database [text file] for Pocket PC
szlamany
I have moved the code into the form and deleted the Class, however I still get the error message that Write_To_Config_File & Get_From_Config_File is not declared
Here is the code which is now all in my form:
Code:
Imports System
Imports System.IO
Imports System.Xml
Public Class Form1
Dim Text1 As String
Dim Text2 As String
Dim Text3 As String
Dim Text4 As String
Public Class Settings
Private strServer As String
Private strUserId As String
Const Datapath = "\Program Files\APC"
Public Property sServer() As String
Get
Return strServer
End Get
Set(ByVal value As String)
strServer = Write_To_Config_File("Server", value)
End Set
End Property
Public Property sUserId() As String
Get
Return strUserId
End Get
Set(ByVal value As String)
strUserId = Write_To_Config_File("UserId", value)
End Set
End Property
Public Sub New()
strServer = Get_From_Config_File("Server")
strUserId = Get_From_Config_File("UserId")
End Sub
Public Function Get_From_Config_File(ByVal strEle As String) As String
Try
Dim dr As XmlTextReader
Dim fs As FileStream = New FileStream(Path.Combine(Datapath, "Config.xml"), FileMode.Open)
Dim strRet As String
strRet = ""
dr = New XmlTextReader(fs)
While dr.Read
If dr.NodeType = XmlNodeType.Element And dr.Name = strEle Then
strRet = dr.ReadElementString()
dr.Close()
fs.Close()
End If
End While
dr.Close()
fs.Close()
Return strRet
Catch ex As FileNotFoundException
Using sw As StreamWriter = New StreamWriter(Path.Combine(Datapath, "Config.xml"))
sw.WriteLine("<Configuration_Data>")
sw.WriteLine("</Configuration_Data>")
sw.Close()
End Using
Return ""
Catch ex As Exception
Return ""
End Try
End Function
Public Function Write_To_Config_File(ByVal strEle As String, ByVal strVal As String) As String
Write_To_Config_File = ""
Dim iCt As Integer
Dim bDone As Boolean
'Dim appPath As String
'appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
Dim xd As XmlDocument = New XmlDocument
xd.Load(Path.Combine(Datapath, "Config.xml"))
Dim xe As XmlElement = xd.DocumentElement
If xe.Name = "Configuration_Data" Then
For Each xce As XmlElement In xe.ChildNodes
If xce.ChildNodes.Count = 1 Then
If xce.Name = strEle Then
xce.FirstChild.Value = strVal
bDone = True
End If
Else
For iCt = 0 To xce.ChildNodes.Count - 1
If xce.ChildNodes(iCt).Name = strEle Then
xce.ChildNodes(iCt).FirstChild.Value = strVal
bDone = True
End If
Next
End If
If bDone Then
Exit For
End If
Next
If Not bDone Then
Dim elem As XmlElement = xd.CreateElement(strEle)
elem.InnerText = strVal
xe.AppendChild(elem)
End If
End If ' write the document back to disk
xd.Save(Path.Combine(Datapath, "Config.xml"))
Write_To_Config_File = strVal
End Function
End Class
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Write_To_Config_File("text1", newvalue)
TextBox2.Text = Write_To_Config_File("text2", newvalue)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox3.Text = Get_From_Config_File("text1")
TextBox4.Text = Get_From_Config_File("text2")
End Sub
End Class
Any ideas :confused:
Re: Simple Database [text file] for Pocket PC
All of this:
Code:
Public Class Settings
Private strServer As String
Private strUserId As String
Const Datapath = "\Program Files\APC"
Public Property sServer() As String
Get
Return strServer
End Get
Set(ByVal value As String)
strServer = Write_To_Config_File("Server", value)
End Set
End Property
Public Property sUserId() As String
Get
Return strUserId
End Get
Set(ByVal value As String)
strUserId = Write_To_Config_File("UserId", value)
End Set
End Property
Public Sub New()
strServer = Get_From_Config_File("Server")
strUserId = Get_From_Config_File("UserId")
End Sub
needs to be removed - it's declaring a class within the FORM - making the functions be hidden.
Only the code starting with PUBLIC FUNCTION GET... needs to go in the form.
Re: Simple Database [text file] for Pocket PC
OK I now have form1 code below reporting 2 erors DATAPATH NOT DECLARED
And 'NAME newvalue IS NOT DECLARED
Code:
Imports System
Imports System.IO
Imports System.Xml
Public Class Form1
Dim Text1 As String
Dim Text2 As String
Dim Text3 As String
Dim Text4 As String
Public Function Get_From_Config_File(ByVal strEle As String) As String
Try
Dim dr As XmlTextReader
Dim fs As FileStream = New FileStream(Path.Combine(Datapath, "Config.xml"), FileMode.Open) 'DATAPATH NOT DECLARED
Dim strRet As String
strRet = ""
dr = New XmlTextReader(fs)
While dr.Read
If dr.NodeType = XmlNodeType.Element And dr.Name = strEle Then
strRet = dr.ReadElementString()
dr.Close()
fs.Close()
End If
End While
dr.Close()
fs.Close()
Return strRet
Catch ex As FileNotFoundException
Using sw As StreamWriter = New StreamWriter(Path.Combine(Datapath, "Config.xml")) 'DATAPATH NOT DECLARED
sw.WriteLine("<Configuration_Data>")
sw.WriteLine("</Configuration_Data>")
sw.Close()
End Using
Return ""
Catch ex As Exception
Return ""
End Try
End Function
Public Function Write_To_Config_File(ByVal strEle As String, ByVal strVal As String) As String
Write_To_Config_File = ""
Dim iCt As Integer
Dim bDone As Boolean
'Dim appPath As String
'appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
Dim xd As XmlDocument = New XmlDocument
xd.Load(Path.Combine(Datapath, "Config.xml")) 'DATAPATH NOT DECLARED
Dim xe As XmlElement = xd.DocumentElement
If xe.Name = "Configuration_Data" Then
For Each xce As XmlElement In xe.ChildNodes
If xce.ChildNodes.Count = 1 Then
If xce.Name = strEle Then
xce.FirstChild.Value = strVal
bDone = True
End If
Else
For iCt = 0 To xce.ChildNodes.Count - 1
If xce.ChildNodes(iCt).Name = strEle Then
xce.ChildNodes(iCt).FirstChild.Value = strVal
bDone = True
End If
Next
End If
If bDone Then
Exit For
End If
Next
If Not bDone Then
Dim elem As XmlElement = xd.CreateElement(strEle)
elem.InnerText = strVal
xe.AppendChild(elem)
End If
End If ' write the document back to disk
xd.Save(Path.Combine(Datapath, "Config.xml")) 'DATAPATH NOT DECLARED
Write_To_Config_File = strVal
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Write_To_Config_File("text1", newvalue) 'NAME newvalue IS NOT DECLARED
TextBox2.Text = Write_To_Config_File("text2", newvalue) 'NAME newvalue IS NOT DECLARED
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox3.Text = Get_From_Config_File("text1")
TextBox4.Text = Get_From_Config_File("text2")
End Sub
End Class
And a Class1.vb code below report errors Write_To_Config_File is not declared, Get_From_Config_File is not declared as shown below
Code:
Imports System
Imports System.IO
Imports System.Xml
Public Class Settings
Private strServer As String
Private strUserId As String
Const Datapath = "\Program Files\APC"
Public Property sServer() As String
Get
Return strServer
End Get
Set(ByVal value As String)
strServer = Write_To_Config_File("Server", value) 'Write_To_Config_File IS NOT DECLARED
End Set
End Property
Public Property sUserId() As String
Get
Return strUserId
End Get
Set(ByVal value As String)
strUserId = Write_To_Config_File("UserId", value) 'Write_To_Config_File IS NOT DECLARED
End Set
End Property
Public Sub New()
strServer = Get_From_Config_File("Server") 'Get_From_Config_File IS NOT DECLARED
strUserId = Get_From_Config_File("UserId") 'Get_From_Config_File IS NOT DECLARED
End Sub
End Class
I am sure its me again and if I ever get this working will post the whole thing.
Many thanks for your help to date
Re: Simple Database [text file] for Pocket PC
DATAPATH is not declared - that error is rather clear.
In my original code I had:
Const Datapath = "\Program Files\APC"
To declare the Datapath as a string constant. That was because I was developing on a Pocket PC and just learning where things got stored - I started with the Business folder. I also at times used the PPC emulator instead of the real device - and that has other "folders" available.
At any rate - where do you want to store the CONFIG.XML file? If you already know then put that in the filename where it's referred to. Or put the path in the Const Datapath = "xyz" - so you have less code to mess with.
The second error is also rather clear - NEWVALUE is not declared either.
This code you have
Code:
TextBox1.Text = Write_To_Config_File("text1", newvalue) 'NAME newvalue IS NOT DECLARED
TextBox2.Text = Write_To_Config_File("text2", newvalue) 'NAME newvalue IS NOT DECLARED
Should really just be:
Code:
TextBox1.Text = Write_To_Config_File("text1", TextBox1.Text)
TextBox2.Text = Write_To_Config_File("text2", TextBox2.Text)
The value you want written are in the TextBox1 and TextBox2 controls - right? So that is what you pass to WRITE_TO_CONFIG_FILE. The function happens to return back the "value" written - so it's ok to use this syntax - it won't destroy the values in the TEXTBOX1 and TEXTBOX2 controls.
And for the class - it's not needed anymore. You put the functions for reading and writing to the XML code into your form - and you are using them directly. Blow away the CLASS code - you don't need it anymore.
Re: Simple Database [text file] for Pocket PC
szlamany,
Ok, no class its gone and this is the code in the form
Code:
Imports System
Imports System.IO
Imports System.Xml
Public Class Form1
Dim Text1 As String
Dim Text2 As String
Dim Text3 As String
Dim Text4 As String
Const Datapath = "\program files\textwriter\"
Public Function Get_From_Config_File(ByVal strEle As String) As String
Try
Dim dr As XmlTextReader
Dim fs As FileStream = New FileStream(Path.Combine(Datapath, "Config.xml"), FileMode.Open)
Dim strRet As String
strRet = ""
dr = New XmlTextReader(fs)
While dr.Read
If dr.NodeType = XmlNodeType.Element And dr.Name = strEle Then
strRet = dr.ReadElementString()
dr.Close()
fs.Close()
End If
End While
dr.Close()
fs.Close()
Return strRet
Catch ex As FileNotFoundException
Using sw As StreamWriter = New StreamWriter(Path.Combine(Datapath, "Config.xml"))
sw.WriteLine("<Configuration_Data>")
sw.WriteLine("</Configuration_Data>")
sw.Close()
End Using
Return ""
Catch ex As Exception
Return ""
End Try
End Function
Public Function Write_To_Config_File(ByVal strEle As String, ByVal strVal As String) As String
Write_To_Config_File = ""
Dim iCt As Integer
Dim bDone As Boolean
'Dim appPath As String
'appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
Dim xd As XmlDocument = New XmlDocument
xd.Load(Path.Combine(Datapath, "Config.xml"))
Dim xe As XmlElement = xd.DocumentElement
If xe.Name = "Configuration_Data" Then
For Each xce As XmlElement In xe.ChildNodes
If xce.ChildNodes.Count = 1 Then
If xce.Name = strEle Then
xce.FirstChild.Value = strVal
bDone = True
End If
Else
For iCt = 0 To xce.ChildNodes.Count - 1
If xce.ChildNodes(iCt).Name = strEle Then
xce.ChildNodes(iCt).FirstChild.Value = strVal
bDone = True
End If
Next
End If
If bDone Then
Exit For
End If
Next
If Not bDone Then
Dim elem As XmlElement = xd.CreateElement(strEle)
elem.InnerText = strVal
xe.AppendChild(elem)
End If
End If ' write the document back to disk
xd.Save(Path.Combine(Datapath, "Config.xml"))
Write_To_Config_File = strVal
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Write_To_Config_File("text1", TextBox1.Text)
TextBox2.Text = Write_To_Config_File("text2", TextBox2.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox3.Text = Get_From_Config_File("text1")
TextBox4.Text = Get_From_Config_File("text2")
End Sub
End Class
When I run the code it reports an error that leads me to belive that the code below, which does not report an error when run
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Write_To_Config_File("text1", TextBox1.Text)
TextBox2.Text = Write_To_Config_File("text2", TextBox2.Text)
End Sub
Does not create the file Config.xml, as when I use the code below
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox3.Text = Get_From_Config_File("text1")
TextBox4.Text = Get_From_Config_File("text2")
End Sub
The debug tells me to check that “Could not find a part of the path '\program files\textwriter\Config.xml' “.
I hope that I have explained that well enough :ehh:
Re: Simple Database [text file] for Pocket PC
Quote:
Originally Posted by JohnSavage
The debug tells me to check that “Could not find a part of the path '\program files\textwriter\Config.xml' “.
Did you create a folder on the pocket pc called TEXTWRITER in the PROGRAM FILES folder?
Re: Simple Database [text file] for Pocket PC
Yes, but I was using the emulator, I have just tried it on device and it gives the same error mesage :confused:
Re: Simple Database [text file] for Pocket PC
I found the initial experience with the emulator and the PPC very confusing in regard to file locations.
It looks the the Get_From_Config_File is what creates the actual file - if you look at the error trap in that function.
Create one with NOTEPAD and copy it to the PPC...
When I used the emulator I mapped a folder on my laptop to the PPC and then used that for fooling with files.
Re: Simple Database [text file] for Pocket PC
Hi, I'm back with more errors:ehh:
I followed your advice and created the file Config.xml and put it in the right directory on the device and then deloyed the app
In the Immediate window when deploying the app I get these
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in System.Xml.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.Xml.XmlException' occurred in System.Xml.dll
Before the app displays on the device
Then when I press Button2 I get an error on the line
xd.Load(Path.Combine(Datapath, "Config.xml"))
which says "Root element was missing" :eek2:
Re: Simple Database [text file] for Pocket PC
If you google for those "first chance exceptions" you will find they are not real.
Root element missing sounds like the CONFIG.XML file is empty - doesn't have the <Configuration_Data> tags...
Those would have been created by this error trap in the Get_From_Config_File function if it actually creates the Config.xml file
Code:
Using sw As StreamWriter = New StreamWriter(Path.Combine(Datapath, "Config.xml"))
sw.WriteLine("<Configuration_Data>")
sw.WriteLine("</Configuration_Data>")
sw.Close()
End Using
Is the CONFIG.XML file empty? It opens in IE on the PPC...
Re: Simple Database [text file] for Pocket PC
Yes the file is empty ?
and as I said the file was not created anyway, it was created and put there by me as you said too :confused:
Re: Simple Database [text file] for Pocket PC
But apparently - and I'm like the most inexperienced XML person around - you need some tags in the file.
Put
Quote:
<Configuration_Data>
</Configuration_Data>
in that empty file - it has to have something in it to make it a well-formed XML file.
But step back please - my last post talked about how the file would be created properly - by the error trap of the Get... function. You must not be calling the Get... function first - so no well formed XML file got created.
So the root problem - and I am guessing here - is that your code calls the Write... function first and PeteVick (who wrote these functions originally) did not intend for the Write... function to properly create a well-formed XML file.
Re: Simple Database [text file] for Pocket PC
Szlamany,
Brilliant it works :D
Special thanks go to:
Techgnome (:eek: yes you were right!)
Si the geek (so much more eloquent than techgnome)
Petevick
IamMacro
Shaggy Hiker
And finally
Szlamany, please let me take the time to thank you for your perseverance and the time you have all spent trying to get me to understand this method.
Just one final question (I think) some posts ago you said “XML - it's the modern way to "store" a couple of dozen elements” is there a limit on the number of variables that can be stored and updated using this method :confused:
Re: Simple Database [text file] for Pocket PC
You are very welcome...
Quote:
Originally Posted by JohnSavage
Just one final question (I think) some posts ago you said “XML - it's the modern way to "store" a couple of dozen elements” is there a limit on the number of variables that can be stored and updated using this method :confused:
Recently we were asked to produce a data file for transmitting around 10000 student records in XML to another vendor. Each student had around 100 tagged XML values - so that's nearly a million rows of data. I believe the XML file was 100 MB - barely could open it in NOTEPAD.
So obviously XML can be used for more than a dozen rows.
Was it a good method of transmitting - not in my opinion!
Re: [RESOLVED] Simple Database [text file] for Pocket PC
Thanks I understand.
ps
I have an event within the test app called
Private Sub VScrollBar1_ValueChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
A vertical scrollbar change event
But when I put a break point on it it the debug never stops at it but the code runs as I can see the results change ?
Re: [RESOLVED] Simple Database [text file] for Pocket PC
You might want to start a new thread with such a wildly different issue...
Did you recently copy/paste that control? Seems it might be missing the HANDLES part of the event declaration.
Re: [RESOLVED] Simple Database [text file] for Pocket PC
OK thanks again
The more I learn, the greater my appreciation of how much I don’t know grows :wave:
Re: [RESOLVED] Simple Database [text file] for Pocket PC
Let me add one recommendation for where to actually save files on a PPC device: The SD card!!!
When I lose power to my PDA, all memory is cleared. Some PDAs have a separate battery that maintains volatile memory if the main battery runs out, but mine doesn't. Then there is the case of the accidental re-format, which my PDA has done twice (once was totally my fault...I actually thought "gee, I wonder what this switch does?"). It's really annoying to lose all your data, and have to start over, especially if it is a database with significant amounts of stuff in it.
For that reason, I store all files on the SD Card. Those things are tough! If you look around this forum, you will find the thread where I took one of those cards and ran it through various appliances around my house. The one that finally killed it was boiling in salt water for five minutes, but a trip through the dishwater (hot, soapy, water applied with pressure) didn't damage the data any.
Re: [RESOLVED] Simple Database [text file] for Pocket PC
Quote:
Originally Posted by Shaggy Hiker
...but a trip through the dishwater (hot, soapy, water applied with pressure) didn't damage the data any.
Now that is clean data - and we all like clean data ;)
I've got no SD card in my PPC - our read-only app's on the PPC actually delete the database if the PW is put in wrong 3 times...
But for our upcoming "data entry" tools for the PPC I will take your advice - put it on the SD card!
Re: [RESOLVED] Simple Database [text file] for Pocket PC
Hi,
but remember - SD cards are slower than memory, and have a finite life, I seem to remember.
We use main memory wherever possible, but automatically back up the database to SD, keeping up to 10 generations on the card
Pete
Re: [RESOLVED] Simple Database [text file] for Pocket PC
I had heard that SD cards were slow, but I seem to remember hearing (ok, I stated it as vaguely as I remember it) that that problem has gone away. I don't notice any slowdown using an SD card versus main memory for a database.
There could be an issue with the lifespan of cards...or possibly readers. In general, I feel that flash memory is like any other memory, but not as well tested: It might fail, but if it is going to, it does it fairly early on.
My brother-in-law was telling me that there were three grades of flash memory, and there might be a high quality/high reliability version of an SD card. I have been using a standard scandisk card for a couple years now without any problem. I have another in a camera, which has worked fine, but under much less testing.
I needed the water resistance because I was developing something for a fish trap. I figured that people would eventually drop one of the PDAs in the river, and I wanted to have some idea what would happen to the data. There are a few other tests I have been meaning to do, but we decided that laptops were a better solution than PDAs, so I have moved away from the whole program now.