User Profile

Collapse

Profile Sidebar

Collapse
bmerlover
bmerlover
Last Activity: Aug 1 '13, 02:57 AM
Joined: Jul 13 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks a lot for your help! That pretty much did the trick, I made a few slight modifications but it's following your idea. Thanks again!

    Code:
    #include <stdlib.h>
    #include <stdio.h>
    #include <conio.h>
    
    #define MAX_CNT 3
     
    typedef struct
    {
       int nNum;
       int nCnt;   
    }sDummy1;
     
    typedef struct
    {
       int nAge;
       double
    ...
    See more | Go to post

    Leave a comment:


  • thank you for the quick reply, unfortunately I have to use the language C. It can not be C++ or any other language.
    See more | Go to post

    Leave a comment:


  • How do you create a table with variables from multiple structs?

    Hi, I would like to create an array of struct variables inside a table to avoid using many if/else and/or switch/case statements. I have attached a simple example of what I am trying to do, it doesn't work. For the table "sTablePtr" I see different values than what I set, when I dereference it with a "&" it just shows me the addresses of the variables. However at the end, when I do print out the values, by just using the structs...
    See more | Go to post

  • bmerlover
    replied to Copy String^ to CheckBox^
    in .NET
    Found answer - less optimal

    I found the answer if anyone runs into this problem. Instead of 300 if else statements to compare the checkbox names to strings, i found this to be a better method although not as efficient as I would hope.

    I saved colums of checkboxes to a checkbox array. Then I would check each checkbox name with the string I read from the file. If there is a match, then check the checkbox and return so...
    See more | Go to post

    Leave a comment:


  • bmerlover
    replied to Copy String^ to CheckBox^
    in .NET
    Oh I forgot to metion,

    I know I can do it with an if condition such as. The only problem with this approach is that I have many checkboxes, so I am trying to avoid this method.

    thanks again

    Code:
    if(lines[i]->CompareTo("checkBox1") == 0)
    {
        checkBox1->checked = true;
    }
    else if(lines[i]->CompareTo("checkBox2") == 0)
    {
    ...
    See more | Go to post

    Leave a comment:


  • bmerlover
    started a topic Copy String^ to CheckBox^
    in .NET

    Copy String^ to CheckBox^

    Hello,

    I have written my code in Visual C++ using .NET Framework. I have several checkboxes on my GUI and I would like to give the user the option of saving the current state of the checkboxes. I took care of the save file, now the loading of the file is where I have my problem. The checkbox names are saved in the file, when the user loads this file back into the GUI, I read the checkbox names line by line and I am suppose to check...
    See more | Go to post

  • I found out what the problem was, when the timer started, the file was already closed because of the fclose statements at the bottom of findPacketHeade r. So I rearranged the code to something similar to this. Thanks for replying, I appreciate the inputs.

    Code:
    void findPacketHeaders(char *inputFile, char *outputFile) 
    { 
        pktHeader.packetSyncPattern = 0xEB25; 
      
        /* Open file */
    ...
    See more | Go to post

    Leave a comment:


  • Well, I tried printing what fgetc outputs which is -1 all the time or the hex representation is FFFFFFFF. It seems like the fgetc isn't working correctly inside the timer function.
    See more | Go to post

    Leave a comment:


  • How to read a file in a timer function in Visual C++ using .NET

    How can you read a file in a timer function? I am currently using a do while statement to read a file which works fine. The implementation is in C but I've added the code to a C++ .NET framework GUI app. This is the implementation that works:

    Code:
    void findPacketHeaders(char *inputFile, char *outputFile)
    {
    	/* Open file */
    	fpInput = fopen(inputFile, "rb");
    	fpOutput = fopen(outputFile, "w");
    ...
    See more | Go to post

  • Thanks Banfa for the information, I looked into it. This is the solution I found with help.

    This is the final version, I actually needed one specific cell (column index 0) from the row that was being deleted, so hence this code works great.

    Code:
    //for people viewing this thread, you need to add an event handler in your Windows Form Designer generated code portion. Without it, this won't work.
    //Shown
    ...
    See more | Go to post

    Leave a comment:


  • Thank you very much, worked like a charm. This is the final version, I actually needed one specific cell (column index 0) from the row that was being deleted, so hence this code works great.

    Code:
    //for people viewing this thread, you need to add an event handler in your Windows Form Designer generated code portion. Without it, this won't work.
    Shown here:
    this->dataGridView1->UserDeletingRow += gcnew
    ...
    See more | Go to post
    Last edited by bmerlover; Dec 11 '08, 06:24 PM. Reason: added the eventhandler portion in the windows generated code portion to show the complete method thanks to RAMK

    Leave a comment:


  • Help with DataGrid and MemberwiseClone() Visual C++ using .NET

    I am currently using Visual Studio 2008 Pro edition programming a windows form application using Visual C++.

    I am using datagrids, the user can populate fields with data. I am not using datasets because the information doesn't have to remain once the app has closed. When the user selects a row and deletes it with the "Delete" key on the keyboard, I want to trigger an event. I got it to this point but now I am having a problem...
    See more | Go to post

  • Help with DataGrid and MemberwiseClone() Visual C++ using .NET

    I am currently using Visual Studio 2008 Pro edition programming a windows form application using Visual C++.

    I am using datagrids, the user can populate fields with data. I am not using datasets because the information doesn't have to remain once the app has closed. When the user selects a row and deletes it with the "Delete" key on the keyboard, I want to trigger an event. I got it to this point but now I am having a problem...
    See more | Go to post

  • bmerlover
    replied to Read from terminal using Perl
    in Perl
    KevinADC you were right, I ran the perl application from the terminal and <STDIN> pauses for the user to input something. So it's the other script that's calling this perl application that's causing <STDIN> not to operate correctly.

    Again, thanks for the help guys!
    See more | Go to post

    Leave a comment:


  • bmerlover
    replied to Read from terminal using Perl
    in Perl
    Yes, I think you're right KevinADC. It somehow doesn't have access to the terminal, its just that since this perl application displays the contents on the terminal, I thought it would also prompt the user. I will call this perl application straight from the terminal to see if <STDIN> is working. Once I find that in this case it does work, then that confirms what you are saying.

    Jeff, I understand what you are saying. My reasoning...
    See more | Go to post

    Leave a comment:


  • bmerlover
    replied to Read from terminal using Perl
    in Perl
    I just tried that and it still doesn't seem to work. It doesn't prompt the user, instead it gives these errors:

    use of unitialized value in chomp at line 515.

    use of unitialized value in numeric eq (==) at line 519
    use of unitialized value in numeric eq (==) at line 519
    use of unitialized value in numeric eq (==) at line 519

    line 515 contains chomp ($result = <STDIN>);
    line...
    See more | Go to post

    Leave a comment:


  • bmerlover
    replied to Read from terminal using Perl
    in Perl
    The program itself is not a GUI. This perl application is called from some other script and the perl application displays the results in the terminal. I just want it to ask the user a question in the terminal and depending on the choice the user selects, it takes the a specific route to find an alternative. This is run on Solaris 8 OS. The script itself with slight modifications works find on a windows xp operating system using the command prompt....
    See more | Go to post

    Leave a comment:


  • bmerlover
    replied to split function usage
    in Perl
    I'm not sure if you specifically need the split function or not. I usually use the index() and rindex() function to seperate the directory paths from each other. For example: if you want to split c:\program files\software\ specific. And you wanted to split "specific" from the the rest of the directory path. I would do the following:

    Code:
    #you want to add 1 because you want to skip "\"
    $index_num
    ...
    See more | Go to post

    Leave a comment:


  • bmerlover
    started a topic Read from terminal using Perl
    in Perl

    Read from terminal using Perl

    I would like to know how to prompt the user for an input on the terminal. I have a print statement which asks for 3 choices and use <STDIN> to prompt the user for an input. This code works perfectly with DOS but I need it to work on the terminal. I don't know how to read from terminal. I looked up some shell scripts and it says read CMD but that command doesn't work in Perl.

    Code:
    print "Choose a means of transportation:\n\n";
    ...
    See more | Go to post

  • bmerlover
    replied to Read a line by characters
    in Perl
    Thanks a lot for the solution, I looked into it when you gave me the recommendation for the regex. This is the solution I came up with. I strip all the leading whitespaces and check if it's a comment or not. That's how I know it's a line of code. There is one flaw if the comment is before the line of code (/* */ code;) But that's a case that I'm not looking for.

    Code:
    s/^\s+//; #strip leading whitespace
    
    if(/^[^\/*]/)
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...