User Profile

Collapse

Profile Sidebar

Collapse
AdrianH
AdrianH
Last Activity: Dec 16 '10, 04:12 PM
Joined: Feb 4 '07
Location: Toronto
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Answer is to use the KeyPress not the KeyUp or KeyDown event. KeyPress will give out the key that was pressed including if a deadkey is used (used to add accents to letters).


    A
    See more | Go to post

    Leave a comment:


  • Cool, so what sort of scientific research are you doing that requires this sort of precision?


    A
    See more | Go to post

    Leave a comment:


  • Also, IIRC, white spaces are ignored unless expressly stated not to be. I.e. use %[ a-zA-Z_0-9] as a format string. So, your solution is a workaround, not a code correct solution.


    A
    See more | Go to post

    Leave a comment:


  • Well, I've retested with %Lf with the same results and resubmitted the bug. Looks like gcc 4.5.0 doesn't recognise %Lf for scanf, so it is either a bug or it hasn't been implemented yet. Also, to get printf to recognise %Lf, you need to change the standard settings with compiler flag -std=c99.

    Something else I forgot to do, but always did when I was using gcc is to use the -Wall switch. This will pick up many inadvertent errors in...
    See more | Go to post

    Leave a comment:


  • Please look at the bug report with the test code I submitted. It is a bug. It should not be responding that way.


    A
    See more | Go to post

    Leave a comment:


  • No, looks like a bug. Submitting to gcc bugzilla. Bug 46908


    A
    See more | Go to post

    Leave a comment:


  • the simplest way is:

    Code:
    printf("Press enter to continue...");
    fflush(stdout);
    scanf("%*s");
    See more | Go to post

    Leave a comment:


  • How to convert KeyEventArgs.KeyCode to what the keyboard is mapped to

    On a KeyDown event, I need to determine what the intended character was to be placed. How does one do this? It is driving me crazy as I do not want to use shift to determine how to map the numbers/symbols since this can change from language to language, keyboard to keyboard. There MUST be some function in Windoze .NET library to do this as to not have such a function would be ludicrous.

    Anyone know what function is needed?
    ...
    See more | Go to post

  • AdrianH
    replied to Does VBA not pass objects?
    Grrr, how do you friggn' quote in this thing? Cut/paste? There should be a button. :( There probably are parameters for [ quote ] too.



    Anyway, I'm not sure what your question is asking. Is the function that I wrote similar to the one you did? No, yours is strictly relative. Mine can mix the two. I've actually renamed it to CellsR1C1 because it is not just for offsets which could be confusing.

    Cells()...
    See more | Go to post

    Leave a comment:


  • AdrianH
    replied to Does VBA not pass objects?
    Oh, I just saw another reason why I don't want to use ActiveCell.Offs et(1,1). What if I want the rows to be offset but the columns to be absolute? ActiveCells.Off set(1,1) will not do that. But the function I made CellsOffset("R1 C[1]") will. In that example, rows are absolute, and columns are relative.

    Thanks again,


    A
    See more | Go to post

    Leave a comment:


  • AdrianH
    replied to Does VBA not pass objects?
    Ok, figured it out. The Range object was a Block object (is that equivalent to a stack object?). So to assign it, it needs to be Set.
    Code:
    Set myVar = Cells(1,1)
    As for why I didn't use ActiveCell.Offs et(1,1), well, I didn't know about it, and trying to find this information is like pulling teeth out of a toothless old lady. :(

    Thanks for the heads up. :)


    A
    See more | Go to post

    Leave a comment:


  • AdrianH
    replied to Does VBA not pass objects?
    Turns out that just by doing this:
    Code:
    sub b()
     myVar = Cells(1,1)
    end sub
    And tracing through will show that myVar is Empty.

    However if I do this:
    Code:
    function fn(myParam)
     myVar = myParam
    end function
    
    sub b()
     fn(Cells(1,1))
    end sub
    The act of passing it works, myParam contains a Range object, but still assigning it does not, myVar still is empty.
    ...
    See more | Go to post

    Leave a comment:


  • I couldn't get any additional info on the second problem. Does anyone have any idea on the first?

    Thanks,


    A
    See more | Go to post

    Leave a comment:


  • AdrianH
    started a topic Does VBA not pass objects?

    Does VBA not pass objects?

    Hi, I have tried to write a function that returns the object returned by Cells. I.e. Instead of writing:
    Code:
    Range(Cells(ActiveCell.Column-1, ActiveCell.Row), Cells(ActiveCell.Column-1, ActiveCell.Row)).Select
    I'd like to write:
    Code:
    Range(CellsOffset("R[-1]C"), CellsOffset("R[-1]C")).Select

    Here is the code that I wrote:
    Code:
    Sub test()
        Call Range(CellsOffset("R[-1]C"),
    ...
    See more | Go to post

  • .NET component take a while to load first time application run

    Wow, been a while since I've been on this site. Hello everyone!

    Anyway, I've been away and have been writing in a few new (for me) languages. One called LabVIEW from National Instruments (a GNU version is called Open G) and C#.

    I have a couple of issues and I am wondering if it occurs in other languages.

    Problem 1: when I first run the application with a .NET component that I created, there is a noticeable...
    See more | Go to post

  • Nsandy
    Nsandy posted a Visitor Message for AdrianH
    i have to create a text editor using c.
    n i want when the program runs a new file is opened.
    what should to do so?

    i have tried this..


    #include<stdio. h>
    #include<conio. h>
    void main()
    clrscr();
    FILE *fp;
    fp=fopen("untit led.txt",' w ');
    char line[80];
    scanf("%[^/n]",line);
    }
    See more | Go to post

  • india215
    india215 posted a Visitor Message for AdrianH
    how do I save ping results in a text file via c++?
    Below is a copy of my code.
    hrping here is an external program that works in a similiar manner as ping.

    Any advice will be greatly appreciated.



    #include <iostream>
    #include <string>
    #include <windows.h>

    using namespace std;

    static string host;
    static string ping_again;...
    See more | Go to post

  • Instead of using Math.floor(), and parseFloat(), you can use parseInt(var, radix); where var is the variable you are converting and radix is probably 10 in your case.

    BTW, why do you want to pass it on to javascript to sum the values? Why not do the summation on the ASP side and then get the asp page to write out:
    [code=asp]
    <%
    // You may have to do some clean up here to make sure the values are numbers...
    See more | Go to post

    Leave a comment:


  • AdrianH
    replied to Permission Denied XMLHttpRequest.open()
    What do you use? Straight HTML? If you have ASP, the concept can be modified. If just straight HTML, then try going to Google. and search for the three words: xmlhttprequest cross domain. There was a bunch of stuff there.


    Adrian...
    See more | Go to post

    Leave a comment:


  • Please indent, it makes it easier to read and understand what you are doing.

    As for your question, change
    [code=javascript] total = suma (primero, segundo)[/code]
    to
    [code=javascript] total = suma (<% echo primero %>, <% echo segundo %>)[/code]

    Please forgive me if I've not used the correct command to echo the values. I've not done ASP in a long while.

    Basicly,...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...