I was trying to inject the results into a datetime column in SQL via ODBC, but between the 2, it was hard to nail down the error. I didn't know if it was the format of the data, or ODBC not wanting to accept the LPSYSTEMTIME structure, or the size/precision of the data, which for some reason is 23,3.
Ended up with this for now, it works, I can modify it later if I find something better.
I'm afraid my SQL skills are non-existent, but I would suggest you do not store dates and/or times as text values in a database but as datetime (i.e. binary) values. The remarks section in the documentation[^] suggest how to convert it to a large integer. This seems like a lot of work just to save a simple value, but it is Microsoft.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
If you try to do everything at once, it's very hard. Breaking it into steps makes it simpler:
1. Turn the expression string into a list of tokens. A token can be a variable name, an operator, or a parenthesis.
2. Turn the token list into a tree of tokens, where each operator token has child tokens of its operands.
3. Integrate the lowest-level sub-expressions, than combine them according to the operators, e.g. the integral of A + B is the integral of A plus the integral of B.
For step 2, apply two rules to your token list until you have a single operator token left in the list, representing the whole expression. (If you end up with more than one token in the list, you probably started with an illegal expression):
1. If you have the pattern: "(", [token], ")", replace it with [token], i.e. delete parenthesis tokens around a single value.
2. In the most deeply-nested parentheses, replace [token] [operator] [token] in the list with [operator], and set [operator]'s left and right child-node pointers to the two token operands. Do this for the highest-precedence operators first.
Well, the End result depends very much on the lanuage definitions you assume, and, what you want to do with the end result.
You need to define Language Rules, for instance, where do f,x,y,a,b,c come from.
In 'C' the compiler builds a Symbol Table, which is a cross referenced database of all variables encountered in a module.
What do you want to do with it. If you want to store it as a 'General Formula, your best bet is probably to convert it to RPN (Reverse Polish Notation) and write an RPN Evaluator for when the rubber hits the road,
In general, I would start with writing a Scanner,the Scanner breaks down the text into Tokens
the 'C' rules are like: A Variable starts with 'A..Z','a..z' or '_'
A Variable name can then be followed with the same, and the chars '0..9'
A Numerical starts with '0..9'
A White Space is a ' '(space), '\t' or a '\n'
So , in the above, the name of the first var is 'f', the next char is a '(' which is not a
legal char for a varname. So, the First token is a Lexical Token, with Identifier 'f'
The Next Token would be a Special Token, LPAREN,
Going on in general, (Your Language Definition does not allow for comments),
I would also write a Parser
The Parser calls the scanner , to pick off tokens One by One, ignoring intervening whitespace, or comments, and creates a parsing tree (But it all still depends what you want to do with the expression in the larger scheme of things.
A Book: Writing Compilers & Interpreters (An Applied Approach) by Ronald Mak, ISBN 0-471-50968-X
That's exactly what the method you're invoking returns, the height/width referenced to its parent coordinate system.
If you want to get the offset referenced to the screen (1st level of DOM) you can get it by adding all offset values invoking recursively to 'get_offsetParent' method (n-1) times.