-6

IF OFFSET >=0 THEN

TIME_LOCAL:= ((current_time + OFFSET)>24) ? ((current_time + OFFSET) - 24) : (current_time + OFFSET);

else

TIME_LOCAL:= ((current_time + OFFSET) < 0) ? ((current_time + OFFSET) + 24) : (current_time + OFFSET);

endif;

Tim Edwards
  • 1,031
  • 1
  • 13
  • 34
Videlov
  • 1
  • 1
  • This isn't legal VBA... or VB.NET. What language is this? – Mathieu Guindon Aug 19 '16 at 14:51
  • In **VBA** the `?` token is a shortcut for the `Print` instruction (which is equivalent to `Debug.Print`), and the VBE (the editor) automatically changes `?` to `Print`; the `:` token is usually an *instructions separator* and is used to combine multiple statements on the same logical line of code, e.g. `For i = 0 To 100 : Debug.Print i : Next` - when used immediately after an identifier at the start of a line, it denotes a *line label*, e.g. `CleanFail:`, which can be used in `On Error` statements, e.g. `On Error GoTo CleanFail`, or simply with `GoTo` statements. Lines don't end w/ `;` in VB. – Mathieu Guindon Aug 19 '16 at 15:08

1 Answers1

2

The conditional operator (?:) returns one of two values depending on the value of a Boolean expression. Following is the syntax for the conditional operator. condition ? first_expression : second_expression;

Jpad Solutions
  • 332
  • 1
  • 12