IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Is there such a thing as a multiline INI entry?
New Re: Is there such a thing as a multiline INI entry?
You might be able to embed newlines in the string value if you can guarantee no =[] chars in the value, but I don't know first hand. Try it and see what happens. There is also the following warning in the docs for GetPrivateProfileString:

lpReturnedString
[out] Pointer to the buffer that receives the retrieved string.
Windows Me/98/95: The string cannot contain control characters (character code less than 32). Strings containing control characters may be truncated.

-- [link|http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getprivateprofilestring.asp|http://msdn.microsof...profilestring.asp]

Perhaps you could do something like the following:

NUM_DATA_FILES=10
DATA_FILE_0001=ccip_p9250_t09_a09_seg_zp2_k01_s0001.txt
DATA_FILE_0002=ccip_p9250_t09_a09_seg_zp2_k01_s0002.txt
DATA_FILE_0003=ccip_p9250_t09_a09_seg_zp2_k01_s0003.txt
DATA_FILE_0004=ccip_p9250_t09_a09_seg_zp2_k01_s0004.txt
DATA_FILE_0005=ccip_p9250_t09_a09_seg_zp2_k01_s0005.txt
DATA_FILE_0006=ccip_p9250_t09_a09_seg_zp2_k01_s0006.txt
DATA_FILE_0007=ccip_p9250_t09_a09_seg_zp2_k01_s0007.txt
DATA_FILE_0008=ccip_p9250_t09_a09_seg_zp2_k01_s0008.txt
DATA_FILE_0009=ccip_p9250_t09_a09_seg_zp2_k01_s0009.txt
DATA_FILE_0010=ccip_p9250_t09_a09_seg_zp2_k01_s0010.txt

or omit the count and just loop through the keynames till there are none left.

Or you could write and read/parse the file yourself, which I imagine you are trying to avoid :)


--
Chris Altmann
New That's nasty
And yes, I hate this "language" so much I'm
trying to avoid coding if possible. But looks
like I have no choice.

Care to tell me how to loop over the currently
selected items in a multi select list combo box.

I've tried deleting by index entries, selected
items, collections of indices, and other various
combinations.

At list point I'm deleting the 1st highlit one
and forcing the user to jot the button once for
each one, which I consider wrong.
New Re: That's nasty
If I had VB Classic here I'd give you actual tested code, but I only have VB.Net which will be different, so I'll have to refer to TFM:

[link|http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbpromultiselectx.asp|http://msdn.microsof...omultiselectx.asp]

and modify the example thusly:
\nPrivate Sub Command1_Click ()\n   Dim I\n\n   For I = 0 To List1.ListCount - 1\n      If List1.Selected(I) Then\n         List1.RemoveItem I\n      End If\n   Next I\nEnd Sub\n


A ComboBox can't have multiple select so I assume you misworded that and meant ListBox.

Also, here is an info on getting multiple filenames back from the File Open common dialog:
[link|http://vbnet.mvps.org/index.html?code/faq/cdlgmultiselect.htm|http://vbnet.mvps.or...lgmultiselect.htm]

--
Chris Altmann
New I'm VB Net as well
I got the multi-file names from box and loaded into the box.

But it doesn't seem that your code will work for me. Yes, trying to morph it to fit my scenario.

My "DataFileBox" is defined as a ListBox. ListBox does not have a ListCount. It seems you are referring to the Item() which is an ObjectCollection, which has a Count(). But then you check to see if the same indexed value is turned on in the Selected list. But the Selected list is a subset of the real list, and the indexes into to that should be the actual index into THAT list, not the matching index in the total list.

Am I using the wrong collection to start off with?
New My fault
I remembered a recent post by you (it was you wasn't it?) where you decided not to go with the latest greatest .Net and stick with the tried and true classic VB.

My code probably wouldn't work to well in VB.net.

I'll get you something more appropriate in a sec.
--
Chris Altmann
New No choice
You can't buy a VB that is not .NET. On the other hand, I'm treating it as a standalone program.
New VB.Net is far better anyways IMHO
Try this:
\n   Private Sub filenameBrowseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles filenameBrowseButton.Click\n        If filenameDialog.ShowDialog() = DialogResult.OK Then\n            filenameTextBox.Text = filenameDialog.FileName\n        End If\n    End Sub\n\n    Private Sub addFilesButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addFilesButton.Click\n        Dim fileName As String\n\n        If addFilesDialog.ShowDialog() = DialogResult.OK Then\n            For Each fileName In addFilesDialog.FileNames\n                filesListbox.Items.Add(fileName)\n            Next\n        End If\n    End Sub\n\n    Private Sub removeFilesButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles removeFilesButton.Click\n        While filesListbox.SelectedIndices.Count > 0\n            filesListbox.Items.RemoveAt(filesListbox.SelectedIndex)\n        End While\n    End Sub\n


--
Chris Altmann
New And re the INI files
You'll have to a find a wrapper similar to the one I posted to get to the old Win32 APIs for INI files from .Net

This might do the job:

[link|http://www.developer.com/net/asp/article.php/3287991|http://www.developer...ticle.php/3287991]

--
Chris Altmann
New Thanks, remove is good
The others I already coded using essential the same, except I stripped the full path.
     VB File pick list question - (broomberg) - (19)
         its built into browsers - (boxley) - (1)
             I got THAT part - (broomberg)
         Modal dialog box - (ChrisR) - (1)
             I must be emanating stupidity here - (broomberg)
         What's in the control file? - (lincoln) - (1)
             Ahh, close - (broomberg)
         Follow up - (broomberg) - (12)
             Re: Follow up - (altmann)
             Re: INI files - (altmann) - (10)
                 Is there such a thing as a multiline INI entry? -NT - (broomberg) - (9)
                     Re: Is there such a thing as a multiline INI entry? - (altmann) - (8)
                         That's nasty - (broomberg) - (7)
                             Re: That's nasty - (altmann) - (6)
                                 I'm VB Net as well - (broomberg) - (5)
                                     My fault - (altmann) - (4)
                                         No choice - (broomberg) - (3)
                                             VB.Net is far better anyways IMHO - (altmann) - (2)
                                                 And re the INI files - (altmann)
                                                 Thanks, remove is good - (broomberg)

Dad jokes are a socially acceptable way to fart on people.
113 ms