Jump to content
Sign in to follow this  
LeCarre

StringStripWS Bug?

Recommended Posts

LeCarre

Small chance i'm too tired to think straight, but I do believe this is a bug.

I was reading strings from a file which were 32 bytes in length. Padded with 00's

So I thought i'd strip off the exess with StringStripWS. Which docs say can strip CHR(0) as whitespace.

Not working, here's a modified from the Example that Duplicates the problem.

All whitespace removed exept the Null Char.

#include <StringConstants.au3>
#include <MsgBoxConstants.au3>

; Strip leading and trailing whitespace as well as the double spaces (or more) in between the words.
Local $sString = "Thisisasentencewithwhitespace." & CHR(0)
ConsoleWrite(StringLen($sString) & @CRLF)
$sString = StringStripWS($sString, $STR_STRIPTRAILING)
ConsoleWrite(StringLen($sString) & @CRLF)
 
Prints to console size of the string before and after as 31.  No Changes.

Share this post


Link to post
Share on other sites
Melba23

LeCarre,

It was a bug - it is fixed in the latest Beta. :)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
LeCarre

:) my excuse is I'm Older.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Similar Content

    • BetaLeaf
      By BetaLeaf
      As the title says, when a script that is stored on a Google Drive File Stream drive is ran or compiled, it fails to work at all.
      Basically, Google Drive File Stream creates a G:\ drive where you can access all your files. The difference between this and Google Backup and Sync is your files are downloaded as needed rather than they always be downloaded and taking up storage. 
      How to Reproduce Bug
      1. Download and Install Google Drive File Stream
      2. Sign into Google Drive File Stream with a G Suite account. 
      3. Create a AutoIt Script and save it to Google Drive File Stream. (See attached file)
      4. Attempt to run or compile this AutoIt Script. 
       
      AutoIt appears to act like the script is (incorrectly) empty and ends immediately. (You can kind of tell based on file sizes from a successful and failed compile).
      I've also attached a Process Monitor log file. Hopefully someone can figure this out, because having to move the script out of the drive just to run or compile it is super annoying and I lose version revisioning Google Drive provides me.
      test.au3
      Logfile.PML
    • Byte11
      By Byte11
      WinSetState ("[CLASS:OpusApp]", "", @SW_SHOWMAXIMIZED) and WinSetState ("[CLASS:OpusApp]", "", @SW_MAXIMIZE) don't maximize the window.  Using WinSetState("[CLASS:OpusApp]","",@SW_RESTORE) allows me to maximize it about 15% of the time. I've tried using  WinMove("[active]",0,0,@Desktopwidth,@Desktopheight), but that only makes it worse. I've also tried putting in a sleep and maximizing it again. Does anyone have a solution?
      Here's my code:
      The startup script is intentionally commented, because I'm not testing it right now. The other comment is just for debugging when I need it. 
       
      UPDATE: When I run two instances of the program, it works almost all the time, but if I copy the code inside the else statement twice it doesn't work at all (despite the fact that it's running the same code just in one program vs two). I also noticed that when I run two instances of it, about 50% of the time when it opens both the windows, it also hits the windows button and types the letter d into the search box. Neither of these actions are in my code. I'm not really sure what's going on. 
    • distancesprinter
      By distancesprinter
      _ArrayDisplay($aArray, "Window Title", "1:", 0, Default, "Column") ; Expected results are rows 1 to the end of the array, all columns. The result is rows 0-1, all columns. The API reference is here:
      https://www.autoitscript.com/autoit3/docs/libfunctions/_ArrayDisplay.htm
       
      Am I doing something wrong?
    • imitto
      By imitto
      Hi!
      I just playing around with _ArrayMin for my next project, but seems like it's not working. I think the code is OK, but I always get the value of $aArray[2][1], not col 2's lowest value (see attached image)

    • nss
      By nss
      Hi all.
       
      Because of me wondering if I could access the key/value pair arrays with the numbers as indexes, I have found out that the zeroth element for some reason doesn't return anything.
      Here's the example:
       
      local $r[2] $r["test1"]="hello" $r["test2"]="how are you" msgbox(64, $r[0], $r[1]) ; prints the ["test2"] but not ["test1"]. Is this even supposed to be a thing?  
       
      BTW, I haven't seen Autoit get updated since 2015; is it abandened or something?
      Any help/clarification appreciated.
×