Sign in to follow this  
Followers 0
BBardou

Lower case and upper case in DriveGetDrive

4 posts in this topic

Hello everyone,

I have a script that works pretty well but sometimes (once in a hundred times) I have a very strange bug.

Here are the lines where the problem appears:

$var = DriveGetDrive("removable")
ControlSend("Specify", "", "Edit1", $var[1] & "\" & $MyFileName & "-" & @YEAR & @MON & @MDAY & "-" & @HOUR & @MIN & @SEC)

Usually I get the following path:

d:MonFichier-20131028-105712

But when the bug appears I have:

D/8MonFichier-20131028-105712

It is like "shift" is activated for the first part of the path.

I have check the presence of special characters like '+' but nothing.

I also wonder if it could come from DriveGetDrive function. Indeed in windows, drive letters appears in upper case but DriveGetDrive gives lower case.

The difficulty is that this bug happens very rarely so it is hard to track it.

Do you have an idea where this bug comes from?

Thanks for your help

Share this post


Link to post
Share on other sites



BBardou,

Welcome to the AutoIt forum. :)

The Send functions do seem to occasionally mess up the text string like this. I would suggest creating the filename string first and then sending it an a single variable rather than creating it "on the fly". That way you give AutoIt the best chance to read it cleanly. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Add a fifth parameter in your ControlSend call and set it to 1:

 

[optional] Changes how "keys" is processed:
  flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow.
  flag = 1, keys are sent raw.

"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Share this post


Link to post
Share on other sites

Hi,

I will try all your suggestions.

Thank you for your help.

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  
Followers 0