Jump to content

Recommended Posts

Posted (edited)

I have the following code which is working incorrectly:

If $Custom_Time_Value[4] = 'PM' And Not $Custom_Time_Value[1] = '12' Then
    $Custom_Hour = $Custom_Time_Value[1] + '12'
Else
    $Custom_Hour = $Custom_Time_Value[1]
EndIf

Even though $Custom_Time_Value[1] does not equal 12...any idea why?

Edited by Vadersapien
Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.
Posted (edited)

line 1;

If $Custom_Time_Value[4] = 'PM' And Not^

Error type:bad logic...

:)

Question... what if $Custom_Time_Value[1] equal to 12?? Does it return the desired results??

Edited by Mison

Hi ;)

Posted

If it's equal to 12 it executes the code under "Else"

Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.
Posted

If it's equal to 12 it executes the code under "Else"

While it's supposed to do otherwise? It's in your logical comparison.. remove NOT operator in line 1.

Hi ;)

Posted (edited)

No it's doing the correct thing if it equals 12...

I'm trying to convert normal time to military time...

Edited by Vadersapien
Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.
Posted (edited)

A simple < instead of an =...why didn't I think of that! :)

Edited by Vadersapien
Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...