Page 1 of 1 1
Topic Options
#208785 - 2014-04-14 04:02 PM Result of Function to INI
vitaminc Offline
Just in Town

Registered: 2012-07-25
Posts: 3
Loc: Germany
Just a simple question:

I need the result\output of the function:
TimeConvert(@DATE + ' ' + @TIME) *1000 ?
to write it to a INI file (WRITEPROFILESTRING).

Any idea?

Thank's
Sascha

Top
#208786 - 2014-04-14 05:05 PM Re: Result of Function to INI [Re: vitaminc]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Welcome to the board.

You answered your own question. You can use WriteProfileString to write to ini files.

 Code:
Break on

$inifile = "PathAndFileNameOfINIFileGoHere.ini"

$value = TimeConvert(@DATE + ' ' + @TIME) * 1000

$rc = WriteProfileString($inifile, "SectionName", "ValueName", $value)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#208787 - 2014-04-14 06:12 PM Re: Result of Function to INI [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Welcome!

It appears that you are writing the millisecond timestamp of an event..

TimeConvert() returns seconds, so multiplying by 1000 to get a ms value will always result in a value ending in "000". If you need better accuracy than that, you can then add the @MSECS value to your calculation.

For example - if TimeConvert retuned 593297, multiplying by 1000 would yield 593297000. If you changed your calculation to
 Code:
$Value = (TimeTimeConvert(@DATE + ' ' + @TIME) * 1000) + @MSECS
you would have a fairly precise time. @MSECS returns a value between 0 and 999, representing the MSec part of the current time.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#208788 - 2014-04-14 08:08 PM Re: Result of Function to INI [Re: Glenn Barnas]
vitaminc Offline
Just in Town

Registered: 2012-07-25
Posts: 3
Loc: Germany
Thank you, great help!!

I guess you also can help me with WshPipe()

I need to create a MD5 hashcode, i like to use md5.exe (http://www.fourmilab.ch/md5/), because i didn't found a native solution with KIX.

I've all necessary data in my INI file to create the MD5 code. Now I like to create
a MD5 code and write it to INI (WRITEPROFILESTRING again).
 Code:
$hashtext = ReadProfileString("$userini", "UserSettings", "Hashtext")
$md5arg = WshPipe('\\path\blah\md5.exe -n -l -d$hashtext')
WriteProfileString ("$userini", "UserSettings", "md5", $md5arg i have no idea)

I don't know how to get the Wshpipe work with WriteProfileString..

Sascha



Edited by Mart (2014-04-15 09:22 AM)
Edit Reason: Please use code tags when posting code.

Top
#208789 - 2014-04-14 08:42 PM Re: Result of Function to INI [Re: vitaminc]
vitaminc Offline
Just in Town

Registered: 2012-07-25
Posts: 3
Loc: Germany
Sorry for wasting your time, already found the correct syntax..
 Code:
$hashtext = ReadProfileString("$userini", "UserSettings", "Hashtext")
$md5arg = WshPipe('\\cef-de.local\netlogon\md5.exe -n -l -d$hashtext')
$md5result = Join($md5arg[0], @CRLF) ?
$rc = WRITEPROFILESTRING("$userini", "UserSettings", "md5", $md5result)


Edited by Mart (2014-04-15 09:23 AM)
Edit Reason: Please use code tags when posting code.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1188 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.186 seconds in which 0.153 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org