Hi!I hope someone could help me with this.
I want to retrieve data saved in .pnp file and display it in the same txtboxes and same order as it was saved.
My current code is:
VB Code:
(globalvar.bas) Option Explicit Public pn1 As New partnamelist (frm_field) Private Sub fieldupload() With pn1 'I made a class named partnamelist having these 4 properties: part, description, quantity, and version .part = txt_part.text .description = txt_desc.Text .quantity = txt_qty.Text .version = txt_version.Text End With End Sub Private Sub cmd_apply_Click() dim filename as string If Len(txt_part.text) = 0 And _ Len(txt_desc.Text) = 0 And _ Len(txt_qty.Text) = 0 And _ Len(txt_version.Text) = 0 Then MsgBox "please enter the necessary values." txt_part.setfocus Else fieldupload filename = txt_filename.text 'Specified filename of the user MsgBox ("Creating profile... Please choose what directory to save your profile.") frm_dir.Show vbModal End If End Sub '(frm_dir) Private Sub Form_Load() txt_pnprofile.Text = frm_field.filename + ".pnp" '--> "pnp" here in my example is my chosen extension. End Sub Private Sub cmd_ok_Click() txt_profilepath.Text = file1.Path & file1.FileName & "\" & txt_plprofile.Text 'file1 is a file listbox btw MsgBox "Saving " & txt_profilepath & " as new profile." SaveProfile txt_profilepath.Text, pn1 profilepath = txt_profilepath.Text End Sub Private Sub SaveProfile(WhatFile As String, TheProfile As namelist) Dim FreeFileHandle As Integer FreeFileHandle = FreeFile Open WhatFile For Output As FreeFileHandle With TheProfile Print #FreeFileHandle, "[Part] " & .part Print #FreeFileHandle, "[Description] " & .description Print #FreeFileHandle, "[Quantity] " & .quantity Print #FreeFileHandle, "[Version] " & .version End With Close FreeFileHandle End Sub
Output of egfile.pnp:
[Description] b42
[MakerCode] c65
[PartnameCode] x32
[Quantity] x75
[SymbolicCode] q21
After clicking RETRIEVE button, I want that b42 will be displayed in txt_description.text and so on and so forth.
How do I do this? I don't know how to use Line Input # Statement as well.
Anybody, pls. help.![]()




I hope someone could help me with this.
Reply With Quote