Jump to content

Recommended Posts

  • Replies 48
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Administrators
Posted

Updated. Added REG_BINARY support.

Binary keys are handled as string of 2 digit hex values. So the binary data 01, 99, ff, 0a is represented for reading and writing as "0199FF0A".


 

Posted

Updated.  Added REG_BINARY support.

Binary keys are handled as string of 2 digit hex values.  So the binary data 01, 99, ff, 0a is represented for reading and writing as "0199FF0A".

great :whistle:
Posted
Thanks Jon!!The FileSetAttrib is exactly what I need right now. The script in progress sets attributes at 14 different places so I ended up with functions calling functions calling a function to call @comspec and that's not real pretty code. Any chance of getting FileAppend ('source','destination')? Then I couldget rid af all calls to @comspec completely. :whistle:

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

Look at _FileAppend in the standard library file File.au3. That should help you out. Thx.

Sincerely yours,Jeremy Landesjlandes@landeserve.com

Posted

Thanks a lot. I will take a look at it. BTW; why (all of a sudden?) am I seeing the underscore used at the beginning of function names. Does that serve any useful purpose?

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

  • Administrators
Posted

Thanks a lot.  I will take a look at it.  BTW; why (all of a sudden?) am I seeing the underscore used at the beginning of function names.  Does that serve any useful purpose?

_ function names mean that they are not part of the autoit.exe file but are from the standard include library instead (Program Files\AutoIt3\Include).

I thought it was important that users knew what was built in and what was not.


 

  • Administrators
Posted

Updated again. I've fixed URLDownloadToFile (i think).

When I say fixed, I mean completely rewrote using different functions.

I think the bug/whatever that was crashing the function was actually messing up security too - people reported that their personal firewall was ignoring AutoIt file requests! I'm pretty sure that the new version is well behaved but please report your experiences with the new version.


 

  • Administrators
Posted

The recent additions are excellent!

Just wondering:  What else is on the to-do list?  (I think in one thread you said decimal to hex conversion should be a built-in function.)

Not much. I'm on the verge of freezing any new stuff. :whistle:


 

  • Administrators
Posted

Updated with 3 new mouse options.

MouseClickDelay

MouseClickDownDelay

MouseClickDragDelay


 

Posted

Updated with 3 new mouse options.

MouseClickDelay

MouseClickDownDelay

MouseClickDragDelay

I will upload on the morning after a little rest a StringFormat implementation as sprintf. that will solve a lot of formating numbers. I need to write the docs

///////////////////////////////////////////////////////////////////////////////
// Util_StringFormat()
///////////////////////////////////////////////////////////////////////////////

AUT_RESULT Util_StringFormat(VectorVariant &vParams, int iNumParam, Variant &vResult)
{
    char szOutput[AUT_STRBUFFER+1];
    const char *szFormat;
    char *szDelim;
    char ch;

    int n;

    int i = 0;   // to scan Format specification
    int j = 0;   // to store in the output param

    szFormat = vParams[0].szValue();

    for (n=1; n<=iNumParam; ++n)    // to loop once more for concatenating after last format specification

    {            // Append this to our output while not '%'
  ch = szFormat[i++];
  while (ch != '%' && ch != '\0')
  {
     szOutput[j++] = ch;
     ch = szFormat[i++];
  }
  szOutput[j] = '\0';


  if (szFormat[i] != '%' )
  {
     if (ch == '\0' || n == iNumParam)
    break;      // no more param or end of Format specification

     // retrieve Format specification
     szDelim = strpbrk(&szFormat[i], "cCdiouxXeEfgGsS");
     if (szDelim != NULL)
     {
    ch = szDelim[1];  // save char after end of Format specification
    szDelim[1] = '\0';

    if (vParams[n].isString())
     sprintf(&szOutput[j], &szFormat[i-1], vParams[n].szValue());
    else
    if (vParams[n].isInt())
     sprintf(&szOutput[j], &szFormat[i-1], vParams[n].nValue());
    else
    if (vParams[n].isFloat())
     sprintf(&szOutput[j], &szFormat[i-1], vParams[n].fValue());

    i = strlen(szFormat);   // skip Format specification
    szDelim[1] = ch;  // restore next char

    j = strlen(szOutput);   // to concatenate next non Format specification
     }
  }
  else  // case %%
  {
     --n;        // no param used
     szOutput[j++] = szFormat[i++]; // store %
  }
    }

    vResult =  szOutput;
    return AUT_OK;

} // Util_StringFormat()
Posted

Jon, before freezing the code, could you look at FileGetTime?

The array values for hour, minute, and second are only one digit if they are < 10. This makes it difficult to convert the results to "YYYYMMDDHHMMSS" format....

(This may be better suited as a user-library function, but, I'd be happy if you changed the FileGetTime output to a single string in the format "YYYY,MM,DD,HH,MM,SS" which allows a user to easily obtain an array from (using StringSplit) or easily obtain YYMMDDHHMMSS from (using StringReplace).)

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
  • Administrators
Posted

Updated:

1. FileGetTime returns strings padded with 0s

2. Added JP's StringFormat() function - "Funky" does not even come close :whistle:


 

Posted

I think if I were to say the two features I would like to see implemented before freezing is Hex2Dec and Reading/Writing Reg_Binary.

Thanks for everything though. :whistle:

red

Posted

I think if I were to say the two features I would like to see implemented before freezing is Hex2Dec and Reading/Writing Reg_Binary.

Thanks for everything though. :whistle:

red

I'll attempt to port my base conversion functions to use AutoIt's types and see if it still works okay. It can convert between base 2 and 36 freely, so what functions would people like? Are these enough, too many, too little?

Dec2Hex($DecIn)

Hex2Dec($HexIn)

ConvertBase($NumberIn, $BaseFrom, $BaseTo)

I'll try and get something working in the next day or two.

  • Administrators
Posted

I think if I were to say the two features I would like to see implemented before freezing is Hex2Dec and Reading/Writing Reg_Binary.

Thanks for everything though. B)

red

REG_BINARY was done days ago. Do keep up. :whistle:


 

Posted

I'll attempt to port my base conversion functions to use AutoIt's types and see if it still works okay.  It can convert between base 2 and 36 freely, so what functions would people like?  Are these enough, too many, too little?

Dec2Hex($DecIn)

Hex2Dec($HexIn)

ConvertBase($NumberIn, $BaseFrom, $BaseTo)

I'll try and get something working in the next day or two.

This is really easy. I've created a template which takes a string-type class as a parameter, all that class needs is a += overload to concatenate a character onto the string. I've ported 1 function (of 2 originally) to this new format and it works with both std::string and Jon's AString type.

Jon, this doesn't use any external libraries (I'm using my own version of pow() and I've avoided atoi or anything else like that). However, it does use exceptions to signal an error condition (Which are easily caught and converted to an @error). This doesn't present any issues, does it? AutoIt is compiled with C++ Exceptions on, correct? Just wondering, I haven't noticed exceptions being used in any other place...

  • Administrators
Posted

Exceptions are turned off.

Just a really basic implementation of hextodec is all that is needed.


 

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...