|
hehe.. I like your style
Michael Davey
biproject.com rss and blog news in a more palatable format
mobile edition now available!
|
|
|
|
|
Comma operator generates right operand value so condE for this example.
|
|
|
|
|
easiest mistake is not comma
is == sign by just =
from,
-= aLbert =-
|
|
|
|
|
Of course in C++ the comma operator can be overloaded like most others.
So one can make things really interesting.
|
|
|
|
|
Hi, I found this code in an old VB6 app that we need to "upgrade" (in fact replace with a new one be a much better approach, but...)
cbo_Caminos is a ComboBox, o_rs is defined as ADODB.Recordset
If CInt(Trim(Mid(cbo_Caminos.Text, 151, 6))) = CInt(o_Rs.Fields("NroCamino")) Then<br />
....<br />
'do something <br />
End If<br />
And yes o_Rs.Fields("NroCamino") is an integer
Why not use ItemData of the combobox to store de integer value associated whit the content of the combobox text?
More on the same form
Private Sub .......()<br />
Dim o_rs As New ADODB.Recordset <br />
Dim s_Sql As String<br />
<br />
s_Sql = "" <br />
s_Sql = "Select * from ......" <br />
<br />
Set o_rs = New ADODB.Recordset <br />
Set o_rs = DBConnect.Execute(s_Sql)<br />
.....<br />
.....<br />
<br />
If mAutmoatico Then ' mAutmoatico is boolean defined as global var<br />
s_Sql = ""<br />
s_Sql = "Select .....<br />
s_Sql = s_Sql & "From ...."<br />
s_Sql = "Where ...."<br />
set o_rs = DBConnect.Execute(s_Sql)<br />
....<br />
End If
For some miraculous reason mAutmoatico is always false when reach the above If
Enjoy.
Habetis bona deum
|
|
|
|
|
DoomedOne wrote: For some miraculous reason mAutmoatico is always false when reach the above If
Good thing, too. 'Cause I don't think the sql is going to work very well. It will only have a where clause in it.
|
|
|
|
|
DoomedOne wrote: old VB6 app that we need to "upgrade"
I dont think VB6 has an upgrade path
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
He could always move on to VB6's offspring. It has already surpassed its parent!
ROFLOLMFAO
|
|
|
|
|
leppie wrote: I dont think VB6 has an upgrade path
Yes it has - it's called the Recycle Bin.
|
|
|
|
|
|
Pete O'Hanlon wrote: I dont think VB6 has an upgrade path
Yes it has - it's called the Recycle Bin.
Sweet
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Impeccable, Unfailing, Trusted Upgradepath for VB.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
void set_ptList(int len, int *start)<br />
{<br />
int i, z, l;<br />
<br />
i = 0;<br />
z = 0;<br />
<br />
while (i < len)<br />
{<br />
<br />
if (new_settings[3][i] != act_settings[3][i])<br />
{<br />
if (i < (len-1))<br />
{<br />
if (new_settings[3][i] > act_settings[3][i+1])<br />
{<br />
i++;<br />
z++;<br />
}<br />
else<br />
{<br />
for (l = i; l >= i-z; l--)<br />
{<br />
list[*start][0] = 3;<br />
list[*start][1] = l;<br />
(*start)++;<br />
}<br />
z = 0;<br />
i++;<br />
}<br />
}<br />
else<br />
{<br />
l = i;<br />
i++;<br />
while (z >= 0)<br />
{<br />
list[*start][0] = 3;<br />
list[*start][1] = l;<br />
(*start)++;<br />
z--;<br />
l--;<br />
}<br />
}<br />
}<br />
else<br />
{<br />
i++;<br />
}<br />
}<br />
<br />
}<br />
<br />
Have a nice life!!
|
|
|
|
|
Looks some kind of sort method to me :P
|
|
|
|
|
it shows there is no need for obfuscators in the modern toolbox.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Apparently this code generates a list of reversed ordered blocks of indexes where the new_settings and acc_settings differ, separating the block in the items where the value in new_settings is > the next item in acc_settings.
I guess...
|
|
|
|
|
Surrender!!! You wrote it.
Greetings from Germany
|
|
|
|
|
Quick n Easy Obfuscation!
Search for the regular expression
// {.*}
and replace with nothing at all.
(God help you if you use // anywhere in like, a file path).
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
It's a breath mint and a dish detergent.
|
|
|
|
|
Uhm... Provides theoretical foundation to Dark Bulk Matter existence?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
It returns the number 42 and the question is "How many roads must a man walk down?"
|
|
|
|
|
Now thats a good one!
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
Awww shucks, now it happened again.
|
|
|
|
|
It's a model describing the eating pattern probability of termites...
-- Ian
|
|
|
|
|
First it missed a good indentation.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|