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 VB File pick list question
I have a system that is control file driven. Users have to construct a control file and submit it to a directory that gets "sweeped" to initiate action.

I figure I'll give them a pretty UI to generate the file.

So I've got the shell of the interface so far, ie:
A menu bar the has Open, Open From Template, Save, Submit Job.
A tabbed interface.
The 1st page of the tabs has a few field that are "Job", "Project", "Project File", and then a list box that will contain data files.

About 8 years ago I wrote the same type of interface where I would have a button that launched a picker for files. So you would wander a file tree, and then select a bunch of files, which would end up in the list box. There were also "Remove" highligh files from the box button. It this already a control that is available to me to will I be writing it again?
New its built into browsers
open file-location, save as new file
thanx,
bill
These miserable swine, having nothing but illusions to live on, marshmallows for the soul in place of good meat, will now stoop to any disgusting level to prevent even those miserable morsels from vanishing into thin air. The country is being destroyed by these stupid, vicious right-wing fanatics, the spiritual brothers of the brownshirts and redstars, collectivists and authoritarians all, who would not know freedom if it bit them on the ass, who spend all their time trying to stamp, bludgeon, and eviscerate the very idea of the individual's right to his own private world. DRL
questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
New I got THAT part
Silly.

No, my issues is how I handle them when I'm juggling a list in an interactive interface.

I'll follow up with screen shots in a bit so you see what I'm trying to do.
New Modal dialog box
Haven't used VB in years, so this is just from memory. You still have to build the window into the app, but there are file dialog gadgets that can be built into a modal window. The file name selected can then be used by the app to save the file to the appropriate place.

New I must be emanating stupidity here
I'll follow up with screen shots.
New What's in the control file?
Does it contain all sorts of parameter information? And/or any filenames?

If I understand correctly, the listbox contains whatever files the user wants to have affected by the control file. When the user is finished selected files, they select "submit" from the menu, the code reads the listbox and creates a control file within your swept network folder. Or are the files themselves being moved into the swept folder?

The code underneath the events will be minimal; I'm confused as to what you expect a pre-written control to do for you in this case.

lincoln
"Windows XP has so many holes in its security that any reasonable user will conclude it was designed by the same German officer who created the prison compound in "Hogan's Heroes." - Andy Ihnatko, Chicago Sun-Times
[link|mailto:bconnors@ev1.net|contact me]
New Ahh, close
Scary that you are the only one who understands me, ehh?

Give me a bit for a better explanation.
New Follow up
OK, here's the current 1st screen:

[link|http://www.voicenet.com/~broom/pnt_sub.jpg|http://www.voicenet....broom/pnt_sub.jpg]

The goal here is to be able to save, load, and
"submit" jobs. So everything you see should
be populated by the previously saved job if
there is one.

The elipses buttons launch either file or dir
pick boxes which then populate the text box.

The email address will become a multi-select with
the ability to add more.

The data file "Get Data" button launches a
multi-select pick box which then populates the
list.

Other tabs such as "Spool Sheet" and "Job Control"
are mostly fill in the blank or check box forms.

Status and Logs will have to get an ODBC connection
to a PostGreSQL instance running on the spooler box.
The back-end spooler engine will post messages and
logs to it, which in turn can be read "here".

The "SGE Status" will possibly poll an local web
server that has CGIs that show the status, or I'll
do some SOAP (possibly) interface into it.


The final result is a flat file that looks something like
this:

\nJOB=P9250A09\nPROJECT=P9250\nCLEAR_LOCKS=0                                                                   \n#\n#\n##################################################\n#\n# PrintNet Workflow file\n#\n##################################################\n#\nPNT_WFD=newwidenelnet.wfd\n#\n##################################################\n#\n# 1 or more data files.  List them in order that\n# you want them spooled.  They must be the output\n# from the production step.  The information\n# such as segment, lrecl, etc, should be in the previous\n# control file that was used to create them.\n#\n##################################################\n#\n#\nDATA_FILES=\nccip_p9250_t09_a09_seg_zp2_k01_s0001.txt\nccip_p9250_t09_a09_seg_zp2_k01_s0002.txt\nccip_p9250_t09_a09_seg_zp2_k01_s0003.txt\nccip_p9250_t09_a09_seg_zp2_k01_s0004.txt\nccip_p9250_t09_a09_seg_zp2_k01_s0005.txt\nccip_p9250_t09_a09_seg_zp2_k01_s0006.txt\nccip_p9250_t09_a09_seg_zp2_k01_s0007.txt\nccip_p9250_t09_a09_seg_zp2_k01_s0008.txt\nccip_p9250_t09_a09_seg_zp2_k01_s0009.txt\nccip_p9250_t09_a09_seg_zp2_k01_s0010.txt\nEND=DATA_FILES\n#\n#\n##################################################\n


I have a program sweeping a directory that the
workstatations have Samba mounted (Thanks Greg).

They drop the file there, it gets submitted
into the spooling engine, stuff happens, email
gets sent, spool control sheets are printed / emailed,
proofs are produced, really big spool files get placed
on the final print control server, approval happens,
print run commences.


The various drop down boxes in this program should be
externally populated by reading an INI file so a
programmer is not required to add things to the drop-down
lists. I can't find a ReadINI/WriteINI interface.
I could have sworn it was in the last VB I worked in
years ago!

So now do you have a better idea of what my questions
mean?
New Re: Follow up
I don't think either the textbox/button or the listbox/buttons controls come with VB. They don't come with VB.Net, which is all I have here. The former control may exist as a 3rd party control but by the time you find one you could have written the 2 lines of code it takes to implement it. The other control would take a few more to loop through the multiple selections and add them to the listbox. A few more for the remove items button and you're done.

I took your original post to be asking if there was a pre-existing file dialog control, which there is.

--
Chris Altmann
New Re: INI files
[link|http://www.officecomputertraining.com/vbtutorial/tutpages/page40.asp|http://www.officecom...tpages/page40.asp]
--
Chris Altmann
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)

I'm paraphrasing, because it's easier than research.
140 ms