Comatose 290 Taboo Programmer Team Colleague

Well Visal, It Says "You Must Spread Around Some Reputation Before Giving More To inVisal", so, I'm giving you rep points by this post instead :)

Comatose 290 Taboo Programmer Team Colleague

Cool, I know why it does what it does, and it's because it only responds to user initiated events (getinputstate), It just makes it so that the user can interact with it... I wasn't sure if the speed increase was significant enough to warrant your use of it.... I don't personally use it, unless the application does an extreme amount of processing or calculations. I stick with the standard doevents... thanx for letting me know how it worked (or didn't in this case). :)

Comatose 290 Taboo Programmer Team Colleague

We Can Fix That Also, By using a quick API call, and only calling doevents if there is information waiting in the message queue for our app (since I can see you're concerned with speed ;)) In your declarations section of your form, OR in a standard code module, add this (assuming code module):

Public Declare Function GetInputState Lib "user32" () As Long

Then Just Replace the Lonely DoEvents With This Code:

If GetInputState <> 0 Then DoEvents

Let me know the speed difference if you would please :)

Comatose 290 Taboo Programmer Team Colleague

In a standard code module, add this:

Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Public Const GWL_STYLE = (-16)
Public Const WS_HSCROLL = &H100000

Then in your form load (or whatever) add this:

Dim lWindowStyle As Long
lWindowStyle = GetWindowLong(combo1.hwnd, GWL_STYLE)
lWindowStyle = lWindowStyle Or WS_HSCROLL
lWindowStyle = SetWindowLong(combo1.hwnd, GWL_STYLE, lWindowStyle)

That should work. Let me know how it turns out.

Comatose 290 Taboo Programmer Team Colleague

I think Visal certainly hit the nail on the head with that one. Doevents is the way to go. Do me one big favor, and let me know how it turns out.

Comatose 290 Taboo Programmer Team Colleague

Mkay, Here is the similar VB.NET Code, To split a string, and grab it's ubound of the return array:

Dim parts() As String
parts = TextBox1.Text.Split(" ")
WordCount = parts.GetUpperBound(0) ' /* I don't know if this need a + 1 or not */
Comatose 290 Taboo Programmer Team Colleague

It's in your if statement. When you use an OR, you have to apply a complete comparison on both sides. so:

If objNetwork.Computername = "COMPUTER1" or objNetwork.Computername = "COMPUTER2" then
     WScript.Quit
else
Comatose 290 Taboo Programmer Team Colleague

Alright, here is the VB6 Equivelant code for what you want to do. The same concept will apply in .NET, but I know that the syntax is different. I'll research the same code on google, and post the code for doing this in .NET.

Comatose 290 Taboo Programmer Team Colleague

do you have a sub or function with the name of xLoadList? If so, please post the code for that as well. If NOT, then the problem is you have an X before loadList ;)

Comatose 290 Taboo Programmer Team Colleague

I'm not 100% sure that I understand what you are asking. I know that you want to use a text file to be read into the script, but what I'm lost at, is are you wanting for the HTML that accepts the URL and number of hits to no longer exist, and have that information be replaced by the text file?

Comatose 290 Taboo Programmer Team Colleague

I don't have .NET, so I'll give you the breakdown of what I would do. There is a command, called "split" that allows you to rip a string apart, by a certain delimiter (character). It Returns an array. What I would do is split the string by space, and then test how many elements of the array there are. That may not tell you how many words, but it will certainly tell you how many parts of a string there is seperated by a space :)

Comatose 290 Taboo Programmer Team Colleague

Please don't duel post. I've been researching your project with little progress on the specifics of it. I'm still researching, and I will let you know as soon as I find anything. For now, I will send you to this discussion to read what I have found so far. I will be deleting your last post, as it is a duplicate of this one.

http://www.tek-tips.com/viewthread.cfm?qid=652778

Comatose 290 Taboo Programmer Team Colleague

I haven't really coded a whole lot in QBasic lately, all my work has been in Visual Basic... did you read the second posted link (http://www.aaroncake.net/electronics/qblpt.htm), and maybe that one would help a little more?

Comatose 290 Taboo Programmer Team Colleague

MrMike's post is the proper way to do it... I don't have your project, so I can't give you specifics, but here is a page that has a great tutorial on how to implement a progress bar in your application:
http://www.codeguru.com/vb/controls/vb_activex/activex/article.php/c7121/ I find that this progress bar is fairly easy to use... you just add 1 to the value, during your processing, but ultimately, you'll have to play with it in your app to see how to make it work for you.

I don't fully understand the second question you are asking. I see that it has something to due with duty and the date, but I'm not sure what you mean exactly. Let me know, and I'll see what help I can offer.

Comatose 290 Taboo Programmer Team Colleague

This site has a great tutorial covering ADO with VB6. This should help you out a lot. Let me know how it fair for you.
http://www.timesheetsmts.com/adotutorial.htm

Comatose 290 Taboo Programmer Team Colleague
parts = split(txtchat.text, " ")
RawCommand = parts(0)
Parameter = parts(1)
Cmd  = right(RawCommand, len(rawcommand) -1)

That Should Work ;)

Comatose 290 Taboo Programmer Team Colleague

;), and uh, the ten character post limit!

Comatose 290 Taboo Programmer Team Colleague

What method exactly are using to write to the file? You have posted no code, but I'm guessing that you are using "write" to write the information to the file. Change your write command to print. print #1, "your data" should work fine. Here is the code example that I just built to test this theory, (which was successful):

Private Sub Form_Load()
Open "c:\output.txt" For Output As #1
    Write #1, "write test"
    Print #1, "print test"
Close #1

For Each XFrm In Forms
    Unload XFrm
Next XFrm
End Sub

This works great on my box. I'm pretty sure that this idea spans as far back as QBasic, but I'm not sure if it goes on through .NET (since I don't use .NET). Let me know if this helps to solve your problem.

Comatose 290 Taboo Programmer Team Colleague

I don't remember 100%, but I think you are supposed to stick the progressbar.value=current_value in a timer, or some kind of "update" function so that you can have it keep track of where it's position is, relative the operation you are performing. So, if you are installing something, you have to know when you are 1/2 way through the install, so that the progress bar reflects that.

Comatose 290 Taboo Programmer Team Colleague

The only thing that this code does:

for ($i=0;$i<=$SIZE;$i++) {
   $_=$LINES[$i];
}

is loop through each line of the file, and sets the default variable ($_) to the next line in the file. Basically, it's reading the HTML file line by line, and replacing $_ with the next line after the loop. So, It reads line1, checks to see if it's <!--begin-->, and then does something if it is.... if not, it just reads the next line, and keeps doing so. Every time you see a "print GUEST" it's writing something new to the HTML document. This line here:

else {
      print GUEST $_;

Is actually writing "everything else" to the file. That's how it makes sure not to lose any other posts or anything. It just writes it back to the file. The reason the <!--begin--> exists, is solely so the script knows WHERE to add it's new record in the file. This also means that it doesn't reach the code posted above (the else), because the else only gets called should the line NOT be "<!--begin-->", meaning the stuff in the file doesn't get re-written. Give this a shot:

for ($i=0;$i<=$SIZE;$i++) {
   $_=$LINES[$i];
####THIS IS THE PART I ADDED#########################33
if (/<!--links-->/) { 
	print GUEST "<!--links-->\n";   # /* I Added This */
	print GUEST "TEST LINK<br>\n";
} else { # /* I Added This */

##########I ADDED THE STUFF ABOVE THIS LINE################

   if (/<!--begin-->/) { 

     if ($entry_order eq '1') {
         print GUEST "<!--begin-->\n";
      }
   
      
if ( …
Comatose 290 Taboo Programmer Team Colleague

I'm out of ideas on this one. I know that I was hoping that using tie would would allow you to access the elements of the child struct by using the parent struct as a hash-like system. I'm sorry, but I don't know how to do what you want. If you figure out a solution, please post so that I, and others who are dumbfounded by this, have the solution available. I would normally have suggested the use of a parent hash, with a child struct, but I know that wouldn't work for your project. Please let us know if you find the solution.

Comatose 290 Taboo Programmer Team Colleague

No No NO! By you posting questions, it gives me something to do other than chat in the IRC on this page :) Please, any questions at all, feel free to post! It's never a bother!

As for the code, Sometimes I write messy code, I just remember you saying that you were new to programming, and I am trying to help you out for the future. It's a lot easier to see, indented.... I never used to indent when I was new to code ;)

Comatose 290 Taboo Programmer Team Colleague

I don't care to harp, but you know, if your code was indented, you would be able to see it a lot more clearly. Let me show you:

on error resume next

Dim objNetwork
Set objNetwork = Wscript.CreateObject("Wscript.Network")
computerName = objNetwork.ComputerName

If objNetwork.Computername = "SERVER_NAME" then

	WScript.Quit

else

	dim oIE
	Set oIE = WScript.CreateObject("InternetExplorer.Application")


	TheDay = WeekdayName(Weekday(Date))

	if Theday = "Friday" then
		oIE.Navigate "file://FILENAME"
		oIE.Visible = True
	else

	end if
	
	set oIE = Nothing


WScript.Quit

public function ReturnDay
	RawDate = FormatDateTime(Now(), 1)
	Parts = split(RawDate, ",")
	ReturnDay = Parts(0)
end function

Now, after set oIE = Nothing, and before WScript.Quit, there should be an "end if." After indenting it, if you just follow the if, down to else, and then down, you see there is no end if for that if block :)

Comatose 290 Taboo Programmer Team Colleague

I'm pretty sure that if you tie the first struct, you can reference it as a hash, and then it will be like having a hash of structs. I could be wrong, but have you looked at:
http://search.cpan.org/~acalpini/Win32-API-0.41/Struct.pm

Read the section near the bottom that discusses using tied structs, and hopefully that will help. Let me know how it turns out :)

Comatose 290 Taboo Programmer Team Colleague

;) Me again!

Dim objNetwork
Set objNetwork = Wscript.CreateObject("Wscript.Network")
computerName = objNetwork.ComputerName

Will Return the computer name in question. Then you have pretty much already answered your own question with your psuedo-code above. (By The Way, You can put your code in the little boxes like the one above by putting them in code tags (without the spaces) [ CODE ] code here [ /CODE ]). Of Course, WScript.Quit might be better than exit!!!

I don't know how you plan to keep track of what people have logged in, so you know how is logged in and who isn't. I would suggest maybe a temporary file, that holds a list of computer names of people who have logged in (if the script runs on the server), or a file that notifies the script whenever they are logged in. Then, when they log out, just remove the file (or if on a server, the computer name from the file).
Good Luck!

Comatose 290 Taboo Programmer Team Colleague

Ah! Very good catch. Let me know how the project turns out, or if the methods that I suggested above worked... It'll be fancy to hear what happens. Also, If you encounter any other problems with it, don't hesitate to ask.

Comatose 290 Taboo Programmer Team Colleague

looked at TTPScan and gets error loading cswsk32.ocx on loading into vb.

You don't need it.... it uses winsock because it's on everyone's computer, the other is there just for the ping sweeper, and it's not needed for the port scanner.

I'll be willing to bet, the error that you are recieving however, is because the socket is still connected. With winsock, you have to use .state (socketwrench has a .connected property) to test if the socket is connected before trying to reconnect. So, you do a loop with a doevents in the middle, and wait for the socket's state to become closed. Another thing to take into consideration, is maybe instead of a for loop, try using a variable that keeps track of which server you are scanning, and when the list of scanned ports completes, if it's the last port to scan for that IP, on the socket's error or connect event, call a socket close (disconnect), and start on the next IP.
The problem with the for loop, is that it doesn't wait. It loops each iteration until it's done, and the only way to get it to stop is to break out of it or use a sleep. The sleep will pause your entire app though, not just the loop. So, we need to look at working with event driven looping. On Error, On Connect, On Close, etc. The socket is a control array, so it's not that difficult to check if we are …

Comatose 290 Taboo Programmer Team Colleague

I certainly didn't expect it's speed increase to be that much. Congrats on getting it to work faster than before, and should you need any help in the future, just ask.

Comatose 290 Taboo Programmer Team Colleague

I don't use winsock. It's functionality is limited in the realm of sockets, and to make matters worse, I find the code you need to work with it... well, leaves a lot to be desired. I prefer the use of a control that is free from http://www.catalyst.com, known as socketwrench. It makes working with sockets 100 times easier, and it gives a whole list of properties and methods that make winsock look like a joke. Anyhow, I have written a port-scanner in VB6, and you can download the source from this thread:
http://www.daniweb.com/techtalkforums/thread18197.html

Let me know if this helps! If you really MUST use winsock, maybe the concept behind how my port scanner runs will help give you the same idea to use with your winsock app.

Comatose 290 Taboo Programmer Team Colleague

it's my pleasure. On Another Note, I have written 3 tutorials, on writing your own CGI's with Perl. Right now it only covers checking if data exists, reading data from the page, and writing data to a file, but I plan to make a few more, and ultimately have it cover a how to build your own guestbook, or something similar. Whenever you have time, it might be beneficial for you to read them.... I've gotten a few requests for more, and a couple of questions sent to me through PM's about them, but they are fairly straight forward and easy to understand. Let me know if I can help you with anything else, and let me know the guestbook turns out for you.

CGI Tutorials:
http://www.daniweb.com/tutorials/forum84.html

Comatose 290 Taboo Programmer Team Colleague

Actually, I think you have it down pat. All you need to do is use the link like you showed above, at each story name, but like:

print GUEST "<a href=\"$FORM{'storyname'}\"><u>$FORM{'storyname'}</u></a><br>\n";

or maybe even:

print GUEST "<a href=\"" . $FORM{'storyname'} . "\"><u>$FORM{'storyname'}</u></a><br>\n";

But you have the concept and idea. Then to make the table at the top with the list of story names will be the only trick. I was thinking you could add it just like the other one, but you would have to have a reference point at the bottom of the table....like, just before </TABLE>, or something like that at the top. Example:

<TABLE>
     <TR>
          <TD>Link to Story 1</TD>
     </TR>
     <TR>
          <TD>Link to Story 2</TD>
     </TR>
     <!--add story here-->
</TABLE>

Then your perl code (near where <!--begin--> is):

if (/<!--add story here-->/) {
     print GUEST "<TR>\n";
     print GUEST "<TD><A HREF=\"#$FORM{'storyname'}\">$FORM{'storyname'}</A></TD>
     print GUEST "</TR>\n";
}

That should work out fairly well. You seem to grasp the idea. Don't forget to add the reference point for the table at the top or whatever you plan to do. Look to me like it should work a charm :)
Let me know how it turns out.

Comatose 290 Taboo Programmer Team Colleague

Not without editing the word file. If you could it would be ideal, and then just add a personalized clue on the same line as the word, separated by a delimiter. With that many words, however, that simply won't do. If the game is going to be online accessible, you could read the HTML output from something like "Thesaurus.com" or "dictionary.com" with the use of the thesaurus, rip apart the HTML, and grap a word that's a synonym. I know that these all seem fairly rough, but that's how I'd do it.

Comatose 290 Taboo Programmer Team Colleague

Well, I know that HTML allows you set labels.... such as:

<A name="section1">Introduction</A>

And Then You use the link such as:

<A href="#section1">Jump To Intro</A>

If they click on the link that says "Jump To Intro" it will jump (move the scroll bar and everything) down to the link with the name "section1". The problem I'm having, is that it looks to me like the cgi never accepts a story "name". For example:

$FORM{'realname'}
$FORM{'username'}
$FORM{'story'}

Ok, We have the persons real name, Their username, and their story (the content). I see no mention of a story "name" or "title" of the story. We can't do it by name or username, because then people can't post more than once, or it will throw things out of whack. Also, Keep in mind, that the CGI does NOT re-write the page. It only inserts itself into the top between <!--begin--> and the last posted entry. That means if you were to add a table or something in there, it would keep adding tables. You wouldn't be able to re-write the table, but you could probably add to it.

I personally don't care for matt's guestbook perl script. No offense, but I don't like his method. The problem with re-writing it to work differently, or to completly re-write one for your site specifically, would mean an awful lot of copy and pasting, and probably wouldn't be worth that much time. If we can find a way to get a …

Comatose 290 Taboo Programmer Team Colleague

I've been Looking at your code, and what you are wanting to do is going to be a little bit of work. It's a pain, because, the guestbook is saved as an HTML document, and then parsed and displayed. The reason this is a problem is because we have to set our reference point in the HTML document. If you view the script, you'll see the line that looks for a begin point: if (/<!--begin-->/) {, the <!--begin--> is actually an HTML comment, that is in your HTML document. If you were to load your guestbook in a web browser, right click, and view page source, you would see that line at the top just before the guestbook entries are displayed. That's the key to tell the script, that now begins the entries. I am posting to let you know that I haven't forgotten about you, but that I'm looking at methods that will work effeciently for this script.

Comatose 290 Taboo Programmer Team Colleague

The unfortunate answer is that VB ultimately only allows you to assign arrays as such. However, There is a minor solution that you can take into play. Depending on the data type, you can use different predefined functions in VB to return yourself arrays, but it's kind of crappy. There is a function, in VB4-6, Called "Array", but it will only assign variant data types, and to be perfectly honest with you, variant data types suck. They are huge, bulky, and make your program slower than needs be. They are really ugly variable, and should be avoided. You can use the function like this, however:

Dim theArray() As Variant
theArray() = Array("Spring", "Summer", "Fall", "Winter")

If The Data Type Were Strings, You could get fancy, and use the split function, but it's not really the same concept as you were wanting:

dim strArray as string
strArray = split("summer;winter;spring;fall", ";")

Or You can create a function to handle this, which is probably the best means of doing so. It's a bit of a pain, compared to a language like Perl, or Delphi, where assigning values is fairly easy.

Function ArrayInt(ParamArray values() As Variant) As Integer()
    Dim i As Long
    ReDim res(0 To UBound(values)) As Integer
    For i = 0 To UBound(values)
        res(i) = values(i)
    Next
    ArrayInt = res()
End Function

Let me know how this code works for you, and if you need any further assistance. I'll be glad to help.

The information referenced here, was taken …

Comatose 290 Taboo Programmer Team Colleague

I certainly appreciate you posting the working code and solution. This way others have the ability to learn from what we had just struggled with. Good Job, and Congrats :)

Comatose 290 Taboo Programmer Team Colleague

Method 1:
In your project, add a new standard module, and put this in it:

public Declare Function ExitWindowsEx Lib "user32.dll" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long

public const EWX_FORCE = 4
public const EWX_LOGOFF = 0
public const EWX_POWEROFF = 8
public const EWX_REBOOT = 2
public const EWX_SHUTDOWN = 1

public function Shutdown_Windows
     Dim retval As Long  ' return value
     retval = ExitWindowsEx(EWX_SHUTDOWN Or EWX_FORCE, 0)
     Shutdown_Windows = retval
end sub

public function Reboot_Windows
     Dim retval As Long  ' return value
     retval = ExitWindowsEx(EWX_REBOOT Or EWX_FORCE, 0)
     Shutdown_Windows = retval
end sub

Then In Your File Menu, You can use it like this:

retval = Shutdown_Windows()

Or To Reboot The System:

retval = Reboot_Windows()

Method 2:
Now, I'm not sure which version of windows you will be running this app on. An alternative method to using the API, is that if you are using a later version of windows, such as XP, and I think Win2k Also, There is a command for shutting down the system from the command line. You could use this in your app, if it will be used only on later versions of windows:

To Shutdown:

retval = shell("shutdown.exe -s", vbhide)

And To Reboot:

retval = shell("shutdown.exe -r", vbhide)

Wow, that was a bit long winded! I hope one of these methods works for you, please post and let us know how it turns out.

Comatose 290 Taboo Programmer Team Colleague

I just double click on the icon and it runs. I'm guessing perhaps your version of windows doesn't have the latest IE installed, or the latest WSH installed, if at all (thought it should). That said, try it the first way:

TheDay = ReturnDay()

if Theday = "Wednesday" then
     shell ("C:\progra~1\intern~1\iexplore.exe file://G:\CIHStaffNews.htm")
else

end if

WScript.Quit

public function ReturnDay
	RawDate = FormatDateTime(Now(), 1)
	Parts = split(RawDate, ",")
	ReturnDay = Parts(0)
end function
Comatose 290 Taboo Programmer Team Colleague
dim oIE
Set oIE = WScript.CreateObject("InternetExplorer.Application")



TheDay = ReturnDay()


if Theday = "Wednesday" then
	oIE.Navigate "www.google.com"
	oIE.Visible = True
else

end if
set oIE = Nothing
WScript.Quit

public function ReturnDay
	RawDate = FormatDateTime(Now(), 1)
	Parts = split(RawDate, ",")
	ReturnDay = Parts(0)
end function

This works perfectly fine on my machine. It spawns IE and loads google with no problem. Try to copy and paste the code I have posted here, into a document, and see if it works.

Comatose 290 Taboo Programmer Team Colleague

I'm willing to bet that the 1 to 3 minute loading process is due to the exchange of information on the back end. I'm not blaming Oracle, I'm blaming VB in the way that it works with Large amount of information. As for the speed in loading your combo box, you could consider using the API. You could use SendMessage, and there are a lot of windows messages for working with combobox's with the API. You would Need CB_ADDSTRING, in conjunction with Sendmessage. However, the speed increase would only be in transfering the data to the combobox, NOT in your application recieving the data and firing events to let you know it's there. Also, the speed increase may not be significant enough for you to alter your code for it's use.

The bad news, is that with that many records, the query process, along with other types of data retrieval and use, quite simply will take a long time. I wish the best of luck to you in your attempts to resolve this issue, and please, should you find a method of speeding up the process, post it so that we know how you did it.

Comatose 290 Taboo Programmer Team Colleague

I'm wondering if some of the properties to crystal require a specific data type:
ATMhist.SelectionFormula = "{TManifestHistory.date} = date ( " & ATMDate & " )" And "{TManifestHistory.FlightNo}='" & Combo2 & "'"

TManifestHistory.FlightNo, for example, might be expecting an integer, instead of a string (Returned from combo2), and if it's impartial to the data type, using combo2 without a specific property is a bad idea. Combo2.text would be a better solution to that. You might encase combo2.text with a val:

val(combo2.text)

Hope that helps.

Comatose 290 Taboo Programmer Team Colleague

Have you tried replacing file://G:\CIHStaffNews.htm with an actual URL? Such as google or yahoo, to see if it actually loads a web page? After changing .show to .visible did the IE window actually show up, and now you are getting a different error?

Comatose 290 Taboo Programmer Team Colleague

Read This Thread:
http://www.daniweb.com/techtalkforums/thread22650.html

As long as the network printer is installed as a printer on the system you are running the application from, this should help.

Comatose 290 Taboo Programmer Team Colleague

Oops. Just replace:

oIE.Show

with:

oIE.Visible = True
Comatose 290 Taboo Programmer Team Colleague

;), and ya know... 10 characters.

Comatose 290 Taboo Programmer Team Colleague

Yes, I'm pretty sure that IE has no idea what that share is. If it was assigned a drive letter, that might be a different story... but because it's not, I'm willing to bet that IE has no clue what it's looking at. If you could assign the share a drive letter, it should probably work.

Comatose 290 Taboo Programmer Team Colleague

And For Access Groups, it looks like you have it pretty well in play, but here is a link to a site that has a function and sample code for working with ADS with VBScript.
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/groups/#DetermPrimGroup.htm

Comatose 290 Taboo Programmer Team Colleague

"file://cih_data\IT\Public\CIHStaffNews.htm"

You Have a mapped drive called cih_data?

dim oIE
Set oIE = WScript.CreateObject("InternetExplorer.Application")

TheDay = ReturnDay()


if Theday = "Tuesday" then
	oIE.Navigate "file://cih_data\IT\Public\CIHStaffNews.htm"
	oIE.Show
	set oIE = nothing
else

end if

WScript.Quit


public function ReturnDay
	RawDate = FormatDateTime(Now(), 1)
	Parts = split(RawDate, ",")
	ReturnDay = Parts(0)
end function
Comatose 290 Taboo Programmer Team Colleague

I'm not 100% sure what an AD Group is.... if you can give me a little more light on that subject, I can probably help you out. As for retrieving the Day of the Week (say, Sunday - Saturday), I have written a function that returns the day of the week from the current day. Here is that function, just stick it at the very very bottom of your script (like, after wscript.quit):

public function ReturnDay
	RawDate = FormatDateTime(Now(), 1)
	Parts = split(RawDate, ",")
	ReturnDay = Parts(0)
end function

And you can call that function like this:

TheDay = ReturnDay()

You would probably use it like so:

TheDay = ReturnDay()

if Theday = "Friday" then
     ' /* Do Stuff Here For Friday */
else
    ' /* Do Stuff Here For Every Other Day */
end if

If you can get me a little more info on "AD", I'll see what I can do about retrieving the Group that the user belongs to.

Comatose 290 Taboo Programmer Team Colleague

If you surf over to this thread, you'll see an attachment of mine, that is a skeleton server. It's just the bare bones outline and functionality of a server. It takes a port number, and then it listens on that port. It accepts connections on that port, and displays whatever is sent to it in a msgbox. Here is the link for that:

http://www.daniweb.com/techtalkforums/threadnav20692-2-15.html

It's my very last post on that thread.