Comatose 290 Taboo Programmer Team Colleague

one of the textboxes needs to have the decimal point in it.... in text3 type in 2, in text 4 type in 3.3... now what?

In order to make it work with zeros, you need to look at "format" or format$

Comatose 290 Taboo Programmer Team Colleague

You can't take what is above and modify it for your needs?

label1.caption = CDbl(text3.text + text4.text)
Comatose 290 Taboo Programmer Team Colleague

You give me code first.

All you have to do is total the votes, and use a simple if statement.

Comatose 290 Taboo Programmer Team Colleague
MsgBox CDbl(1 + 3.3)
Comatose 290 Taboo Programmer Team Colleague

use shellExecute.

Comatose 290 Taboo Programmer Team Colleague

wtf is that? That doesn't answer his question.....

Comatose 290 Taboo Programmer Team Colleague

Very Nice.... please mark the thread as solved.

Comatose 290 Taboo Programmer Team Colleague

unless you are using option explicit, you don't need to declare it. Variables that are not declared in VB6 by default are of type variant. Variant is a powerful (but crappy, resource using) variable that basically gets implicitly cast based on how it's needed. So, if it's a number, but used as a string, then it becomes a string. If it's a string, that's used a integer, it becomes an integer...etc.
For each is a looping type that is sort of like a for loop, but you just tell it to loop through all of the known values of an array. In the code above, basically I say "for all of the items in the UserRecords() array, do this code" Since we are looping through an array of recvar (UserRecords()) then xname becomes a variable of type recvar between the words "for" and "next xname". Since xname is then of type recvar, xname has all of the elements of recvar, such as .Form, .Name, and .Age.

Comatose 290 Taboo Programmer Team Colleague

in your pause button just do:

time1.enabled = false
Comatose 290 Taboo Programmer Team Colleague

That depends entirely on how your game works.... are you using a timer control for your loop? Are you just doing a big ass while loop and putting your code in that? The code for the pause button will differ based on your method of implementation.

Comatose 290 Taboo Programmer Team Colleague

Very good. You can mark the thread as solved now.

Comatose 290 Taboo Programmer Team Colleague
if right(ucase(text1.text), 1) <> "R" then
     text1.text = text1.text & "R"
else
     text1.text = "0" & text1.text
end if

...

Comatose 290 Taboo Programmer Team Colleague
SELECT * From table where LOWER(name) = 'neil'

?

Comatose 290 Taboo Programmer Team Colleague

How about making your own thread instead of posting on one that is 4 years old?

Comatose 290 Taboo Programmer Team Colleague

HELLO
Can sombody tell me how can i chang the color of concol background????

HELLO... can someone tell me how I can get people to quit posting on ancient old threads?

Comatose 290 Taboo Programmer Team Colleague

I'm not sure you can put winsock in permiscous mode. I know most sniffers come with like winpcap and what not...

Comatose 290 Taboo Programmer Team Colleague
Comatose 290 Taboo Programmer Team Colleague

Is my only option to install VB2008 Express on a 64 bit machine and create a separate 64 bit version?...

Yup. If you recompile it on a 64-bit vista platform, it should work.... other than that, good luck.

Comatose 290 Taboo Programmer Team Colleague

And... Let's not post to threads that are years old.

Comatose 290 Taboo Programmer Team Colleague

*Just Shakes His Head*

Comatose 290 Taboo Programmer Team Colleague

Use VB.Net.... not VB 6 :)

Seriously, I like VB6 a thousand times more than .NET, but the fact is, that code is meant for the .NET platform. VB 6 is not quite that object oriented and structured. I suggest however, that to do the same thing in VB6, use WSH. Using the native VB commands to modify the registry (all API Calls) is really ugly. So I guess something like:

Dim wsh
Set wsh = CreateObject("WScript.Shell")
wsh.regwrite "HKCU\testkey\", "hi", "REG_SZ"
Set wsh = Nothing
Comatose 290 Taboo Programmer Team Colleague

you can pretty much do what riju_sh02 said, but you could replace chr(13) with vbnewline. The constant is pretty much just a chr(10) and chr(13) (crlf, you can use vbcrlf too)

Comatose 290 Taboo Programmer Team Colleague

yeah a unique record ID would be the best way to go, because what if you have more than one Matt? How then will you distinguish him from another Matt? The code however for what you have, without the need to complicate it with userid's, would be, in your "load" function, to make an array that keeps all the record data, and then sort through it when you want to pull up a specific item. For example:

global UserRecords() as recvar ' // Put This In Your Module

Private Sub cmdLoad_Click()
    ReDim UserRecords(0)
 
    position = 1
    Open App.Path & "\userfile.txt" For Random As #1 Len = Len(users)
        Do While Not EOF(1)
            Get #1, position, users
             If UBound(UserRecords()) > 0 Then
                  ReDim Preserve UserRecords(UBound(UserRecords()) + 1)
                  UserRecords(UBound(UserRecords())) = users
             Else
                  UserRecords(0) = users
             End If
  
             listUsers.AddItem (users.Name)
             position = position + 1
        Loop
    Close #1
End Sub

Now, you should have a global array, called "UserRecords()" which is an array of type "recvar" (users). At This point, later when you need to call up a record, you can pretty much do:

Private Sub cmdLaodInfo_Click()
     for each xname in UserRecords()
          if xname.Name = listUsers.list(listUsers.listindex)     
                 frmMain.txtLoadNme.Text = xname.Name
                 frmMain.txtLoadAge.Text = xname.age
                 frmMain.txtFormLoad.Text = xname.Form
     next xname
End Sub

or something like that (I haven't tested this, so, it could have bugs. You may need to adjust accordingly)

Comatose 290 Taboo Programmer Team Colleague

In C++ A Struct IS a Class. The only difference is that in a class, the members by default are private. In a Struct, they are by default public.

Comatose 290 Taboo Programmer Team Colleague

Are File1 File2 and File3 supposed to be variables in your program, or are they hard-coded in names?

Comatose 290 Taboo Programmer Team Colleague

Well, Visual Basic and VBA (Visual Basic For Applications) are NOT the same. Visual Basic (And This Forum is VB 4/5/6, NOT .Net, which is also different [ie: VB express, VB 2005, VB 2008, etc]). That said, code that would often work in VB 6, such as the code I posted with sendmessage, will not work if you are in VBA (VB inside of Access). Now, you could normally get away with selecting and deselecting the listbox in Access, like so:

Me.mylistbox.Selected(Me.mylistbox.ListCount - 1) = True
Me.mylistbox.Selected(Me.mylistbox.ListCount - 1) = False

I believe I also read somewhere that you can pass the DESC sql key word to make it sort the data in the listbox by descending order, which automatically scrolls the listbox... but I haven't tried that.

Comatose 290 Taboo Programmer Team Colleague

Dunno why you don't just do the copy from within VB.NET (without a system call)

Comatose 290 Taboo Programmer Team Colleague

oof. That's a heck of a job. I would imagine you would need to include the header in the other files as well, and PROBABLY have to modify the header so that it holds the new size of the split file.

Comatose 290 Taboo Programmer Team Colleague

your last else if is missing an opening and closing brace. { }

And in a couple of spots, you are using parenthesis where they should be braces.

#include <iostream>
using namespace std;

int main ()
{
    int choice,num1,num2,answer;
    cout<<"This is a caculator program which will do math for you\n";
    cout<<"Please Choose From one of 4 math operators\n";
    cout<<"1 +\n";
    cout<<"2 *\n";
    cout<<"3 -\n";
    cout<<"4 \\n";
    cin>>choice;
    if (choice==1){
        cout<<"please enter in two numbers to add" <<answer<<endl;
        cin>>num1;
        cout <<"you entered"<<num1<<endl;
        cin>>num2;
        cout<<"you entered"<<num2<<endl;
        answer=num1+num2;
        cout<<"the answer is "<<answer<<endl;
    } else if(choice==2) {
        cout<<"please enter in two numbers to multiply" <<answer<<endl;
        cin>>num1;
        cout<<"you entered"<<num1<<endl;
        cin>>num2;
        cout<<"you entered"<<num2<<endl;
        answer=num1*num2;
        cout<<"the answer is "<<answer<<endl;
    } else if (choice==3) {
        cout<<"please enter in two numbers to subtract" <<answer<<endl;
        cin>>num1;
        cout<<"you entered"<<num1<<endl;
        cout<<"num1/\n";
        cin>>num2;
        cout<<"you entered"<<num2<<endl;
        answer=num1-num2;
        cout<<"the answer is "<<answer<<endl;
    } else if(choice==4) {
        cout<<"please enter in two numbers to divide" <<answer<<endl;
        cin>>num1;
        cout<<"you entered"<<num1<<endl;
        cin>>num2;
        cout<<"you entered"<<num2<<endl;
        answer=num1/num2;
        cout<<"the answer is "<<answer<<endl;
    }


return 0;
}
Comatose 290 Taboo Programmer Team Colleague

Just out of curiosity: Would this also be true for 2 HD's in RAID 0?

absolutely not.... 2 HD's in RAID 0 :)

Comatose 290 Taboo Programmer Team Colleague

Actually, even with threading, the hard-drive can still only do one thing at a time. So, you'll likely have one thread blocking on the HD to finish the write from the previous thread before the second thread even gets a chance to do anything.

Comatose 290 Taboo Programmer Team Colleague

just check for the newline characters and replace them...something like:

$linefromfile =~ s/\n//gi;

Just remember though, that you will have to manually add your own newline character ("\n") whenever you want to save the data to the new file... otherwise it will be one big ass line. :icon_eek:

Comatose 290 Taboo Programmer Team Colleague

The problem is, I have no idea if that entry that you posted for the registry is a value or a key, or if it's a string or a dword or whatever....

Comatose 290 Taboo Programmer Team Colleague

I was recently trying to do this myself for a business project at work. What I learned was, that the ID was the same for all the chips in my computer lab (same manufacturer). After reading a while, I learned that by default, Intel now has the processor ID disabled. So, in the end, we went with using the MAC address of the network card for computer identification. The only problem is, if they change their NIC card, then they lose their ID also....

Comatose 290 Taboo Programmer Team Colleague

aha, maybe you should put the entire thing inside of the while loop ;)

Comatose 290 Taboo Programmer Team Colleague

I wonder if the

#if (_WIN32_WINNT >= 0x0501)

isn't working correctly... (In ws2tcpip.h)

Comatose 290 Taboo Programmer Team Colleague

have you tried outputting the value of $thinkingof during each guess? This will help you to at least ensure that the randomness works.

Comatose 290 Taboo Programmer Team Colleague

Then you are going to have to declare a new array of the new size... copy the data over from the "old" array, and free the old memory.

EDIT: Alternatively, you could implement it behind the scenes as a vector instead of an array....*shrugs*

Comatose 290 Taboo Programmer Team Colleague

Are you using VB 4, 5, or 6?
And if you are copying and pasting you are removing the line numbers?
What is the error message?

Comatose 290 Taboo Programmer Team Colleague

it looks like when you pass 0 to the constructor, that number is used as the size of your new array...

maxlen=size;
top=-1;
p=new int[maxlen];

Then you try to push 1 on to it...but it's size is zero.... or am I crazy?

Comatose 290 Taboo Programmer Team Colleague

ah, yes... I was thinking file.readall :/

Comatose 290 Taboo Programmer Team Colleague

My Bad, I forgot a Parameter:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
      
Private Sub Form_Load()
url = "http://www.hotmail.com"
ShellExecute Me.hwnd, "open", CStr(url), "", "c:\", 1
End Sub
Comatose 290 Taboo Programmer Team Colleague

In his code above, just remove the My.Computer.

Comatose 290 Taboo Programmer Team Colleague

Is this homework, or what is it that you want to accomplish?

Comatose 290 Taboo Programmer Team Colleague

:$ yup he's right.... std::string is a class, and .c_str() would convert it to a c style string... then the cast would make it the ascii value of the number, not the actual number. Sorry about that.

Comatose 290 Taboo Programmer Team Colleague

wm6?

If Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName).Length > 1 Then
     MsgBox("Already Running")
     End
End If
Comatose 290 Taboo Programmer Team Colleague

At the very top of your form:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Then in your picturebox_click:

shellexecute me.hwnd, "open", cstr(url), "c:\", 1
Comatose 290 Taboo Programmer Team Colleague
regsvr32 OPOSPOSPrinter.ocx
Comatose 290 Taboo Programmer Team Colleague

line 79.... q.queue[q.rear] = put_inq; You are assigning an entire struct to this other struct (they are not the same kind of struct)? put_inq might need to have a member attached?

Comatose 290 Taboo Programmer Team Colleague

go to a dos prompt (start, run, cmd) go to your DarkGDK include folder (cd \program files\DarkGDK\Include) probably, and do for %x in (*) do type %x | find /i "#define" >>c:\outputfile.txt . Then, double click my computer, double click C: drive, double click "outputfile.txt", and read it.