Feeds:
Posts
Comments

4D unary operator (read i++)

Can’t tell you how many times I wish I had the capability to ‘++’ something.

` valid 4D version of '++'
C_LONGINT($i) ` initializes $i=0
$i:=$i+1 ` why not $i+:=1 or $i++

As part of the 4Dv11 upgrade timestamps were supposed to be included.

However once again 4D shows no developer sense in this feature:

When pull[ing] data from a 4D data source over ODBC … be aware that when accessed via ODBC or SQL, the DATE field is treated as a SQL Timestamp field.

Really? So what should I do with my existing ODBC web code? Oh no problem, just change your SQL statement to include DATE_TO_CHAR(my_field, "MM/DD/YY") commands. Or write a function that strips the time away from the data field.

Want to use that stored timestamp value in 4D? Forget it. No variable type of C_TIMESTAMP is available. Once again the features of the SQL engine cause developers headache on the pure 4D side.

Maybe someday in the future 4D engineering will get the features in both engines synchronized and making sense.

Epoch/Unix timestamp command

Would really like to have a timestamp command that could return the number of seconds elapsed since epoch.

4D commands Milliseconds and Tickcount return the time elapsed for the current process.

SQL functions CURRENT_TIMESTAMP and CURTIMEreturn HH:MM:SS not seconds elapsed. (Never mind the apparent lack of a naming convention)

C_LONGINT($seconds_since_epoch)
` Time is currently a command that requires parameters
` lets change it so no params = unix timestamp
$seconds_since_epoch:=Time
Design a site like this with WordPress.com
Get started