Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: DanJC
  • Order by date
  1. DanJC

    Migrating from Cognos 6 to 7.3

    Ok, here's a funny for you. Something I didn't pick up on is the knock on effect of changing date formats in ODBC. Each date format treats a different day as the start of the week. As a result, one of the sql functions I was using to generate a total by week: Dateadd(weekday...
  2. DanJC

    Migrating from Cognos 6 to 7.3

    We carried out a thorough investigation with this date issue and it was the silliest of problems. The error was not generated by Impromptu but by the ODBC connection. In order to get the date corrected we had to change the default language format of error message from British English to US...
  3. DanJC

    Migrating from Cognos 6 to 7.3

    I'm piloting a migration from Cognos 6 to 7.3 and I've found some really bizarre stuff so far. The way in which Impromptu interprets the Today() function has changed. I am using it in conjunction with MS SQL Server and instead of using the current system date, Impromptu converts the system...
  4. DanJC

    C programming novice question-Saving data in a structure.

    I am looking at this and missing something, is it not possible to simply use: for(index = 0; index < recordcount; index++) { fwrite(struc[index], sizeof(struc[index]), 1, fp); } ???? DanJC 'You pay peanuts you get .....'
  5. DanJC

    Forms in C part 2

    Ok peeps, C++ makes it a lot easier to create forms/fields than C does so here is some code that may help C programmers: //define field structure struct field { int h_pos, v_pos, width; char caption[35]; char *value; } form1[10]; //display form void disp_form( struct field form[], int...
  6. DanJC

    Forms in C

    That makes sense, thanks.
  7. DanJC

    Forms in C

    Not quite, I want point_to_data to point to one of the data members of the rec1, not the whole record. The idea is to have the form showing one record at a time. This means that each field in the form should be one part of struct myrec. If only my assignment would allow me to use C++...
  8. DanJC

    With

    I am lazy!! I don't want to have to write out a struct's full name any time I want to reference one of it's members. Is there a with statement (or equivalent) in C e.g. struct mystruct { int item1; char item2; float item3; } struct1[20]; for(index = 0;index <20; index++) { with...
  9. DanJC

    Forms in C

    I am attempting to create a form in C using the following concept. I create a field struct: struct field { int index; void *point_to_data; char *caption; int hor_pos, ver_pos; } myform[15]; I also create a record struct to store data; struct myrec { char *item1; char *item2...
  10. DanJC

    Date entry evaluation

    Worth noting that 100 and 400 are both factors of 4 so you do only need to use x % 4. You can expand the struct to include different month name formats and if you're brave use binary tree search
  11. DanJC

    Date entry evaluation

    Worth noting that 100 and 400 are both factors of 4 so you do only need to use x % 4. You can expand the struct to include different month name formats.
  12. DanJC

    Date entry evaluation

    Folks, There are probably better ways than this but I hope this will spark some ideas. If you want to test a users date input for validity, try using this to define your years!! Struct Year { struct month { int no_of_days; char *name; //optional field if you want month names }...
  13. DanJC

    Validating input

    It looks to me like in case 1>. you are returning the address of the variable rather than the value of it. This means that in the first case, although the variable will hold it's value outside of the function you can still manipulate the value by using a pointer to it. In the second case you...
  14. DanJC

    Validating input

    I tried this method, My compiler has a problem with scanf, where it looks for full stop characters as well as null string terminators and keeps producing the error &quot;scanf : unable to link to float types&quot; does this mean that i need to use getch/getche()? If i do, how do i move through...
  15. DanJC

    Validating input

    I didn't realise it was that easy, Thanks very much, I bow to your knowledge. DanJC &quot; The mind is like a monkey and it jumps around.... &quot;
  16. DanJC

    Validating input

    Can anyone tell me how to test input for a datatype? I want to be able to read input into a float variable but also to identify if the user input is not compatible with a float before the program throws out an error and dies. If I read into a char * then I can't convert the input to a float...
  17. DanJC

    Creating a dynamic array in C

    Thanks for your advice folks, I have gone so far as to create a bi-directional linked list based on what you have told me. I have another post with regards to formatting and input masks, does anyone have any ideas?
  18. DanJC

    Sorting a structure

    Have you tried creating a linked list? use struct pointers and the malloc function to create new records (look at the dynamic arrays post). Then you can add pointers to the previous and next records in your list as you go along. This means that you can change the pointers to change the record...
  19. DanJC

    Creating a dynamic array in C

    I am currently on a college course where this stuff would be useful, would the following code work if I was using a struct datatype? struct a { ... ... } test[]; test[1] = malloc(sizeof(struct a)); ..... ..... free(test[1]); I am planning to use this in my coursework but I haven't had...

Part and Inventory Search

Back
Top